// JavaScript Document


function setUpMouseOver(target){

	var s = /(.*)\.(.*)/;
	s.exec(target.getAttribute("src"));
	var normalSrc=target.getAttribute("src");
	var hoverSrc=target.getAttribute("src").replace(/(.*)\.(.*)/,RegExp.$1+"_hover."+RegExp.$2);
	
	var dummyImg=new Image();
	dummyImg.src=hoverSrc;
	
	target.onmouseover=function(){this.src=hoverSrc;}
	target.onmouseout=function(){this.src=normalSrc;}

}


function checkForMouseOvers(){
	var obejcts = document.getElementsByTagName("img");
	for (ti=0;ti<obejcts.length;ti++) {
	t = obejcts[ti];
	if (t.nodeName == "IMG" && t.getAttribute("hover")) {
		setUpMouseOver(t);
		}
    }
}

if(window.addEvent){addEvent(window, "load", checkForMouseOvers);}
