$(function (){

if($.browser.firefox() && $.browser.win()){
	$("#mainWrapper").css('min-width', '980px');
}

//	NAVIGATION SECTION
//	------------------
		
	//Hover Intent config's
 	var configSubMenu = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 0, // number = milliseconds for onMouseOver polling interval    
     over: over, // function = onMouseOver callback (REQUIRED)    
     timeout: 400, // number = milliseconds delay before onMouseOut    
     out: out // function = onMouseOut callback (REQUIRED)    
	};
	$("#nav .subMenu").hide();	
 	
 	//Submenu display
 	$("#nav > ul > li").each(function () {
	 	if($("#" + $(this).attr("id")+"> div.subMenu").length > 0){
	 		$("#" + $(this).attr("id")).hoverIntent(configSubMenu);
	 	}
 	});
	
	function over(evt) {
		//Align
		var thisOne = "#"+$(this).attr("id");
		var leftPos = $(thisOne).position().left;
		$(thisOne + " .subMenu").css("left", leftPos+25);

		$("#nav > ul > li > a").removeClass("thisLink");
		$(thisOne + " > a").addClass("thisLink");
		//Display
		thisMenu = "#"+$(this).attr("id")+" .subMenu";
		
		$(thisMenu).slideDown(200, function() { 
			$(thisOne + " > a").addClass("thisLink"); 
		});
		
		
	}
	function out(evt) { 
		//Hide
		thisMenu = "#"+$(this).attr("id")+" .subMenu";
		$(thisMenu).slideUp(200);
		
		var thisOne = "#"+$(this).attr("id");
		$(thisOne + " > a").removeClass("thisLink");
	}

});
