$(document).ready(function() {

//Using a sprite for the backround of the menu this script centers the background
//with the center of the list item

//NOTE: It doesn't matter how long/short the tag is so long as the image sprite is longer than the element allowing this to work
//      well with dynamically generated menus.




  $("#navigation ul li").hover(function(){
        $('ul:first',this).css('visibility', 'visible');
    }, function(){
        $('ul:first',this).css('visibility', 'hidden');
    });


$('#navigation ul#nav').find('li:first > a').css('padding-left', '15px');
$('#navigation ul#nav').find('li:last > a').css('padding-right', '0');
$('#navigation ul#nav').find('li:last > a').css('background', 'none');



// This will change the dropdown menu's BG color and add underline under the link text.





$("ul.dropdown li a").hover(function(){
    
        $(this).addClass("hover");
            
    }, function(){
    
        $(this).removeClass("hover");
            
    });


































































//			Preload Images
//*********************************************//	
	$.preloadImages = function() {
       for(var i = 0; i<arguments.length; i++) {
               $("<img />").attr("src", arguments[i]);
       }
	}

    $.preloadImages("hoverimage1.jpg","hoverimage2.jpg");


}); // Close document.ready

