var preLoadImg = new Object();

function initRollover(){
	$("img.rollover").each(function(){
		var imgSrc = this.src;
		var sep = imgSrc.lastIndexOf('.');
		var onSrc = imgSrc.substr(0, sep) + '_hv' + imgSrc.substr(sep, 4);
		var selectedSrc = imgSrc.substr(0, sep) + '_hv' + imgSrc.substr(sep, 4);
		preLoadImg[imgSrc] = new Image();
		preLoadImg[imgSrc].src = onSrc;
		//alert($(this).attr("id"));
		if($(this).attr("id") == "current"){
			//$(this).ready( function() { this.src = selectedSrc; } )
			this.src = selectedSrc;
			$(this).hover(
				function() { this.src = onSrc; },
				function() { this.src = selectedSrc; }
			);
		}else{
			$(this).hover(
				function() { this.src = onSrc; },
				function() { this.src = imgSrc; }
			);
		}
	});
}
$(function(){
	initRollover();
});
