﻿jQuery(function() {                                         

// HIDING 'search this site...' TEXT ---------------------------------------------------------------------------------------------
	/*
		The following code hides the default text 'search this site...' 
		in the search textbox. We change the color of the text to the
		color of the textbox background color, then on focus we change 
		the color back to white, then on blur we once again change the
		color back to the background color and clear the textbox.
	*/
	$('input[class*= "s4-searchbox-QueryPrompt"]').css("color","#3E4144");

	$("input[class*= s4-searchbox-QueryPrompt]").focus(function () { 
		 $(this).val("");
		 $(this).css("width","159px");	        
		 $(this).css("color","#fff"); 
	    }); 

	$("input[class*= s4-searchbox-QueryPrompt]").blur(function () { 
	         $(this).css("color","#3E4144"); 
	    });


// SHOWING TOP NAV IMAGES ---------------------------------------------------------------------------------------------

	    $(".menu-horizontal > ul > li > ul").addClass("sf-menu").attr("id","nav");
	    
	    // sets up the image for the Home link
	    $('.menu-horizontal > ul > li > a > span > span.menu-item-text').each(function(){
	     	$(this).html("<img src='/SiteCollectionImages/Home_nav.jpg' border='0' class='topNavImage' />");
	     });
	    
	    // code takes the link text, substitutes an underscore for any spaces and attatches _nav.jpg to find the image
	     $('.menu-horizontal > ul > li > ul > li > a > span > span.menu-item-text').each(function(){
	     	$(this).html("<img src='/SiteCollectionImages/" + 
	     		 $(this).text().replace(/\s+/g ,"_") + "_nav.jpg' border='0' class='topNavImage' />");
	     
	     });
	     
	     	     
// SET TOP NAV DROPDOWN MENU FUNCTIONALITY ---------------------------------------------------------------------------------------------
	   
	   $('.menu-horizontal ul ul').superfish({
		hoverClass: 'sfHover',
		delay: 800,
		animation: {width:'show',height:'show'},
		speed:   'fast',
		autoArrows: false,
		dropShadows: false
	    }).supposition();
	    	    
});

   	

