/*
##############################################
#  ini.js                                    #
#                                            #
#  ver1.5 (2003.04.01)                       #
#  ver1.4 (2003.02.01)                       #
#  ver1.3 (2002.12.01)                       #
#  ver1.2 (2002.11.01)                       #
#  ver1.1 (2002.08.01)                       #
#  ver1.0 (2002.01.01)                       #
#                                            #
#  "ini.js" is Initial-setting file.         #
##############################################
*/




// ########## Delete Error Message
// ########## 2002.12.01
function HideError(){
	return true;
}
window.onerror = HideError;






// ########## OS,Browser Info
// ########## 2002.01.01
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);





// ########## StyleSheet¿¶Ž¤¡¦¬¤Ž±
// ########## 2002.01.01
if (win) {
	document.write('<link rel="stylesheet" href="css/win.css" type="text/css">');
}else{
	if (mac) {
		document.write('<link rel="stylesheet" href="css/mac.css" type="text/css">');
	}else{
		document.write('<link rel="stylesheet" href="css/etc.css" type="text/css">');
	}
}





// ########## Netscape 4.x·Ï ºÆÆÉ¹þ¥Ð¥°²óŽÈ¡¦
// ########## 2003.02.01
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);





// ########## IMG¤ÎPreLoad
// ########## 2002.01.01
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¸¡º÷¡¦¼èÆÀ
// ########## 2002.01.01
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ÀÚŽ¤¡¦Ø¤Ž¨
// ########## 2002.01.01
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
// ########## 2002.01.01
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;
}





// ########## PullDown Menu Link
// ########## 2002.01.01
function JumpMenu(targ,selObj,restore){
	if(selObj.options[selObj.selectedIndex].value != "-"){
		eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
	}
	if (restore) selObj.selectedIndex = 0;
}





// ########## Sub Window Open (Win,Mac-IE4ÉÔ¶ñ¹ç²óÈòºÑ¤ß)
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);
	}
}

// ########## Sub Window Close
function WinClose(){
	window.close();
}






// ########## Layer ÀÚŽ¤¡¦Ø¤Ž¨
// ########## 2002.10.01
function SHLayer() {
	var i,p,v,obj,args = SHLayer.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=GetObj(args[i]))!=null) {
		v = args[i+2];
		if (obj.style) {
			obj = obj.style;
			v = (v=='show')?'visible':(v=='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}






// ########## ¥¢¥ó¥«¡¼½èÍý
// ########## 2003.10.01
function forAnc() {
	window.scroll(0,0);
}


/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

try{
	window.addEventListener("load",initRollovers,false);
}catch(e){
	window.attachEvent("onload",initRollovers);
}



// E N D

