/*
 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 setoverbtn()
{
	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 OpenWindowComp(html,name,width,height) {
	WindowComp=window.open(html,name,"width="+width+",height="+height+",toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1");
	WindowComp.focus();
}

if (navigator.appVersion.indexOf("Mac") !=-1){  
 document.write('<link href="/common/css/mac.css" type="text/css" rel="stylesheet">');  
}
var os, ua = navigator.userAgent;
if (ua.match(/Win(dows )?NT 6\.0/)) {
	document.write('<link href="/common/css/vista.css" type="text/css" rel="stylesheet">');  
}



/* =====================================================================
*
*    IE6/Safari 1.3 min-width
*
* =================================================================== */

(function(){
  if(navigator.userAgent.indexOf("MSIE 6.0") ==-1) return;
  var min_max_width = function(){
		var ww = (document.body.clientWidth < 955) ? "950px" : "100%";
		document.getElementById("includeContainer").style.width = ww;
		//document.getElementById("includeHeader").style.width = ww;
		//document.getElementById("includeFooter").style.width = ww;
  };
  attachEvent("onload" , min_max_width);
  attachEvent("onresize", min_max_width);
})();

(function(){
  if(navigator.userAgent.indexOf("Safari/312") !== -1){
		var min_max_width = function(){
			var ww = (document.body.clientWidth < 1052) ? "1047px" : "100%";
			document.getElementById("includeHeader").style.width = ww;
			document.getElementById("includeFooter").style.width = ww;
			document.getElementById("includeContainer").style.width = ww;
		};
		addEventListener("load" , min_max_width);
		addEventListener("resize", min_max_width);
	}
})();



