var dir;

var tTimer;

var LoadFinish = false;



var isPc = (navigator.userAgent.indexOf("Windows") != -1);

var isMac = (navigator.userAgent.indexOf("Mac") != -1);

var isNS = (navigator.appName == "Netscape");

var isNS4 = (isNS && (navigator.userAgent.indexOf("Gecko") == -1));

var isNS6 = (isNS && (navigator.userAgent.indexOf("Gecko") != -1));

var isIE = ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1));

var isIEPc = ((navigator.userAgent.indexOf("MSIE") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));

var isIEPc5 = ((navigator.userAgent.indexOf("MSIE 5.0") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));

var isIEPc55 = ((navigator.userAgent.indexOf("MSIE 5.5") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));

var isIEPc6 = ((navigator.userAgent.indexOf("MSIE 6.") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));

var isIEMac = ((navigator.userAgent.indexOf("MSIE") != -1) && isMac && (navigator.userAgent.indexOf("Opera") == -1));

var version = parseInt(navigator.appVersion);

var lP = location.pathname;



if(isNS4 || isIEPc5 || isIEPc55){

	document.write('<link rel="stylesheet" type="text/css" href="/resource/css/common/classic.css" />');

}

else{

	document.write('<link rel="stylesheet" type="text/css" href="/resource/css/common/standard.css" />');

}



function formWin(url,h){

	wh = (h <= (screen.height-100))? h : screen.height-250;

	win_set = 'width=680,toolbar=yes,resizable=yes,menubar=no,status=yes,scrollbars=yes,left=10,top=10';

	win_set += ',height=' + wh;

	swin = window.open(url,'form',win_set);

	swin.focus();

}



function openWin(url,wname,w,h,resizable,toolbar,scrollbars){

	if (h >= (screen.height-30)){

		wh = screen.height-100;

		w += 18;

		scrollbars = 1;

	}else wh = h;

	

	win_set = 'width=' + w;

	win_set += ',height=' + wh;

	win_set += ',resizable=' + resizable;

	win_set += ',toolbar=' + toolbar;

	win_set += ',scrollbars=' + scrollbars;

	win_set += ',fullscreen=no';

	

	swin = window.open(url,wname,win_set);

	swin.focus();

}



function is_opener() {

	var ua = navigator.userAgent;

	if(!!window.opener)

		if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1)

			return !window.opener.closed

	else return typeof window.opener.document  == 'object';

	else return false;

}

function loadOpener(url){

	if(is_opener()){

		window.opener.location.href=url;

		window.opener.focus();

	}else{

		win_set = 'directories=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes';

		swin = window.open(url,'NEW',win_set);

		swin.focus();

	}

}



function mapWin(url,height){

	wh = (!height)? '670' : height;

	if(screen.height >= 788) win_set = 'width=520,height=' + wh + ',scrollbars=0,resizable=0';

	else win_set = 'width=540,height=620,scrollbars=1,resizable=1';

	win_set += ',fullscreen=no,top=5,left=5';

	swin = window.open(url,'mapWin',win_set);

	swin.focus();

}



function disclaimer(){

	wh = '680';

	ww = (isMac)? '620' : '630';

	if(screen.height >= 768) win_set = 'width=' + ww + ',height=' + wh + ',scrollbars=1,resizable=0';

	else win_set = 'width=' + ww + ',height=620,scrollbars=1,resizable=1';

	win_set += ',fullscreen=no,top=5,left=5';

	swin = window.open('/clock/adjust_time.asp','mapWin',win_set);

	swin.focus();

		

	//if(isMac) openWin('/clock/disclaimer.asp','disclaimer',305,300,0,0,0);

	//else openWin('/clock/disclaimer.asp','disclaimer',305,330,0,0,0);

}



function cHColor(layName){

	if(document.getElementById) document.getElementById(layName).style.backgroundColor =focusColor;

	else if(document.all) document.all(layName).style.backgroundColor=focusColor;

}



function deFColer(layName){

	if(document.getElementById) document.getElementById(layName).style.backgroundColor =defoultColor;

	else if(document.all) document.all(layName).style.backgroundColor=defoultColor;

}





function swichLayer(layerName,condition){

	if(isNS6) document.getElementById(layerName).style.visibility = condition;

	if(isIE) document.all[layerName].style.visibility =condition;

}





function chCourser(layerName){

	if (isNS6) layerName.style.cursor = "pointer";

	else layerName.style.cursor = "hand";

}



function getURL(url,target){

	mClose();

	sbmClose();

	if(target == '_blank'){

		win_set = 'directories=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes';

		swin = window.open(url,'New',win_set);

		swin.focus();

	}else if(target == '_popup') openWin(url,'New',740,460,0,0,0);

	else if(target == '_basel') openWin(url,'BASEL',742,540,0,0,0);

	else if(target == '_tech') techWinopen();

	else  location.href = url;

}



function roll(imageName, imageState) {

	if (loaded == 1) {

		tabOn = eval(imageName+"_"+imageState+".src");

		document [imageName].src = tabOn;

	}

}



function underBar(text){

	if(!text) self.status ='　';

	else self.status = text;

}



function writePrinter(){

	if (window.print && ! (isNS && version.charAt(0) <= 4)) document.write('<td><a href="javascript:void(0)" onClick="window.print()"><img src="/images/map/btn_print.gif" alt="プリントする" border="0" width="90" height="14"></a></td>');

}



function init(){

	LoadFinish = true;

}



function gotoTop(){

	window.opener.location.href='/index.asp';

	window.opener.focus();

}




//Flashファイルの呼び出し



function writeFlashTag(url, width, height, bgcolor, id, flashVas) {



	if (!bgcolor) {

		bgcolor = '#ffffff';

	}

	if (!id) {

		id = 'swf';

	}

	if (!flashVas) {

		flashVas = '';

	}



	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" id="' + id + '" align="middle">');

	document.write('<param name="FlashVars" value="' + flashVas + '">');

	document.write('<param name="allowScriptAccess" value="sameDomain" />');

	document.write('<param name="movie" value="' + url + '" />');

	document.write('<param name="quality" value="high" />');

	document.write('<param name="bgcolor" value="' + bgcolor + '" />');

	document.write('<embed src="' + url +'" FlashVars="' + flashVas + '" quality="high" bgcolor="' + bgcolor + '" width="' + width + '" height="' + height + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');

	document.write('</object>');



}