/************************************************
*
*         " Presented by DKNEX Company. "       
*                 http://dknex.com              
*
*************************************************/
/*******************************************/
/*** " R E D I R E C T  L A N G U A G E " **/
/*******************************************/
function redLang(){
	if(document.URL.indexOf('/ja/') > -1 || document.URL.indexOf('/en/') > -1){
			// Non si fa niente
	}else{
		if((navigator.language&&navigator.language.indexOf('ja')>-1)||(navigator.browserLanguage&&navigator.browserLanguage.indexOf('ja')>-1)){
			// Non si fa niente
		}else{
			location.href="/en/"
		}
	}
}
/*******************************************/
/******** " F R A M E  E S C A P E " *******/
/*******************************************/
if (top != self) { top.location.href = self.location.href }
/*******************************************/
/********* " A C C E S S   L O G " *********/
/*******************************************/
var accimg = new Image();
accimg.src = "/cgi-bin/acc/acclog.cgi?referrer="+document.referrer+"&width="+screen.width+"&height="+screen.height+"&color="+screen.colorDepth;
/*******************************************/
/******* " WIN IE CONTENTS MENU FIX " ******/
/*******************************************/
OS_Name = navigator.userAgent;
if( OS_Name.indexOf( "Mozilla", 0 ) != -1 ){
	Browser_Name = navigator.appName;
	if( Browser_Name.indexOf( "Microsoft", 0 ) != -1 ){
		sfHover = function() {
			var sfEls = document.getElementById("nav").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
		if (window.attachEvent) window.attachEvent("onload", sfHover);
	}
}
/*******************************************/
/******** " O P E N  W I N D O W " *********/
/*******************************************/
function win(fname,Ex,W,H) {
	switch(Ex){
		case "h":NewFileWindow("/"+fname+".html",W,H);break;
		case "s":NewFileWindow("/images/"+fname+".swf",W,H);break;
		case "j":NewImgWindow("/images/"+fname+".jpg",W,H);break;
		case "g":NewImgWindow("/images/"+fname+".gif",W,H);break;
	}
}
/********* " New window " **********/
var subW;
function NewImgWindow(fname,WID,HEI){
Pwid = parseInt(WID)+20;
Phei = parseInt(HEI)+60;
	subW = window.open('','subWin','toolbar=no,lacation=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,close=yes,screenX=0,screenY=0,width='+Pwid+',height='+Phei+',top=0,left=0');
	if (subW.location.href=='about:blank') location.href;
	subW.focus();
	subW.document.open();
	subW.document.writeln('<html>\n<head>');
	subW.document.writeln('<title>Image window.</title>');
	subW.document.writeln('<meta http-equiv="content-type" content="text/html; charset=utf-8">');
	subW.document.writeln('<meta http-equiv="Content-Script-Type" content="text/javascript">');
	subW.document.writeln('<meta http-equiv="Content-Style-Type" content="text/css">');
	subW.document.writeln('<meta http-equiv="imagetoolbar" content="no">');
	subW.document.writeln('<style>body{font-size:12px;}</style>');
	subW.document.writeln('</head>');
	subW.document.writeln('<body>');
	subW.document.writeln('<center><a href="javascript:close();" title="CLOSE"><img src="'+fname+'" lowsrc="/imagesd/pixel.gif" width="'+WID+'" height="'+HEI+'" border="0" alt=""></a></center>');
	if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		subW.document.writeln('<br><div style="text-align:right;font-weight:bold;"><a href="javascript:close();" title="CLOSE"><img src="/tmpimg/icon_close.gif" border="0" alt="CLOSE"></a>&nbsp;</div>');
	else
		subW.document.writeln('<br><div style="text-align:right;font-weight:bold;"><a href="javascript:void();" onclick="window.print();return false;" title="PRINT"><img src="/tmpimg/icon_print.gif" border="0" alt="PRINT"></a>&nbsp;<a href="javascript:close();" title="CLOSE"><img src="/tmpimg/icon_close.gif" border="0" alt="CLOSE"></a>&nbsp;</div>');
	subW.document.writeln('<body>\n<html>');
	subW.document.close();
}
/********* " New window for File " **********/
function NewFileWindow(fname,WID,HEI){
	var subW = window.open(fname,'subWin','toolbar=no,lacation=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,close=yes,screenX=0,screenY=0,width='+WID+',height='+HEI+',top=0,left=0');
	subW.focus();
}
/********* " New window to print " **********/
function PagePrint(uri,WID,HEI){
/*	var subW = window.open(uri+".print",'subWin','toolbar=no,lacation=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,close=yes,screenX=0,screenY=0,width='+WID+',height='+HEI+',top=0,left=0');	*/
	var subW = window.open("/print"+uri,'subWin','toolbar=no,lacation=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,close=yes,screenX=0,screenY=0,width='+WID+',height='+HEI+',top=0,left=0');
	subW.focus();
}
/*******************************************/
/********** " G E T  A G E N T " ***********/
/*******************************************/
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "0";
		this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "0";
		this.OS = this.searchString(this.dataOS) || "0";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].agntn;
			}
			else if (dataProp)
				return data[i].agntn;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return Math.floor(parseFloat(dataString.substring(index+this.versionSearchString.length+1)));
	},
	dataBrowser: [
		{
			string: navigator.vendor,subString: "Apple",identity: "Safari",versionSearch: "Safari",agntn: "6"
		},{
			prop: window.opera,identity: "Opera",agntn: "3"
		},{
			string: navigator.vendor,subString: "iCab",identity: "iCab",agntn: "7"
		},{
			string: navigator.vendor,subString: "KDE",identity: "Konqueror",agntn: "8"
		},{
			string: navigator.userAgent,subString: "Firefox",identity: "Firefox",agntn: "2"
		},{
			string: navigator.userAgent,subString: "Netscape6",identity: "Netscape",versionSearch: "Netscape6",agntn: "4"
		},{
			string: navigator.userAgent,subString: "Netscape",identity: "Netscape",agntn: "4"
		},{
			string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE",agntn: "1"
		},{
			string: navigator.userAgent,subString: "Gecko",identity: "Mozilla",versionSearch: "rv",agntn: "5"
		},{
			string: navigator.userAgent,subString: "Mozilla",identity: "Netscape",versionSearch: "Mozilla",agntn: "4"
		}
	],
	dataOS : [
		{
			string: navigator.platform,subString: "Win",identity: "Windows",agntn: "1"
		},{
			string: navigator.platform,subString: "Mac",identity: "Mac",agntn: "2"
		},{
			string: navigator.platform,subString: "Linux",identity: "Linux",agntn: "3"
		}
	]
};
BrowserDetect.init();

/*******************************************/
/********** " A G E N T  S E T " ***********/
/*******************************************/
Agnt = new Object(BrowserDetect.OS+BrowserDetect.browser+BrowserDetect.version);
document.write('<script type="text/javascript" src="/common/inc.js" charset="utf-8"></script>');

/*******************************************/
/************* " C O O K I E " *************/
/*******************************************/
/* # Create */
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = '; expires='+date.toGMTString();
	}
	else expires = '';
	document.cookie = name+'='+value+expires+'; path=/';
}
/* # Reed */
function readCookie(name) {
	var nameEQ = name + '=';
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/* # Delete */
function defSize(defsize) {
	createCookie('FSize',defsize,0);
	setFontSize(0);
}
/*******************************************/
/********* " F O N T R I S I Z E " *********/
/*******************************************/
function setFontSize(size) {
	Gsize = parseInt(readCookie('FSize'));
	var newset = Gsize; // default
	if (size == null) newset = 2;
	if((size == "up")&&(Gsize+1 <= fmaxsize)) newset = Gsize + 1;
	if((size == "dn")&&(Gsize-1 >= fminsize)) newset = Gsize - 1;
	createCookie('FSize',newset,0);
	currenturl=location.href;
	location.reload(currenturl);
}
function OnLoadCss() {
	CSize = readCookie('FSize');
	if (CSize == null){ createCookie('FSize',2,0); CSize = 2; }
	VCSize = data[type][CSize];
	document.writeln('<style>html, body, table { font-size: ' + VCSize + '}</style>');
}
function changeFontSize(lang) {
	if(lang == "ja"){
		Smallest  = "フォントサイズの縮小";
		Normal1   = "フォントサイズの変更";
		Normal2   = "ノーマルフォントサイズ";
		Largest   = "フォントサイズの拡大";
	}else{
		Smallest  = "Smaller Font Size";
		Normal1   = "Change Font Size";
		Normal2   = "Normal Font Size";
		Largest   = "Larger Font Size";
	}
	Gsize = parseInt(readCookie('FSize'));
	document.write(' ');
		if(Gsize-1 >= fminsize){
			document.write('<a href="javascript: setFontSize(\'dn\')" title="'+Smallest+'" class="Lfresize">[&nbsp;-&nbsp;]</a>');
		}else{
			document.write('<span title="'+Smallest+'" class="Lfresize_max">[&nbsp;-&nbsp;]</span>');
		}
		if(Gsize == 2){
			document.write(' <span title="'+Normal1+'" class="Cfresize">A</span> ');
		}else{
			document.write(' <a href="javascript: defSize(\'2\')" title="'+Normal2+'" class="Cfresize">A</a> ');
		}
		if(Gsize+1 <= fmaxsize){
			document.write('<a href="javascript: setFontSize(\'up\')" title="'+Largest+'" class="Rfresize">[&nbsp;+&nbsp;]</a>');
		}else{
			document.write('<span title="'+Largest+'" class="Rfresize_max">[&nbsp;+&nbsp;]</span>');
		}
	document.write(' ');
}
/*******************************************/
/********** " M A I L  L I N K " ***********/
/*******************************************/
function mtojs(mname,mto,msub){
	var mto    = mto.replace(/%/, "@");
	var str1   = String.fromCharCode(108,111,99,97,116,105,111,110,46,104,114,101,102,32,61,32,39,109,97,105,108,116,111,58);	// location.href='mailto:
	var str2   = String.fromCharCode(60);												// <
	var str3   = String.fromCharCode(62,63,115,117,98,106,101,99,116,61);								// >?subject=
	var url    = escape(location.href);
	var kugiri = "*****************************************";
	eval( str1 + mname + str2 + mto + str3 + msub + "&BODY=" + kugiri + "%0D%0AMail link from this page:%0D%0A" + url + "%0D%0A" + kugiri + "'");
}
/*******************************************/
/******* " C O L O R  L A Y E R S " ********/
/*******************************************/
var ie=(!!document.all)
var nn=(!!document.layers)
var gk=(navigator.userAgent.match(/Gecko/i)!=null)
function changebg(id,val){
	if((ie||gk)&&val.charAt(0)!='#')val='url('+val+')'
	if(ie||gk){document[ie?'all':'getElementById'](id).style['background'+(val.charAt(0)=='#'?'Color':'Image')]=val}else
	if(nn){if(val.charAt(0)=='#'){document.layers[id].bgColor=val}else{document.layers[id].background.src=val}}
}
/*******************************************/
/******* " W I N D O W  C L O S E " ********/
/*******************************************/
var busy=false
function forceclose(){
	if(!busy){
	busy=true
		if(navigator.appName=="Netscape"){
		window.open("","_top")
		window.close()
		}else{
			if(document.all&&(navigator.userAgent.match(/MSIE (\d\.\d)/),RegExp.$1)>=5.5){
			var w=window.open("","_top")
			w.opener=window
			w.close()
			}else{
			window.close()
			var timer=setTimeout("busy=false;forceclose()",500)
			}
		}
	}
}
/*******************************************/
/******* " N O  V I E W  E R R O R " *******/
/*******************************************/
window.onerror=scriptError;
function scriptError(){
	return true;
}
/**************** " E N D " ****************/
