$(document).ready(function() {
	
	// Preload all rollovers
	$("img.button,input.button").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.png$/ig,"_over.png");
		$("<img>").attr("src", rollON);
	});
	
	$("img.button,input.button").mouseover(function(){
		imgsrc = $(this).attr("src");
		matches = imgsrc.match(/_over/);
		
		if (!matches) {
			imgsrcON = imgsrc.replace(/.png$/ig,"_over.png");
			$(this).attr("src", imgsrcON);
		}
		
	});

	$("img.button,input.button").mouseout(function(){
		$(this).attr("src", imgsrc);
	});
	
});			
