﻿	$(document).ready(function() {
		
		// Preload all rollovers
		$("#leftnav img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			matchon = rollsrc.match(/_on/);
			if (!matchon) 
			{			
			    rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			    $("<img>").attr("src", rollON);
			    test2=2;
			}
		});
		
		// Navigation rollovers
		$("#leftnav a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			matchon = imgsrc.match(/_on/);
			
			// don't do the rollover if state is already ON
			if (!matches && !matchon) 
			{
			    imgsrcON = imgsrc.replace(/.gif$/ig, "_over.gif"); // strip off extension
                $(this).children("img").attr("src", imgsrcON);
			    test2=2;			    
			}
		});
		
		$("#leftnav a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});
		
	
	});