 $(document).ready(function() {
 	$.backstretch("/images/layout/new/page_bg.jpg",{centeredY:false});
   	$(".search input").labelify({ text: function(input) { return "Search Site"; } });
 
 	//Set custom configurations
	var config = {
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		 interval: 100, // number = milliseconds for onMouseOver polling interval
		 over: HoverOver, // function = onMouseOver callback (REQUIRED)
		 timeout: 200, // number = milliseconds delay before onMouseOut
		 out: HoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	$("ul.portals li .subnav").css({'display':'none'}); //Fade sub nav to 0 opacity on default
	$("ul.portals li").hoverIntent(config); //Trigger Hover intent with custom configurations
		  
    function HoverOver() { //When trigger is hovered...  
        $(this).find("ul.subnav").stop().fadeTo('fast', 1).show(); //Drop down the subnav on hover
        $(this).addClass('active').siblings().removeClass('active');
  	}
  	
    function HoverOut(){  
    	$(this).parent().find("ul.subnav").stop().fadeTo('fast', 0, function() {
            $(this).hide();
        });
        $(this).removeClass('active').siblings().removeClass('active');
        //When the mouse hovers out of the subnav, move it back up  
	} 

 	
 });
