$(document).ready(function() {
   

    /*
   
	$("#menu li").each(function() {


		if ($(this).find("span").width() > $(this).find("a").width()) {

			$(this).width($(this).find("span").width());
	   	}  
	   	
	   	if (!$(this).is('.current')) {
	   		$(this).find("span").hide();
	   	}
	   	
	}); 
   
   
	$("#menu li").mouseover(function() {
    	$(this).find("span").show();
   	});
   
   
   	$("#menu li").mouseout(function() {
   		if (!$(this).is('.current')) {
	   		$(this).find("span").hide();
	   	}
	   	
  	});
   
   
    */
    
    
    // MAKE ENTIRE LI A LINK
    
    $("#menu li").click(function() {
    
	   	window.location.href=$(this).find("a").attr('href');
  	});
    
   
    
    
    
    
    
    // TEXT INPUTS
    
    // make all idle
    $("#search input.text").addClass('idle');
        
    // on focus
    $("#search input.text").focus(function () {
    	// remove idle class
    	$(this).removeClass('idle');
    	// if default value - clear
    	if (this.value == this.defaultValue) {
    		this.value = '';
    	}
    	// if not defaut - select
    	if (this.value != this.defaultValue){  
        	this.select();  
        }  
    });

    // on blur
    $("#search input.text").blur(function () {
    	// add idle class
    	$(this).addClass("idle");  
    	// return default text if blank
		if ($.trim(this.value) == ''){  
       		this.value = (this.defaultValue ? this.defaultValue : '');
       	}  
    });

   	
});
