
function MW_enhance_mainnav() {
	/* Assist with dropdown menus for browsers that don't understand :hover */
	jQuery("#mainnav li").hover( function() {
		jQuery(this).addClass("jshover");
	}, function() {
		jQuery(this).removeClass("jshover");
	});
	
	/* Create hover on/off state for nav images */
	jQuery("#mainnav > li > a img").each( function() {
		jQuery(this).clone().addClass("onstate").insertAfter(this).hide();
		jQuery(this).addClass("offstate");
	});
	jQuery("#mainnav a img.onstate").each( function() {
		var imgsrc = jQuery(this).attr("src");
		imgsrc = imgsrc.replace(/\.gif/ig,"-on.gif");
		jQuery(this).attr("src",imgsrc);
	});
	jQuery("#mainnav li").hover( function() { //mouseover
		jQuery(this).find(".offstate").hide();
		jQuery(this).find(".onstate").show();
	}, function() { //mouseout
		jQuery(this).find(".onstate").hide();
		jQuery(this).find(".offstate").show();
	});
	
	/* Disable un-links */
	jQuery("#mainnav a.nohand").click( function() {
		this.blur();
		return false;
	});
}

function Activate_SIFR() {
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"#feature h1", sFlashSrc:"/_flash/whitneymedium.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sBgColor:"#000000", sHoverColor:"#ffffff", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"#feature p.sectionlead", sFlashSrc:"/_flash/whitneymedium_noshadow.swf", sColor:"#212324", sLinkColor:"#212324", sBgColor:"#ffffff", sHoverColor:"#212324", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
	};
}


/**
 *	Enhance the Search box in the navigation.
*/
function MW_enhance_search_box() {
	jQuery("#mainnav input.zoom_searchbox")
		.focus(function(){ 
			var jThis = $(this);
			if(jThis.val() == "Search...")
			{
				$(this).val("").removeClass("searchInstruction");
			}
		})
		.blur(function() {
			var jThis = $(this);
			if(jThis.val() == "")
			{
			   $(this).val("Search...").addClass("searchInstruction");
			}
		})
		.blur();
}


/* Initiate */
jQuery(document).ready( function() {
	MW_enhance_mainnav();
	MW_enhance_search_box();
	//Activate_SIFR();
});