$(document).ready(function() {
  
//Remove the backround image (vertcal divider) from the last <a> tag in the #sub-menu list
//impossible to do with IE6, also easier to target with jQuery in case list is dynamically generated.

$('#sub-menu ul').find('li > a:last').css('background', 'none');


//Using a sprite for the backround of the #sub-menu this script centers the background (where the arrow is on the sprite)
//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.

$('#sub-menu ul li').hover(
    function(){$(this).not('.first').not('.last').addClass('arrow')},
    function(){$(this).removeClass('arrow')}
         );



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

$('#navigation ul').find('li > a:last').css('background', 'none');


















//			Start Image Swap out on hover
//*********************************************//	

// find a link in an unordered list and hook a hover event to it

//$('#sub-menu ul li a').mouseOver(function() {

  //find which <a> tag user is targeting by using the rel attribute
//    if($(this).attr('rel', 'auto')) {
//       $('#image-swap img').fadeOut();}
//       $('#image-swap img').attr('src', 'images/site_concept.png').fadeIn()

    
  
// });


































































//			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


