$(document).ready(function(){
	$('#menu .container').hover(
		function(){
			$('#menu .container').removeClass('hover');
			$('#menu .container .content').hide();
			$(this).addClass('hover');
			$(this).children('.content').show();
		},
		function(){
			$(this).removeClass('hover');
			$(this).children('.content').hide();
		}
	);
	
	$('#topSearch .inputText').focus(function(){
/*		if ( $(this).val() == 'Wpisz nazwę domeny i sprawdź czy jest wolna' ){
			$(this).val('');
		};*/
               if ( $(this).val() == 'Wpisz nazwę domeny .XXX' ){
                       $(this).val('').css( { 'color': '#000' } );
                };
	});	
	$('#topSearch .inputText').blur(function(){
		if ( $(this).val() == '' ){
//			$(this).val('Wpisz nazwę domeny i sprawdź czy jest wolna');
			$(this).val('Wpisz nazwę domeny .XXX').css( { 'color': '#777' } );
		};
	});
	
	if ( $('#content').height() < $('#right').height() ){
		var padding = 0;
		if( $.browser.chrome || $.browser.safari ){
			padding = 120;
		}
		$('#content').css( 'min-height', $('#right').height() + padding );
	}
	
	//splash
	$("#topSearch .submit").live("click", function(event) {  
		$('body').append( '<div id="splash"></div><div id="splashCenter"><div id="splashMsg" class="alignCenter"><p class="splashTitle">Trwa sprawdzanie</p>Wyniki zobaczysz na stronie<img src="/images/domeny_logo.gif" title="Domeny.pl" alt="Domeny.pl" id="splashLogo" /><img src="/images/loader.gif" title="Trwa przenoszenie" alt="Trwa przenoszenie" /></div></div>' );
		event.preventDefault();
        scroll(0,0);
        $("#splash").show();
        $("#splashCenter").show();
        $("html").css("overflow","hidden");
        $("body").css("height","100%");
        setTimeout( function() { $('#topSearch').submit(); }, 2000 );

    });
	
	//
	$("#ABC .title").click(function() {
		$(this).next(".content").slideToggle("slow");
		$("#ABC .title").not(this).next(".content").slideUp("slow");
		$("#ABC .title").removeClass('red');
		$(this).addClass('red');
	});	
	
	$('input.btn').hover(function(){ $(this).addClass('btnHover'); }, function(){ $(this).removeClass('btnHover'); });
	$('.inputText, textarea, input[type="text"], input[type="password"]').focus(function(){ $(this).addClass('formElementActive'); });
	$('.inputText, textarea, input[type="text"], input[type="password"]').blur(function(){ $(this).removeClass('formElementActive'); });

});

$(window).unload(function() {
    $("#splash").hide();
    $("#splashCenter").hide();
});

