// Netscape 4.x Reload Bug Patch
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);



// images PreLoad
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];
		}
	}
}





// Get 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;
}



// Swap image
// <a href="xxx.html" onMouseOver="ChgIMG('xxx','','/auto/cmn/img/xxx.gif',1)" onMouseOut="ResetIMG()">
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 image
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
// <a href="xxx.html" target="xxx" onclick="WinOpen('','xxx','scrollbars=yes,location=no,menubar=no,directories=no,status=yes,resizable=no,width=560,height=450');">
var newwin;
function WinOpen(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);
	}
}



