// ########## Delete Error Message
// ########## 2002.12.01
function HideError(){
	return true;
}
window.onerror = HideError;



//-----------------------------------------------------
//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);



//-----------------------------------------------------
//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;
}



//-----------------------------------------------------
//window open
//-----------------------------------------------------

//OS
var mac = (navigator.appVersion.indexOf("Mac") != -1)? true : false;
var win = (navigator.appVersion.indexOf("Win") != -1)? true : false;

//browser
var nn = (navigator.appName.indexOf("Netscape",0) != -1)? true : false;
var nn4 = (document.layers)? true : false;
var opera6 = (navigator.userAgent.indexOf("Opera/6") != -1)? true : false;
var opera5 = (navigator.userAgent.indexOf("Opera/5") != -1)? true : false;
var icab = (navigator.userAgent.indexOf("iCab") != -1)? true : false;
var ie = (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0)? true : false;
var ie4 = navigator.userAgent.indexOf("MSIE 4") != -1;
var ie5 = (navigator.userAgent.indexOf("MSIE 5") != -1)? true : false;


var newWindow = new Array();
var index = 0;

function checkEvent(targetObj,windowW,windowH,scrollbarOption,eventObj){
	var eventType;
	var keycode;
	
	if(window.event){
		keycode = event.keyCode;
		eventType = event.type;
	}
	else if(eventObj){
		keycode = eventObj.which;
		eventType = eventObj.type;
	}
	
	if(keycode == 13 && eventType == 'keypress'){
		openFigWindow(targetObj,windowW,windowH,scrollbarOption);
	}
}

function openFigWindow(targetObj,windowW,windowH,scrollbarOption){
	var windowName = targetObj.target;
	var uri = targetObj.href;
	
	if(scrollbarOption && opera6){
		windowW = windowW -15;
	}
	if(scrollbarOption && win && ie){
		windowW = windowW +15;
	}
	
	var options = 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=' + (scrollbarOption?'yes':'no') + ',resizable=yes,width=' + windowW + ',height=' + windowH;
	
	if(!window.scrollbars){
		//if(scrollbarOption)windowName += '_02';
	}
	
	newWindow = window.open(uri,windowName,options);
	newWindow.focus();
	
	if(newWindow.scrollbars){
		if(scrollbarOption){
			newWindow.scrollbars.visible = true;
		}
		else{
			newWindow.scrollbars.visible = false;
		}
	}
	
/*	if(!(typeof newWindow.resizeBy == 'undefined')){
		var newWindowW = 0;
		var newWindowH = 0;
		var differenceW = 0;
		var differenceH = 0;
		
		if(scrollbarOption && win && ie){
			windowW = windowW - 30;
		}
		
		//Opera,Safari,over NN4
		if(newWindow.innerWidth){
			newWindowW = newWindow.innerWidth;
			newWindowH = newWindow.innerHeight;
		}
		
		//WinIE6 standardmode
		else if(newWindow.document.compatMode == 'CSS1Compat'){
			newWindowW = newWindow.document.documentElement.clientWidth;
			newWindowH = newWindow.document.documentElement.clientHeight;
		}
		
		//over IE5
		else if(newWindow.document.body && newWindow.document.body.clientWidth){
			newWindowW = newWindow.document.body.clientWidth;
			newWindowH = newWindow.document.body.clientHeight;
		}
		
		if(newWindowW && newWindowH){
			differenceW = (scrollbarOption?windowW+15:windowW) - newWindowW;
			differenceH = windowH - newWindowH;
			newWindow.resizeBy(differenceW,differenceH);
		}
	}*/
}

// ########## 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;
	}
}
