
/* ロールオーバー処理 */

/*
 Btn Class v1.1
 update 2007.12.10
 create K.Kubonaka 
*/

function Btn(elm) {
	
	var me = this;
	this.elm = elm;
	this.over = function() { me.changeImage(true); };
	this.out = function() {	me.changeImage(false); };
	this.init();
}

var _Btn = Btn.prototype;

_Btn.init = function() {
	var me = this;
	var img_on = new Image();
	var img_str = this.elm.getAttribute("src");
	img_on.src = img_str.replace("_off", "_on");
	this.setEvent();
};


_Btn.doSelect = function() {
	this.deleteEvent();
	this.changeImage(true);
};


_Btn.setEvent = function() {
	try {
		this.elm.addEventListener("mouseover", this.over, false);
		this.elm.addEventListener("mouseout", this.out, false);
	} catch(e) {
		this.elm.attachEvent("onmouseover", this.over);
		this.elm.attachEvent("onmouseout", this.out);
	}
};


_Btn.deleteEvent = function() {
	try {
		this.elm.removeEventListener("mouseover", this.over, false);
		this.elm.removeEventListener("mouseout", this.out, false);
	} catch(e) {
		this.elm.detachEvent("onmouseover", this.over);
		this.elm.detachEvent("onmouseout", this.out);
	}
};


_Btn.changeImage = function(flag) {
	var img = this.elm.getAttribute("src");
	this.elm.setAttribute("src", (flag) ? img.replace("_off", "_on") : img.replace("_on", "_off"));
};


/*
 roSetter v1.1
 update 2007.12.10
 create K.Kubonaka 
*/

(function(func) {
	try {
		window.addEventListener("load", func, false);
	} catch(e) {
		window.attachEvent("onload", func);
	}
})(function() {
	var btnArray01 = document.getElementsByTagName("img");
	var btnArray02 = document.getElementsByTagName("input");
	for (var i = 0, ln = btnArray01.length; i < ln; i++) {
		if (btnArray01[i].getAttribute("src").indexOf("_off.") >= 0) new Btn(btnArray01[i]);
	}
	for (var i = 0, ln = btnArray02.length; i < ln; i++) {
		try{
			if (btnArray02[i].getAttribute("src").indexOf("_off.") >= 0) new Btn(btnArray02[i]);
		} catch(e){
		}
	}
});


function moveWMV(n){
		
		str = '<OBJECT id="MediaPlayer" width="320" height="314" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components... type=" application/x-oleobject><PARAM name="FileName" value="wmv/' + n + '.wmx"><PARAM name="AnimationatStart" value="no"><PARAM name="TransparentatStart" value="no"><PARAM name="ControlType" value="0"><PARAM name="AutoStart" value="true"><PARAM name="ShowStatusBar" value="true"><EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="wmv/' + n + '.wmx" width="320" height="314" showcontrols="1" showdisplay="0" showstatusbar="1"></embed></OBJECT>';
	
	//alert(str);
	document.getElementById('movie').innerHTML = str;
		
}


/* =====================================================================
*
*    2. ポップアップ画像　CSS操作  --> for Technology / OEM
*
* =================================================================== */

function showPop(n) {
	for (var i = 1; i <= 1; i++) {
		if(i == n) {
			document.getElementById('viewArea' + i).style.display = "block";
		} else {
				hidePop(i);
		}
	}
}


function hidePop(n) {
	for (var i = 1; i <= 1; i++) {
		if(i == n) {		
		document.getElementById('viewArea' + i).style.display = "none";
		}
	}
}




