/** BEGIN settings **/
var searchDefault = 'trova il tuo negozio'; // Default text of the search input
var searchColor = '#000000'; // Color of text when focused
/** END settings **/



/** BEGIN global varibales **/
var obj = null;
/** END global variables **/

/** BEGIN user-defined functions **/
function checkHover() {
	if (obj) obj.find('ul').fadeOut('fast');
}
/** END user-defined functions **/

/** BEGIN jQuery actions **/
jQuery(function() {
	
	/** begin submenu **/
	jQuery('#header ul > li').hover(
		function() {
			if (obj) {
				obj.find('ul')
					.css('display', 'none');
				obj = null;
			}
			jQuery(this).find('ul')
				.fadeIn();
		},
		function() {
			obj = jQuery(this);
			setTimeout("checkHover()", 1000);
		}
	);
	/** end submenu **/
	
	/** begin search form **/
	jQuery('#s').attr({ 'value' : searchDefault });
	jQuery('#s').focus(function() {
		var temp = jQuery(this).attr('value');
		color = jQuery(this).css('color');
		jQuery(this).css({ 'color' : searchColor });
		if (temp==searchDefault)
			jQuery(this).attr({ 'value' : '' })
	});
	jQuery('#s').blur(function() {
		if (jQuery(this).attr('value')=='') {
			jQuery(this).attr({ 'value' : searchDefault });
		}
		jQuery(this).css({ 'color' : color });
	});
	/** end search form **/
	
	/** begin 125x125 ads **/
	jQuery('.sidebar img').animate({ "opacity" : 0.7 });
	jQuery('.sidebar img').hover(
		function() {
			jQuery(this)
				.stop()
				.animate({ "opacity" : 1 });
		},
		function() {
			jQuery(this)
				.stop()
				.animate({ "opacity" : 0.7 });
		}
	);
	/** end 125x125 ads **/
	
});
/** END jQuery actions **/
