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="/contact/css/common/classic.css" />');

}

else{

	document.write('<link rel="stylesheet" type="text/css" href="/contact/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="vg・ border="0" width="90" height="14"></a></td>');

}



function init(){

	LoadFinish = true;

}



function gotoTop(){

	window.opener.location.href='/index.asp';

	window.opener.focus();

}



//TechnologyTCgp

function techWinopen() {

	w = Math.ceil((screen.width-260)/2);

	h = Math.ceil((screen.height-100)/2);

	win_set = 'width=260,height=100,status=0,scrollbars=0,directories=0,menubar=0,resizable=0,toolbar=0,fullscreen=no';

	win_set += ',left=' + w + ',top=' + h;

	techmaster=window.open('/technology/open.asp', 'techmaster',win_set);

}



//Lineup

function openLineupDetail(url, target){

	openWin(url,target,600,570,0,1);

	return false;

}





//LA10thLy[p

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

function openPopup(wUrl){
	var wObj;
	wWidth = 840;
	wHeight = 640;
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	wObj = window.open(wUrl,'link',wOption);
	wObj.focus();
}









//C[WIuWFNg

function class_imglib(){

	this.preloadImg = new Array();

	this.setObj = setObj;

	this.changeSrc = changeSrc;

	this.getTargetObj = getTargetObj;

	

	function setObj(pid,srcPath){

		this.preloadImg[pid] = new Image();

		this.preloadImg[pid].src = srcPath;

	}

	function getTargetObj(id){

		//return (document.getElementById(id) ? document.getElementById(id) : document.images[id]);

		return document.images[id];

	}

	function changeSrc(obj,pid){

		var id = (typeof(obj.id) != 'undefined' ? obj.id : obj);

		if(typeof(this.getTargetObj(id)) != 'undefined' && typeof(this.preloadImg[pid]) != 'undefined'){

			(this.getTargetObj(id)).src = this.preloadImg[pid].src;

		}

	}

}

var img_obj = new class_imglib();

function img_set(){

	img_obj.setObj(arguments[0],arguments[1]);

}

function img_change(){

	img_obj.changeSrc(arguments[0],arguments[1]);

}

function img_onmouseoverhandler(){

	img_obj.changeSrc(this.id,(this.id + ':mouseover'));

}

function img_onmouseouthandler(){

	img_obj.changeSrc(this.id,(this.id + ':mouseout'));

}

function img_sethandler(id,movr,mout){

	if(document.getElementById(id) != null){

		img_set(id + ':mouseover', movr);

		img_set(id + ':mouseout' , mout);

		document.getElementById(id).onmouseover = img_onmouseoverhandler;

		document.getElementById(id).onmouseout  = img_onmouseouthandler;

	}

}



//Flasht@ČĂяo



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>');



}





//button_images̃[I[o[@ꎞIɂ轤ﾉ・
<!--

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  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=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->




