
// ########## Delete Error Message
window.onerror = null;

// ########## OS & Browser Info
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var NN4 = ((NN && navigator.appVersion.indexOf('4.',0) != -1));

/*
// ########## Select Style
if(Mac){
	document.write('<link rel="stylesheet" href="/css/mac.css" type="text/css">');
}else{
	document.write('<link rel="stylesheet" href="/css/win.css" type="text/css">');
}
*/

// ########## Browser Info
var ie = (document.all);
var nn4 = (document.layers);
var nn6 = (!document.all && document.getElementById);

// ########## Pre IMG
function PreLoad() {
	var d = document;
	if(d.images){
		if(!d.My_IMG) d.My_IMG = new Array();
		var i , j = d.My_IMG.length , a = PreLoad.arguments;
		for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){
			d.My_IMG[j] = new Image;
			d.My_IMG[j++].src = a[i];
		}
	}
}

// ########## Object Serch
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;
}

// ########## Chg 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];
	}
}

// ########## Reset IMG
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;
}

// ########## NN4 reload
function reloadPage(init){
	if(init==true) with(navigator){
		if((appName=="Netscape")&&(parseInt(appVersion)==4)){
			document.pgW=innerWidth;
			document.pgH=innerHeight;
			window.onresize=reloadPage;
		}
	}else if(innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}

reloadPage(true);

// ########## Sub Window Open _ —a‹à
var newwin;
function WinOpen1(URL,WN){
	if(newwin){
		if(!newwin.closed){
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=660,height=640');
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=660,height=640');
		}
	}else{
		newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=660,height=640');
	}
}
var newwin;
function WinOpen2(URL,WN){
	if(newwin){
		if(!newwin.closed){
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=350,height=640');
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=350,height=640');
		}
	}else{
		newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=350,height=640');
	}
}
var newwin;
function WinOpen4(URL,WN){
	if(newwin){
		if(!newwin.closed){
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=810,height=800');
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=810,height=800');
		}
	}else{
		newwin = window.open(URL,WN,'menubar=no,toolbar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,width=810,height=800');
	}
}
var newwin;
function WinOpen3(URL,WN,F){
	if(newwin){
		if(!newwin.closed){
			newwin = window.open(URL,WN,F);
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,F);
		}
	}else{
		newwin = window.open(URL,WN,F);
	}
}

