var sjdt={
ischuansong:false,
load:function(){  //初始化世界地图
var temp1=[],sjdt1=sjdtdom.getElementsByTagName("document")[0].childNodes
for(var i=0;i<sjdt1.length;i++){
temp1[i]='<img id="sjdt_df" src="img/ico/sjdt_1.gif" style="left:'+sjdt1[i].getAttribute("left")+'%;top:'+sjdt1[i].getAttribute("top")+'%;z-index:5;" value="'+sjdt1[i].getAttribute("name")+'" is="'+sjdt1[i].getAttribute("is")+'" x="'+sjdt1[i].getAttribute("x")+'" y="'+sjdt1[i].getAttribute("y")+'" ciyuan="'+sjdt1[i].getAttribute("ciyuan")+'">'
}
sjdt_kuang.innerHTML='<div style="width:100%;height:16;text-align:center;left:0;top:-15;background-image:url(\'img/background/lu5.gif\');padding-top:2;font-weight:bold;" id="sjdt_title"></div><img src="img/background/sjdt.jpg" style="width:100%;height:100%" id="sjdt_bgimg">'+temp1.join("")+'<img id="sjdt_in" src="img/ico/sjdt_in.gif" style="z-index:5" onmousemove=\'showtmk("你目前在 ["+shuzhidtname.innerText+"]")\'><div id="sjdtvmldiv"></div>'
},
addrpg:function(){  //增加新地图
for(var i=0;i<rpg.sjdt.length;i++){if(rpg.sjdt[i]==dtwenjian+"+-=-+"+dtname)return false;}
rpg.sjdt[rpg.sjdt.length]=dtwenjian+"+-=-+"+dtname;gdtext(event.x,event.y,"发现新传送点 "+dtname);lt.help("发现新传送点 "+dtname);
if(dtname=="爱之城")showshige("神说:第二章 神往");
if(dtname=="银河系")showshige("神说:第五章 成熟");
},
chuansong:function(obj){  //传送到目标
if(obj.id!="sjdt_df")return;
var txt1=obj.src.replace(/.*?\/(\w+\.\w+)/g,"$1");
var didian=obj.value;
if(txt1=="sjdt_1.gif"||txt1=="sjdt_3.gif")return gdtext(event.x,event.y,"暂时不可能传送到这里!")
if(dtwenjian+"+-=-+"+dtname==didian)return gdtext(event.x,event.y,"你已经在这里了!")
if(rpg.glod<wj[0].lv*5){sjdt.close();return lt.help("你的钱,已不够传送费(费用=你的级别×5元)")}
if(obj.ciyuan.indexOf(rpg.ciyuan)!=-1){lt.help("哈……你小子是不又想耍小聪明？~-~");return gdtext(event.x,event.y,"目标地跟当前世界不再一个次元");}
for(var i=0;i<rpg.sjdt.length;i++){
if(rpg.sjdt[i].indexOf(didian)==-1)continue;
var tempdom=new ActiveXObject("Microsoft.XMLDOM");tempdom.async=false;
tempdom.load("server/ditu/"+didian.split("+-=-+")[0]+".xml");
if(tempdom.parseError.errorCode!=0){didian="yiceng+-=-+未知圣地";obj.x=150;obj.y=9800;
tempdom.load("server/ditu/yiceng.xml");
}
var tempdom=tempdom.getElementsByTagName("document")[0].childNodes
for(var r=0;r<tempdom.length;r++){
if(tempdom[r].getAttribute("name")!=didian.split("+-=-+")[1])continue;
rpg.glod-=(wj[0].lv*4);gx_rpg();sjdt.close();
xml.loaddt(didian.split("+-=-+")[0],didian.split("+-=-+")[1],parseInt(obj.x),parseInt(obj.y));saveuser();return yinxiao("起飞");
}
 //return gdtext(event.x,event.y,"该地图场景,本游戏测试版本暂未完成")
}
},
rpgin:function(){  //主角定位
sjdt_in.style.visibility="hidden"
var tempvml=[],tempyoubiao=-1
for(var i=0;i<sjdt_df.length;i++){
var mein=dtwenjian+"+-=-+"+dtname;
if(mein.indexOf(sjdt_df[i].value)==-1)continue;
sjdt_in.style.left=sjdt_df[i].offsetLeft;sjdt_in.style.top=sjdt_df[i].offsetTop-15;sjdt_in.style.visibility="visible"
if(sjdt.ischuansong!=true)break;
for(var j=0;j<sjdt_df.length;j++){  //显示能传送的地方
if(!sjdt_df[j].tansuo)continue;
if(mein=="chengshi+-=-+爱之城"||mein=="chengshi+-=-+亚特兰蒂斯"||sjdt_df[j].is==sjdt_df[i].is){
sjdt_df[j].src="img/ico/sjdt_2.gif";if(mein.indexOf(sjdt_df[j].value)!=-1)continue;
tempvml[++tempyoubiao]="<v:line strokeweight='1' strokecolor='blue' from='"+(sjdt_in.offsetLeft+5)+","+(sjdt_in.offsetTop+15)+"' to='"+(sjdt_df[j].offsetLeft+6)+","+(sjdt_df[j].offsetTop+12)+"' style='z-index:4;'><v:Stroke dashstyle='shortdot' endarrow='block' arrowwidth='narrow' c='"+sjdt_df[j].value+"'/></v:line>"
}
}
}
if(sjdt.ischuansong==true)sjdtvmldiv.innerHTML=tempvml.join("")
},
close:function(){  //关闭
sjdt_kuang.style.visibility="hidden";sjdt.ischuansong=false;sjdtvmldiv.innerHTML="";sjdt_in.style.visibility="hidden"
},
open:function(ischuansong){  //打开地图
sjdt.ischuansong=ischuansong
if(sjdt_kuang.yici==null){sjdt_kuang.yici=2;sjdt.load();sjdt.showname();}
sjdt_title.innerHTML='世界地点探索量:'+rpg.sjdt.length+'-'+sjdt_df.length+" 传送一次需要的开销:<span style='color:red'>"+(wj[0].lv*5)+"</span>"
var tempsrc="";
for(var j=0;j<sjdt_df.length;j++){
sjdt_df[j].value.indexOf("+-=-+")==-1?tempsrc="sjdt_4.gif":tempsrc="sjdt_1.gif";
sjdt_df[j].src="img/ico/"+tempsrc;sjdt_df[j].tansuo=false
}  //防止读档错乱
for(var i=0;i<rpg.sjdt.length;i++){if(rpg.sjdt[i]==null)continue;
for(var j=0;j<sjdt_df.length;j++){
if(rpg.sjdt[i].indexOf(sjdt_df[j].value)!=-1){sjdt_df[j].src="img/ico/sjdt_3.gif";sjdt_df[j].tansuo=true}
}
}
sjdt.rpgin();sjdt_kuang.style.visibility="visible";
},
mousemove:function(obj){  //提示说明
var txt1=obj.src.toString();obj.style.cursor="hand"
var xing="无";var nandu1=xml.getsjdt(obj.value).getAttribute("nandu")
if(nandu1!=0){xing="";for(var i=0;i<nandu1/15;i++){xing+="★"}}
var tempboss=xml.getsjdt(obj.value).getAttribute("boss")==null?"":"老怪:"+xml.getsjdt(obj.value).getAttribute("boss")+"<br>"
var tempciyuan=xml.getsjdt(obj.value).getAttribute("ciyuan")==null?"":" <font style='color:purple'>此地图在"+xml.getsjdt(obj.value).getAttribute("ciyuan")+"次元无法进入</font>";
var help1="<p>难度:Lv:"+nandu1+" "+xing+"<br>"+tempboss+"简介:"+xml.getsjdt(obj.value).getAttribute("help").replace(/\n/g,"<br>")
var value1=obj.value.replace(/.*?\+\-\=\-\+/g,"")
if(txt1.indexOf("sjdt_1.gif")!=-1){showtmk("地图:"+obj.is+"型"+tempciyuan+"<br>红灯:无法传送,此地未探明传送点"+help1,value1,"white","red")}
if(txt1.indexOf("sjdt_2.gif")!=-1){showtmk("地图:"+obj.is+"型"+tempciyuan+"<br>绿灯:当即即可传送前往"+help1,value1,"white","lime")}
if(txt1.indexOf("sjdt_3.gif")!=-1){showtmk("地图:"+obj.is+"型"+tempciyuan+"<br>黄灯:允许传送,如果你使用传送功能的话"+help1,value1,"white","yellow")}
if(txt1.indexOf("sjdt_4.gif")!=-1){showtmk("地图:"+obj.is+"型"+tempciyuan+"<br>灰灯:本版暂未开发完成的未来场景"+help1,value1,"white","gray")}
},
showname:function(){  //开关名称
if(sjdt_kuang.yici==2){
var temp1=[];for(var i=0;i<sjdt_df.length;i++){
temp1[i]="<font style='position:absolute;left:"+(sjdt_df[i].offsetLeft-5)+";top:"+(sjdt_df[i].offsetTop+10)+";color:#777777;'>"+sjdt_df[i].value.replace(/.*?\+\-\=\-\+/g,"")+"</font>"}
sjdt_kuang.innerHTML+=temp1.join("");sjdt_kuang.yici=1
}else if(sjdt_kuang.yici==1){
var len1=sjdt_kuang.getElementsByTagName("FONT").length
for(var i=0;i<len1;i++){
sjdt_kuang.removeChild(sjdt_kuang.getElementsByTagName("FONT")[0])}sjdt_kuang.yici=2
}
}

}