// JavaScript Document

var yomotsuRollover = {
	
	main : function() {
		var img = document.images;
		for (var i = 0; i <img.length; i++) {
			if ((img[i].src.match(/_off\./))||(img[i].style.filter)){
				img[i].onmouseover = yomotsuRollover.over;
				img[i].onmouseout  = yomotsuRollover.out;
			}
		}
	},

	over : function() {
		if((this.style.filter)&&(this.style.filter.match(/_off\.png/))){//(IE5.5-6 && png)
			this.style.filter = this.style.filter.replace('_off.png', '_on.png');
		}
		else{
			this.src = this.src.replace('_off.', '_on.');
		}
	},

	out : function(){
		if((this.style.filter)&&(this.style.filter.match(/_on\.png/))){//(IE5.5-6 && png)
			this.style.filter = this.style.filter.replace('_on.png', '_off.png');
		}
		else{
			this.src = this.src.replace('_on.', '_off.');
		}
	},

	addEvent : function(){
		try {
			window.addEventListener('load', yomotsuRollover.main, false);
		} catch (e) {
			window.attachEvent('onload', yomotsuRollover.main);
		}
	}
}

yomotsuRollover.addEvent();
