// JavaScript Document

function rollover() {
	if(!document.getElementById) return

	var pre = new Array();
	var tmp;
	var img = document.getElementsByTagName('img');

	for(i=0; i<img.length; i++){
		if(img[i].className=='rollover'){
			var src=img[i].getAttribute('src');
			var ftype=src.substring(src.lastIndexOf('.'), src.length);
			var hsrc=src.replace(ftype, '_on'+ftype);

			img[i].setAttribute('hsrc', hsrc);

			pre[i]=new Image();
			pre[i].src=hsrc;
			
			img[i].onmouseover=function(){
				tmp=this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}

			img[i].onmouseout = function() {
				if(!tmp) tmp=this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', tmp);
			}
		}
	}
}

try{
	window.addEventListener("load",rollover,false);
}catch(e){
	window.attachEvent("onload",rollover);
}
