//ロールオーバー用js

//透過度
var c = 0.8;

//適用要素
var el = "img";

//適用クラス名
var cl = "over";

function opacityRollover() {
	if(document.getElementsByTagName) {
		var anc = document.getElementsByTagName(el);
		for(var i=0; i < anc.length; i++) {
			if ( (anc[i].getAttribute('class')||anc[i].getAttribute('className') ) == cl )
			{
				anc[i].onmouseover = function() {
					this.style.opacity=c;
					this.style.filter="alpha(opacity="+c*100+")";
				}
				anc[i].onmouseout = function() {
					this.style.opacity="1";
					this.style.filter="alpha(opacity=100)";
				}
			}
		}
	}
}

var addListener = function (target,type, func){
	if (target.addEventListener){
		target.addEventListener(type, func, false);
	}else if (target.attachEvent){
		target.attachEvent('on'+type,func);
	}else{
		return false;
	}
  return true;
};


addListener(window,'load',opacityRollover);
