
// ########## 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="/common/css/mac.css" type="text/css">');
//}else{
//	document.write('<link rel="stylesheet" href="/common/css/fontsize.css" type="text/css">');
//}

// ########## Browser Info
var ie = (document.all);
var nn4 = (document.layers);
var nn6 = (!document.all && document.getElementById)

// ########## pre image
function preimg(){
	for (i =0;i<crrntImg.length;i++) {
		var ImgList=new Array();
		ImgList[i]=new Image();
		ImgList[i].src=crrntImg[i];
	}
}

// ########## swap image
function chgimg(imgName,img){
	document.images[imgName].src = img;
}

// ########## 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
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);
	}
}

// ########## Anchor
function forAnc() {
	window.scroll(0,0);
}

// ########## Page Print
function PrintThisPage(){
	if(document.getElementById || document.layers){
	myagent = navigator.userAgent;
	if ((myagent.match("Mac")) && (myagent.match("MSIE"))){
	crrntmsg="お使いのブラウザではこの機能はご利用できません。\n ブラウザから印刷してください。";
	alert(crrntmsg);
	}else{	
	window.print();	}
	}
}