
// ########## Delete Error Message
function HideError(){
	return true;
}
window.onerror = HideError;


// ########## 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);



// #### for Netscape 4.x
function N4_Reload(init) {
	if (init==true) with (navigator) {
		if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
			document.N4_pgW = innerWidth;
			document.N4_pgH = innerHeight;
			onresize = N4_Reload;
		}
	} else if (innerWidth != document.N4_pgW || innerHeight != document.N4_pgH) location.reload();
}
N4_Reload(true);


// ########## PreLoad images
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];
		}
	}
}


// ########## Search & 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;
}


// ########## change image
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 changed 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 

function WinOpenMAP(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=520,height=580');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinOpen00(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=520,height=400');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinOpen01(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=580,height=550');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinOpen02(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=690,height=500');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function sbwin_closed(winVar) {
	var ua = navigator.userAgent
	if( !!winVar ){
		if( ( ua.indexOf('Gecko')!=-1 || ( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1 ) ) ) return winVar.closed
		else return typeof winVar.document != 'object'
	}else return true
}

function nnFont() {
	sSheet = document.styleSheets[document.styleSheets.length-1];
	if ( document.defaultView.getComputedStyle(document.body,"").getPropertyValue("font-size") == "14px" ){
		sSheet.insertRule("body {font-size: 16px}",sSheet.cssRules.length);
	}
}

if ( document.defaultView && document.styleSheets ) window.onload = nnFont;


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


// ########## Browser Info
var ie = (document.all);
var nn4 = (document.layers);
var nn6 = (!document.all && document.getElementById);

// ########## menuopenLayer
function fmenu(menu, mode){
	if(nn6){
		if(document.getElementById(menu).style.display == 'none'){
			document.getElementById(menu).style.display = mode;
		}else{
			document.getElementById(menu).style.display = mode;
		}
	}
	if(ie){
		if(document.all[menu].style.display == "none"){
			document.all[menu].style.display = mode;
		}else{
			document.all[menu].style.display = mode;
		}
	}
}
var layerlist = new Array('menu01','menu02','menu03');
function clearAll(nowlayer){
if(ie){
	for(i = 0 ; i < layerlist.length ; i++){
		if (layerlist[i]!='menu'+nowlayer){
			document.all[layerlist[i]].style.display = 'none';
		}
	}
}
if(nn6){
	for(i = 0 ; i < layerlist.length ; i++){
		if(layerlist[i]!='menu'+nowlayer){
			document.getElementById(layerlist[i]).style.display = 'none';
		}
	}
}

}
// ########## Timer
var timerID = 0;
function Timer(a){
	if(a == 'on') {
		timerID = setTimeout("clearAll(pagenum)",450);
	}else{
		clearTimeout(timerID);
	}
}


// E N D
