//ロールオーバー

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
			if(images[i].getAttribute("src").match("_trans."))
			{
				images[i].onmouseover = function() {
					this.style.opacity="0.5";
					this.style.filter="Alpha(Enabled=1,Style=0,Opacity=50)";
				}
				images[i].onmouseout = function() {
					this.style.opacity="1";
					this.style.filter="Alpha(Enabled=1,Style=0,Opacity=100)";
				}
			}
		}
	}
}

//ipad疑似クラス対策
function ipadSupport(){
	if(document.getElementsByTagName && window.addEventListener) {
		var myLinks = document.getElementsByTagName('a');
		for(var i = 0; i < myLinks.length; i++){
			myLinks[i].addEventListener('touchstart', function(){this.className = "hover";}, false);
			myLinks[i].addEventListener('touchend', function(){this.className = "";}, false);
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
	window.addEventListener("load", ipadSupport, false);
}else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
	window.attachEvent("onload", ipadSupport);
}
