	
	   
	$(document).ready(function() {
		
		
		
      // Preload all rollovers
		$("#nav img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.jpg$/ig,"Ovr.jpg");
			$("<img>").attr("src", rollON);
		});
		
		// Navigation rollovers
		$("#nav a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/Ovr/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.jpg$/ig,"Ovr.jpg"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		$("#nav a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});
		
		/*
		$("#nav img").hover(
			function()
 			{
  			this.src = this.src.replace(".jpg","Ovr.jpg");
 			},
 			function()
 			{
  			this.src = this.src.replace("Ovr.jpg",".jpg");
 			}
		);
		*/
		
	
	});
