/*	
	CleanCorp Template
	File: sitescript.js
	Stefano Giliberti - kompulsive@gmail.com clickswitch.net		
*/

$(document).ready(function(){
	/* Dropdown */
	$("#navigation li.top-parent").hover(function(){	/* On .top-parent class hover */
			$(this).stop().find("ul.ddown").slideDown(250); /* Finds a list with .ddown class and slide it down in 250ms */
		}, /* On mouse out */
		function(){
			$(this).stop().find("ul.ddown").slideUp(250); /* Finds a list with .ddown class and slide it up in 250ms */
		}
	);
	/* On click fade dropdown out */
	$("#navigation ul.ddown").click(function(){
		$(this).stop().fadeOut("slow");
	});
	
	/* Search box */
	$("input.input-search").val("Search something"); /* Sets "Search something" as default value */
	$("input.input-search").focus(function(){ /* On focus .. */
		inputDef=$(this).val() /* picks the -current- value */
		if(inputDef=='Search something'){ /* if the current value corrispond to the initial value (inputDef var) */
			$(this).val(''); /* empty the input */
			$(this).css('color','#5e5e5e');
		}
	});
	$("input.input-search").blur(function(){ /* on blur */
		inputDef=$(this).val();
		if(inputDef==''){ /* if the current value is null .. */
			$(this).css('color','#ababab');
			$(this).val('Search something'); /* Resets "Search something" as default value */
		}
	});

});
