// ########## Delete Error Message
window.onerror = null;

// ########## OS,Browser Info
var ie  = (navigator.appName.indexOf('Micr') != -1);
var mac = (navigator.userAgent.indexOf('Mac') != -1 || navigator.userAgent.indexOf('mac') != -1);
var win = (navigator.userAgent.indexOf('Win') != -1 || navigator.userAgent.indexOf('win') != -1);

// ########## Object検索・取得
function GetObj(n, d) {
	var p,i,x;
	if(!d) d = document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x = d.all[n];
	for(i=0; !x&&i<d.forms.length; i++) x = d.forms[i][n];
	for(i=0; !x&&d.layers&&i<d.layers.length; i++) x = GetObj(n,d.layers[i].document);
	if(!x && document.getElementById) x = document.getElementById(n);
	return x;
}

// ########## IMG切り替え
function ChgIMG() {
	var i , j = 0 , x , a = ChgIMG.arguments;
	document.My_sr = new Array;
	for(i=0; i<(a.length-2); i+=3) if ((x=GetObj(a[i]))!=null){
		document.My_sr[j++] = x;
		if(!x.oSrc) x.oSrc = x.src;
		x.src = a[i+2];
	}
}

// ########## 切り替えIMGのReset
function ResetIMG() {
	var i , x , a = document.My_sr;
	for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc; i++) x.src = x.oSrc;
}

// ########## Sub Window Open (Win-IE4不具合回避済み)
var newwin;
function WinOpen(URL,WN,F) {
	if(newwin){
		if(!newwin.closed){
			newwin.location.href=URL;
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,F);
		}
	}else{
		newwin = window.open(URL,WN,F);
	}
}

// ########## 外部サイトへジャンプ時のダイアログBOX表示
function JumpConfirm1() {
	if(confirm("XXXXXに移動します。")) {location.href="http://www.XXXXXXXXXXX.co.jp/";}
}

