var winload=false  //用于判断是否完成了window.load
var xdtfun={
xdttime:function(){  //探测time,左键按住move
var wid1=xdt.offsetWidth,hei1=xdt.offsetHeight
minrpg.style.left=mex/(fmwid/wid1);minrpg.style.top=mey/(fmhei/hei1);
minrpg.style.visibility=="hidden"?minrpg.style.visibility="visible":minrpg.style.visibility="hidden";
ckin?yd.ck(me):yd.clips();
shuzhix.innerText=round(mex/10)+1;shuzhiy.innerText=round(mey/10)+1
if(document.getElementById("migongrpg")!=null)migongrpg.style.backgroundPosition=me.style.backgroundPosition
var theshutiao=zdbushu/((rpg.zdbushu+zdbushu2)/100)/2
shutiao1.style.top=(50-theshutiao)+"%";shutiao1.style.height=(theshutiao*2)+"%";
},
xdtmove:function(){  //ck
xdt.offsetLeft==0?xdt.style.left=bodywid-xdt.offsetWidth-2:xdt.style.left=0;
fm1.onmousedown()
},
moveobj:function(smallobj,obj){  //描绘地图中运动物体
var wid1=xdt.offsetWidth,hei1=xdt.offsetHeight
smallobj.dong=setInterval(function(){
smallobj.style.left=obj.offsetLeft/(fmwid/wid1);smallobj.style.top=obj.offsetTop/(fmhei/hei1);
},500)
}
}

var times={timemiao:0,
time1000:function(){
xml.playhjy();if(shutiao1.miao>0){shutiao1.miao-=1;}else{zdbushu2=0;}
if(++times.timemiao>30){rpg.gametime+=35;
times.timemiao=0;wjjs.shuaxin();
shichaimg.src="img/ico/shiduan"+Math.ceil((new Date().getHours()+1)/6)+".gif";
if(gh.name!=""){gh.time+=35;if(rpg.ghmeleft!=mex){gh.renshu+=Math.floor(gh.zichan/100000);gh1[2].innerText=gh.renshu;rpg.ghmeleft=mex}}
saveuser();
}
var tmpcol1=shuzhidtname.style.color=="orange"?"white":"orange";
shuzhidtname.style.color=tmpcol1;xdt_mw1.style.color=tmpcol1;xdt_kw1.style.color=tmpcol1
zy_kaiguan.style.color=tmpcol1
lt.fayanjiange++;if(huanyuantime>0)huanyuantime--;
if(zd.zdzhong!=true&&(anquanqu==true||dtname=="爱之城"||dtname=="人类帝都"||dtname=="亚特兰蒂斯")){
for(var i=0;i<wj.length;i++){if(wj[i].name!=""){wj[i].hp1+=Math.ceil(wj[i].hp2/100);wj[i].mp1+=Math.ceil(wj[i].mp2/100);}}
gx_rpg();}
if(yd.zt=="陷阱"&&zd.zdzhong==false){
if(xunlu.xjsunshi.indexOf("0")!=-1)selwj.hp1-=xunlu.xjshanghai;if(xunlu.xjsunshi.indexOf("1")!=-1)selwj.mp1-=xunlu.xjshanghai;
if(xunlu.xjsunshi.indexOf("2")!=-1)selwj.nu1-=xunlu.xjshanghai;if(xunlu.xjsunshi.indexOf("3")!=-1)selwj.exp1-=xunlu.xjshanghai;
if(xunlu.xjsunshi.indexOf("4")!=-1)rpg.glod-=xunlu.xjshanghai;
gx_rpg();}
if(zd.zdzhong){if(--jh_kuang.jishi>0)return;
if(random()>0.5){if(zdgw.length>1){lt.zd(zdgw[Math.floor(zdgw.length*random())],"闲置")}else{lt.zd(document.getElementById('zdgw'),"闲置");}
}else{lt.zd(zdme[Math.ceil((zdme.length-1)*random())],"闲置");}
}else{if(--jh_kuang.jishi>0||sd_duihua||cj_kuang.style.display!="none"||wp_kuang.style.display!="none"||zt_kuang.style.display!="none"||fm_shezhi.style.display!="none"||gh_kuang.style.display!="none")return;
lt.yewai();
}
}}