nav=navigator.appName.substring(0,1);
//
if(!dt[0]){dt[0]="";}
d0=dt[0]+";;;;;";
moji=d0.split(",");
if(!moji[0]){moji[0]="";}
if(!moji[1]){moji[1]="";}
if(!moji[2]){moji[2]="#008800";}
if(!moji[3]){moji[3]="#ffffff";}
if(!moji[4]){moji[4]="12";}




function tizu_write(){
//tizu.location.href="myhp.htm";
//return;
dw=('<html><head>\n');
dw+=('</head>\n');
dw+=('<body bgcolor=#8888aa topmargin=0 leftmargin=0>\n');
//

dm=new Array();
tizu_dt=map.split(";");
for(i=0;i<tizu_dt.length;i++){
	dm[i]=tizu_dt[i].split(",");
}

tizu_yn=tizu_dt.length;tizu_xn=dm[0].length;

for(i=0;i<tizu_dt.length;i++){
for(j=0;j<dm[i].length;j++){
w=(dm[i][j].substr(0,3))*1;
	ww=2100+(523-w)*1.8;
	if(w>6000){ww=2100+(533-w)*2.08;}
	if(w<5000){ww=2100+(523-w)*1.6;}
	dw+=('<div style="position:absolute;top:'+(i*1600)+';left:'+(j*ww)+';"><img src="'+url+dm[i][j]+'" galleryimg="no" border="0"></div>\n');
}
}


//
dw+=('<div id="point" style="position:absolute;top:0;left:0"><img src="img/point.gif"></div>\n');

//
for(i=1;i<=n;i++){
	dm=dt[i]+",,,";
	mdd=dm.split(",");
md0=mdd[0]+";;;;;";
mdd0=md0.split(";");
if(!mdd0[1]){mdd0[1]=moji[0];}

if(!mdd0[2]){mdd0[2]=moji[1];}
if(!mdd0[3]){mdd0[3]=moji[2];}
if(!mdd0[4]){mdd0[4]=moji[3];}
if(!mdd0[5]){mdd0[5]=moji[4];}
if(mdd0[1]=="h"){mdw="width=1";}else{mdw="";}
	mmy=mdd[2]*1+264;mmx=mdd[1]*1+304;
	dw+=('<div id="xy_'+i+'" onClick="parent.url_link('+i+');return false;" style="position:absolute;top:'+mmy+';left:'+mmx+';text-align:left">\n');
	dw+=('<table border=0 cellpadding=0 cellspacing=0 '+mdw+'>\n');
	dw+=('<tr><td style="background-color:'+mdd0[4]+';color:'+mdd0[3]+';font-size:'+mdd0[5]+'">\n');
		if(mdd[3]==""){
			dw+=(mdd0[2]);
		}else{
			dw+=('<a href="javascript:parent.url_link('+i+')" style="text-decoration:none;background-color:'+mdd0[4]+';color:'+mdd0[3]+';font-size:'+mdd0[5]+'">'+mdd0[2]+'</a>\n');
		}
	dw+=('</td></tr></table></div>\n');
}

dw+=('</body>\n');
dw+=('</html>\n');
tizu.document.open();
tizu.document.write(dw);
tizu.document.close();

}

mov_flg=0;
//
function mov(x,y){
if(mov_flg==0){
mx=x*4;my=y*4;
mov_sub();
mov_flg=1;
}
}
//
function mov_sub(){
xx=xx+mx;yy=yy+my;

xxyy();
mv_tim=setTimeout("mov_sub()",30);
}
//
function stp(){
if(mov_flg==1){
clearTimeout(mv_tim);
mov_flg=0;
tizu.document.getElementById("point").style.top = yy+142;
tizu.document.getElementById("point").style.left =xx+185;
document.f_xy.ee_xx.value=xx;
document.f_xy.ee_yy.value=yy;
}
}
//
function xy_set(){
ssx=document.f_xy.e_x.value*1-310;
ssy=document.f_xy.e_y.value*1-270;
if(nav=="N"){
ssx=ssx-(document.f_xy.e_xx.value*1);
ssy=ssy-(document.f_xy.e_yy.value*1);
}
abs_x=Math.abs(ssx);abs_y=Math.abs(ssy);
if(abs_x>abs_y){ss=abs_x;}else{ss=abs_y;}
hh=Math.floor(ss/10);
dxx=xx;dyy=yy;
tizu.document.getElementById("point").style.top = yy+ssy+240;
tizu.document.getElementById("point").style.left =xx+ssx+280;
document.f_xy.ee_xx.value=xx+ssx;
document.f_xy.ee_yy.value=yy+ssy;
x1=ssx/hh;y1=ssy/hh;h=0;
xy_set_sub();

}
function xy_set_sub(){
h++;
if(h>hh){
clearTimeout(set_tim);
xx=dxx+ssx;
yy=dyy+ssy;
xxyy();
return
}
xx=dxx+x1*h;
yy=dyy+y1*h;

if(xx<0){xx=0;}
if(yy<0){yy=00;}
//if(xx>3320){xx=3320;}
//if(yy>2520){yy=2520;}
if(xx>(tizu_xn*ww-440)){xx=tizu_xn*ww-440;}
if(yy>(tizu_yn*1600-340)){yy=tizu_yn*1600-340;}
document.f_xy.e_xx.value=xx;
document.f_xy.e_yy.value=yy;
tizu.scrollTo(xx,yy);
set_tim=setTimeout("xy_set_sub()",30);
}
//
function xy_point(p){
pp=dt[p].split(",");
ssx=pp[1]*1-xx+85;
ssy=pp[2]*1-yy+105;
abs_x=Math.abs(ssx);abs_y=Math.abs(ssy);
if(abs_x>abs_y){ss=abs_x;}else{ss=abs_y;}
hh=Math.floor(ss/10);
dxx=xx;dyy=yy;
tizu.document.getElementById("point").style.top = yy+ssy+135;
tizu.document.getElementById("point").style.left =xx+ssx+190;
document.f_xy.ee_xx.value=xx+ssx;
document.f_xy.ee_yy.value=yy+ssy;
x1=ssx/hh;y1=ssy/hh;h=0;
xy_set_sub();

}

//
function xxyy(){
if(xx<0){xx=0;}
if(yy<0){yy=00;}
//if(xx>3320){xx=3320;}
//if(yy>2520){yy=2520;}
if(xx>(tizu_xn*ww-440)){xx=tizu_xn*ww-440;}
if(yy>(tizu_yn*1589-340)){yy=tizu_yn*1589-340;}

document.f_xy.e_xx.value=xx;
document.f_xy.e_yy.value=yy;
tizu.scrollTo(xx,yy);


}
//
window.document.onmouseup=stp;

//

document.write('<table><tr><th valign=top>');
document.write('<form name="f_xy">');

document.write('<input type="hidden" name="map_dt" value="',map,'">');
document.write('<input type="hidden" name="map_url" value="',url,'">');

document.write('</th></tr><tr><td>');
document.write('<table bgcolor=#b5ffda>');
document.write('<tr height=20><th width=32 onmouseDown="mov(-1,-1)" onMouseOut="stp()"><IMG src="img/l1.gif" width="10" height="10" border="0"></th><th onmouseDown="mov(0,-1)"><FONT size="-1">By clicking the frame of the map,</FONT>  <IMG src="img/u0.gif" width="12" height="12" border="0">  <FONT size="-1">it pans in the direction.</FONT></th><th width=32 onmouseDown="mov(1,-1)" onMouseOut="stp()"><IMG src="img/r1.gif" width="10" height="10" border="0"></th></tr>');
document.write('<tr><th onmouseDown="mov(-1,0)" onMouseOut="stp()"><IMG src="img/l0.gif" width="12" height="12" border="0"></th><th>');
//document.write('<iframe src="tizu_win.htm" width=440 height=540 name="tizu" scrolling=no></iframe>');
document.write('<iframe width=440 height=340 name="tizu" scrolling=no></iframe>');

document.write('</th><th width=32 onmouseDown="mov(1,0)" onMouseOut="stp()"><IMG src="img/r0.gif" width="12" height="12" border="0"></th></tr>');
document.write('<tr height=20><th onmouseDown="mov(-1,1)" onMouseOut="stp()"><IMG src="img/l2.gif" width="10" height="10" border="0"></th><th onmouseDown="mov(0,1)" onMouseOut="stp()"><IMG src="img/d0.gif" width="12" height="12" border="0"></th><th onmouseDown="mov(1,1)" onMouseOut="stp()"><IMG src="img/r2.gif" width="10" height="10" border="0"></th></tr>');
document.write('</table>');
document.write('</td></tr><tr><td align=center style="font-size : 16px;">');
document.write("<B>Principal Facilities</B><select name='namaes' onChange='xy_point(this.options[this.selectedIndex].value)'>");
for(i=1;i<=n;i++){
dd=dt[i].split(",");
md0=dd[0]+";;;;;";
mdd=md0.split(";");
document.write("<option  value='",i,"'>",mdd[0]);
}
document.write("<option  value='0' selected>select");
document.write("</select>\n");

document.write('<input type=hidden name="e_xx" value="" size=5><input type=hidden name="ee_xx" value="" size=5><input type=hidden name="e_yy" value="" size=5><input type=hidden name="ee_yy" value="" size=5><BR><BR><IMG src="img/map.gif" width="198" height="17" border="0">');
document.write('</td></tr><tr><td align=right>');
document.write('</td></tr></table>');
document.write('<input type=hidden name="e_x" value=""><input type=hidden name="e_y" value="">');
document.write('</form>');


//
dd=map.split(";");
//
function set(){
xy_set();
}

//
function url_link(p){
dm=dt[p]+",,,";
dd=dm.split(",");
if(dd[3]){
link_win=window.open(dd[3]);
}
}

//
function mxy(theEvent){
if(nav=="N"){
sx=theEvent.pageX;
sy=theEvent.pageY;
}else{
sx=tizu.event.x;
sy=tizu.event.y;
}
document.f_xy.e_x.value=sx;
document.f_xy.e_y.value=sy;
}
//
tizu_write();
//
nav=navigator.appName.substring(0,1);
if (nav=="N") {
//tizu.document.captureEvents( Event.MOUSEDOWN | Event.MOUSEMOVE);
tizu.document.captureEvents( Event.CLICK | Event.MOUSEMOVE);
}
tizu.document.onmousemove=mxy;
//tizu.document.onmousedown=set;
tizu.document.onclick=set;

