var sd={
sdname:"",  //商店类型名
youbiao:0,  //选项游标
sp:"",   //商品
selspimg:null,  //选定的对象
seljnnum:0,  //选定的某级的技能
open:function(sdname){  //开启窗口
sd.sdname=sdname;sd.xuanxiang();sd_kuang.style.display="";sd_cishu.value=1;atmzhanghu.innerText=wj[0].name;atmyue.innerText=rpg.cunkuan;
atmshangxian.innerText=rpg.ckshangxian+(wj[0].lv*500);atmshangxian.innerText="/"+atmshangxian.innerText
sd_sd=true;for(var i=1;i<8;i++)document.getElementById('sd_fujia'+i).style.display="none"
if(sdname=="超市"){sd_fujianame.innerText="万能典当(甩卖欲售物品请拖入下方人群)";sd_fujia1.style.display="";wpzb.wupin();wp_kuang.style.display='';}
else if(sdname=="仓库"){sd_fujianame.innerText="万能典当(甩卖欲售物品请拖入下方人群)";sd_fujia1.style.display="";wpzb.wupin();wp_kuang.style.display='';}
else if(sdname=="锻制"||sdname=="强化"){sd_fujianame.innerText="需要材料如下(现有数/所需数)";sd_fujia2.style.display="";wpzb.wupin();wp_kuang.style.display='';
sdname=="锻制"?dh.lihui("duanzhi.gif"):dh.lihui("qianghua.gif");
}else if(sdname=="技能"){sd_fujianame.innerText="技能请在下方修炼";sd_fujia3.style.display="";dh.lihui("jineng.gif");tbzt.zhuangtai();zt_kuang.style.display=""
}else if(sdname=="黄金"){
sd_fujianame.innerText="黄金兑换处";sd_fujia4.style.display="";wpzb.wupin();wp_kuang.style.display='';
}else if(sdname=="精炼"){
sd_fujianame.innerHTML="装备精炼(祝你好运)";sd_fujia5.style.display="";wpzb.wupin();wp_kuang.style.display='';dh.lihui("fyw.gif");
}else if(sdname=="分解"){
sd_fujianame.innerText="装备分解操纵处";sd_fujia6.style.display="";wpzb.wupin();wp_kuang.style.display='';dh.lihui("duanzhi.gif");
}else if(sdname.indexOf("任务")==0){
sd_fujianame.innerText="任务详细描述与控制";sd_fujia7.style.display="";wpzb.wupin();wp_kuang.style.display='';rwbutton.disabled=false;
}
},
addxuanxiang:function(xxvalue){  //装载选项
xxvalue=xxvalue.split(",");var tem=[]
for(var i=0;i<xxvalue.length;i++)tem[i]="<td id='sdtable1_td'>"+xxvalue[i]+"</td>"
sdtable1.outerHTML='<table id="sdtable1" cellspacing="0" cellpadding="0" border="1" bordercolor="black" style="width:100%;height:6%;table-Layout:fixed;border:0;" onmousedown="sd.xuanxiang(event.srcElement)"><tr style="text-align:center">'+tem.join("")+'</tr></table>'
},
chongzhi:function(){  //重置,初始化
for(var i=0;i<maitd.length;i++){if(parseInt(maitd[i].style.backgroundColor)!=null)maitd[i].style.backgroundColor="Transparent";}
fuwufei.innerText="0"
for(var i=0;i<cl_grayimg.length;i++){cl_grayimg[i].src="img/ico/gray.gif";cl_grayimg[i].onmousemove="";cl_sl[i].innerText="0";cl_slmax[i].innerText="0"}
for(var i=0;i<jn_grayimg.length;i++){jn_grayimg[i].src="img/ico/gray.gif";jn_grayimg[i].onmousemove="";jn_grayimg[i].onmousedown="";jn_lv[i].innerText="Lv?";jn_lv[i].style.color="gray";jn_grayimg[i].style.border="0";}
sd_xiulian.disabled=true;jn_allxq.style.display="none";jlyulan.src="img/ico/gray.gif";jlyulan.onmousemove="";
fjyulan1.src="img/ico/gray.gif";fjyulan1.onmousemove="";fjshuliang1.innerText=0
fjyulan2.src="img/ico/gray.gif";fjyulan2.onmousemove="";fjshuliang2.innerText=0;fjfeiyong.innerText=0;
sd_rw1[0].innerText="";sd_rw1[1].innerText="";sd_rw1[2].innerText="";
},
xuanxiang:function(obj){  //切换选项
if(obj==null){sd.youbiao=0;sdtable1.style.display="";
switch(sd.sdname){
case "超市":sd.addxuanxiang("药物,资材,武器,装备,装饰,扩展");sd_name.innerText="购物中心本店不卖花!(拓荒装备有售)";break;
case "黄金":sd.addxuanxiang("奇珍,武装,材料,座驾,飞行,潜泳");sd_name.innerText="黑市(黄金交易珍惜之物大卖场)";break;
case "锻制":sd.addxuanxiang("武器,装备,装饰,军装,荣誉");sd_name.innerText="装备锻制大全";break;
case "强化":sd.addxuanxiang("材料,奥义,料理,纹章,对决门,诗歌");sd_name.innerText="合成转换强化大全";break;
case "技能":sd.addxuanxiang("武学系,魔攻系,祝福系,军师系,神说系,魔物系");sd_name.innerText="技能修炼大全";break;
case "仓库":sd_name.innerText="把身上多余的东西放在我里面(杂物免费寄取)";sdtable1.style.display="none";break;
case "精炼":sd.addxuanxiang("当前身上装备");sd_name.innerText="现有装备精炼(装备栏已锁死,精炼中无法更换)";break;
case "分解":sd.addxuanxiang("当前包裹中的装备");sd_name.innerText="装备分解(物品栏已锁死,分解中无法操作)";break;
case "任务-暗黑兄弟会":sd.addxuanxiang("长期任务,怪物猎人,BOSS挑战,寻物类,琐事类");sd_name.innerText="暗黑兄弟会任务委托处(魔女:艾丽西亚)";break;
case "任务-新选组":sd.addxuanxiang("长期任务,BOSS挑战,寻物类,琐事类");sd_name.innerText="新选组任务委托处(司令官:爆菊哈尼)";break;
case "任务-圣堂天团":sd.addxuanxiang("长期任务,怪物猎人,BOSS挑战,寻物类,琐事类");sd_name.innerText="圣堂天团任务委托处(梦神:菲拉)";break;
case "任务-帝国军团":sd.addxuanxiang("长期任务,怪物猎人,BOSS挑战,寻物类,琐事类");sd_name.innerText="帝国军团任务委托处(军神:上杉谦信)";break;
case "任务-地狱魔军":sd.addxuanxiang("长期任务,怪物猎人,BOSS挑战,寻物类,琐事类");sd_name.innerText="地狱魔军任务委托处(夜之母:西提斯)";break;
case "任务-暗黑领袖":sd.addxuanxiang("长期任务,寻宝类,激战类,成就类,奇异类");sd_name.innerText="暗黑领袖任务委托处(风云舞)";break;
case "任务-血色兄弟会":sd.addxuanxiang("复仇类,杀手类,琐事类");sd_name.innerText="血色兄弟会任务委托处(血色使:血影)";break;
case "任务-圣少女战队":sd.addxuanxiang("长期任务,情感类");sd_name.innerText="圣少女战队任务委托处(队长:露露)";break;
case "任务-莉莉丝":sd.addxuanxiang("情感类");sd_name.innerText="莉莉丝的委托(迷之女:莉莉丝)";break;
case "任务-俺样公会":sd.addxuanxiang("长期任务,清理杂鱼,重大战役,神器篇,终身成就");sd_name.innerText=gh.name+"重大事务(参谋长:梅尔菲)";break;
}
}else{for(var i=0;i<sdtable1_td.length;i++){if(sdtable1_td[i]==obj)sd.youbiao=i;}}
if(sl.suoding||sd_loading)return;sd.selspimg=null;
sd.chongzhi()
if(sd.sdname=="仓库"){
for(var i=0;i<maitd.length;i++){if(rpg.ck[i]==null){maitd[i].innerHTML="&nbsp;";continue;}
var rpgwp=rpg.ck[i].split("="),getwp1=xml.getwp(rpgwp[0],rpgwp[1])
var tempwp2=rpgwp[2]==1?"":rpgwp[2];
maitd[i].innerHTML="<img src='img/"+rpgwp[0]+"/"+getwp1.getAttribute("src")+"' style='position:static;width:27;height:27;' onmouseup='if(event.button==2)wpzb.wupin_use(this,rpg.ck)' xml_node='"+rpgwp[0]+"' xml_name='"+rpgwp[1]+"' shuliang='"+rpgwp[2]+"' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^="+rpgwp[0]+"="+rpgwp[1]+"')\" weizhi="+i+"><font style='position:absolute;color:purple;font-size:13px;margin-left:-32;margin-top:17'>"+tempwp2+"</font>"
}
return;
}  //end 仓库
if(sdtable1_td.length>1){
for(var i=0;i<sdtable1_td.length;i++){sdtable1_td[i].style.borderBottomWidth=1;sdtable1_td[i].style.color="black";sdtable1_td[i].style.fontWeight="normal";sdtable1_td[i].style.width=null}
sdtable1_td[sd.youbiao].style.borderBottomWidth=0;sdtable1_td[sd.youbiao].style.color="red";
sdtable1_td[sd.youbiao].style.fontWeight="bold";sdtable1_td[sd.youbiao].style.width=round(parseInt(sd_kuang.style.width)/sdtable1_td.length*1.5)
var temname=sd.sdname+"."+sdtable1_td[sd.youbiao].innerText;
}else{temname=sd.sdname+"."+sdtable1_td.innerText;}
sd.sp="";
if(temname.indexOf("技能.")==0){  //技能表
var tempjn=[],tempjnyoubiao=-1,thexi=temname.substr(3)
var jndom2=jndom.getElementsByTagName("jn");for(var i=0;i<jndom2.length;i++){
if(jndom2[i].getAttribute("lei")==thexi)tempjn[++tempjnyoubiao]=jndom2[i].getAttribute("n")
}sd.sp=tempjn.join(",");}
if(temname.indexOf("任务")==0){  //任务表
var tempjn=[],tempjnyoubiao=-1,thelei=temname.substr(temname.indexOf(".")+1);
var thehui=temname.substr(0,temname.indexOf(".")).replace("任务-","")
var rwdom2=rwdom.getElementsByTagName("rw");for(var i=0;i<rwdom2.length;i++){
if(rwdom2[i].getAttribute("hui")==thehui&&rwdom2[i].getAttribute("lei")==thelei)tempjn[++tempjnyoubiao]=rwdom2[i].getAttribute("n")
}sd.sp=tempjn.join(",");}
switch(temname){  //其他表
case "精炼.当前身上装备":var templie=[],tempyb=-1;for(var i=0;i<rpg.zb.length;i++){if(rpg.zb[i]==null)continue;
var templei=xml.getwp("zb",rpg.zb[i]).getAttribute("lei");
if(templei=="座驾"||templei=="潜水衣"||templei=="飞行器"||templei=="纹章")continue;templie[++tempyb]="zb="+rpg.zb[i];
}sd.sp=templie.join(",");
break;
case "分解.当前包裹中的装备":var templie=[],tempyb=-1;for(var i=0;i<rpg.wp.length;i++){if(rpg.wp[i]==null||rpg.wp[i].split("=")[0]=="wp")continue;
var templei=xml.getwp("zb",rpg.wp[i].split("=")[1]).getAttribute("lei");if(templei=="纹章")continue;
templie[++tempyb]="zb="+rpg.wp[i].split("=")[1];
}sd.sp=templie.join(",");
break;
case "超市.药物":sd.sp="wp=A型红药,wp=B型红药,wp=C型红药,wp=D型红药,wp=E型红药,wp=F型红药,,,wp=A型蓝药,wp=B型蓝药,wp=C型蓝药,wp=D型蓝药,wp=E型蓝药,wp=F型蓝药,,,wp=A型绿药,wp=B型绿药,wp=C型绿药,wp=D型绿药,wp=A型黄药,wp=精灵草,wp=A型还魂草,,,,,,,,,,wp=B型黄药,wp=小天使の祝福,wp=强效精灵草,wp=B型还魂草,wp=人参果,wp=C型还魂草";break;
case "超市.资材":sd.sp="wp=哈哈卡,wp=回程券,wp=俘获绳,,,,,,,,,,,,,,wp=丝线,wp=布料,wp=纽扣,wp=拉链,wp=胶水,wp=润滑油,wp=花粉,wp=电池";break;
case "超市.武器":sd.sp="zb=破魂刀,zb=银蛇剑,zb=残影剑,zb=太极剑,zb=封魔剑,,,,,,,,,,,,zb=藤木弓,zb=左轮手枪";break;
case "超市.装备":sd.sp="zb=骑士盔,zb=绢质衣,zb=黑色初恋,zb=鱼尾裤,zb=长筒靴,,,,zb=勇士之盔,zb=水手服,zb=黑色魑魅,zb=圣羽裤,zb=鹿皮靴";break;
case "超市.装饰":sd.sp="zb=皇披风,zb=琥珀链,zb=光环带,zb=金戒指,,,,,zb=风翅,zb=七星链,zb=法师腰扣,zb=花型戒指";break;
case "超市.扩展":sd.sp="zb=黑丝袜,wp=烟花弹";break;

case "黄金.奇珍":sd.sp="wp=名望证明,wp=元灵神丹,wp=神魔源泉,wp=用餐招待卡,wp=浪漫莴草,wp=烦躁莴草,wp=激情莴草,wp=普通精炼石,wp=高级精炼石,wp=超级精炼石,wp=究极精炼石,wp=至爱之心,,,,,,,,,,,,,wp=对决门:圣少女·十月";break;
case "黄金.武装":sd.sp="zb=一夕,zb=斗神盔,zb=十字军盾,zb=奇门遁甲,zb=草中飞,zb=达芬奇披风,zb=机战护手,zb=黑天使之翼,zb=赤龙裙甲,zb=黄金之环,zb=魔罗项链,zb=火龙戒,zb=海蓝情趣";break;
case "黄金.材料":sd.sp="wp=灵魂碎块,wp=残缺幻剑,wp=寒冰魄,wp=精钢,wp=恶魔指骨,wp=龙胆,wp=龙爪,wp=虎齿,wp=绿色陨铁,wp=三昧火种,wp=巨蟒之鳞,wp=铁架,wp=绿色魔血,wp=骨灰,wp=鹿茸,wp=火魔魂";break;
case "黄金.座驾":sd.sp="zb=宝马,zb=劳斯莱斯,zb=法拉利赛车,,,,,,zb=巨大兔兔,zb=狒狒,zb=狐狸,zb=美洲白虎,zb=南美狮,zb=缅甸大象";break;
case "黄金.飞行":sd.sp="zb=私人小型飞机,zb=007飞车,zb=空军战斗机,zb=航天飞行器,,,,,zb=如玉蝴蝶,zb=小恶魔翅膀,zb=魔女扫把,zb=飞仙剑,,,,,zb=神雕,zb=火凤凰,zb=黑色飞龙";break;
case "黄金.潜泳":sd.sp="zb=人鱼服,zb=水神靴,zb=御水衣,zb=蜻蜓泳装";break;

case "锻制.武器":sd.sp="zb=埃尔萨之枪,zb=蓝灵杖,zb=郁金香1号,zb=噬魂魔杖,zb=龙骑士之枪,zb=莉兹娜手杖,zb=乌鲁泽手炮,zb=死亡巨响,zb=追魂剑,zb=月亮之镰,,,,,,,,,,,,,,,zb=精灵弓,zb=AK47冲锋枪,zb=黄金弓,zb=M16重机枪,zb=暴风之弓,zb=KP100自动步枪,zb=丘比特之箭,zb=激光枪,zb=美梦之箭";break;

case "锻制.装备":sd.sp="zb=牛魔王之盔,zb=半身铠,zb=天魔法袍,zb=祭司长裤,zb=武斗靴,,,,zb=精武,zb=蔚蓝铠甲,zb=精灵服饰,zb=轻盈白裤,zb=踏云履,,zb=符咒护腕";break;
case "锻制.装饰":sd.sp="zb=精灵披风,zb=红宝石项链,zb=金质腰扣,zb=翡翠戒指,,,,,zb=巨蜥披风,zb=圣骑士项链,zb=幸运腰带,zb=蔚蓝戒指";break;
case "锻制.军装":sd.sp="zb=兰古瑞萨,zb=格兰蒂亚,zb=暗黑斗篷,zb=暗黑皮裤,zb=暗黑玫瑰,zb=帝国军铠甲,zb=帝国金靴,zb=帝国腰带,zb=圣堂天团盾,zb=天堂之拳,zb=圣堂项链,zb=地狱魔军盔,zb=地狱之翼,zb=嗜血戒指";break;
case "锻制.荣誉":sd.sp="zb=梦幻星魂剑,zb=九霄琉璃,zb=光辉无尽,zb=天马行空,zb=无限苍穹,zb=轮回时空,zb=龙游天下,zb=虚空凝视,zb=天工纹章";break;

case "强化.材料":sd.sp="wp=兴奋剂,wp=莱卡,wp=盐酸,wp=琥珀,wp=性激素,wp=浓缩钚,wp=星光石,wp=普通精炼石,wp=高级精炼石,wp=超级精炼石,wp=究极精炼石,wp=对决之石,wp=穿越门:帝都上空";break;
case "强化.奥义":var tmtext1=[],allwp=wpdom.getElementsByTagName("wp"),youbiao=-1;for(var i=0;i<allwp.length;i++){
if(allwp[i].getAttribute("n").indexOf("奥义:")!=0)continue;tmtext1[++youbiao]="wp="+allwp[i].getAttribute("n");}sd.sp=tmtext1.join(",");
break;

case "强化.料理":sd.sp="wp=德国汉堡,wp=魔法寿司,wp=四川麻辣烫,wp=菠菜绿豆羹,wp=冰激凌圣代,wp=巨无霸鸡腿,wp=姐妹蛋夹卷,wp=天然矿物质绿茶,wp=八氯氰胺奶,wp=么你黑咖啡,wp=水果奶酪披萨,wp=珍珠翡翠白玉汤,,,,,,,,,,,,,wp=浪漫莴草,wp=激情莴草,wp=烦躁莴草";break;
case "强化.纹章":sd.sp="zb=火焰纹章1级,zb=火焰纹章2级,zb=火焰纹章3级,zb=火焰纹章4级,zb=火焰纹章5级,zb=火焰纹章6级,zb=火焰纹章7级,zb=火焰纹章究极,zb=冰雪纹章1级,zb=冰雪纹章2级,zb=冰雪纹章3级,zb=冰雪纹章4级,zb=冰雪纹章5级,zb=冰雪纹章6级,zb=冰雪纹章7级,zb=冰雪纹章究极,zb=梦幻纹章1级,zb=梦幻纹章2级,zb=梦幻纹章3级,zb=梦幻纹章4级,zb=梦幻纹章5级,zb=梦幻纹章6级,zb=梦幻纹章7级,zb=梦幻纹章究极,,,,,,,,,zb=天地勿用神说";break;
case "强化.对决门":var tmtext1=[],allwp=wpdom.getElementsByTagName("wp"),youbiao=-1;for(var i=0;i<allwp.length;i++){
if(allwp[i].getAttribute("n").indexOf("对决门:")!=0)continue;tmtext1[++youbiao]="wp="+allwp[i].getAttribute("n");}sd.sp=tmtext1.join(",");
break;
case "强化.诗歌":var tmtext1=[],allwp=wpdom.getElementsByTagName("wp"),youbiao=-1;for(var i=0;i<allwp.length;i++){
if(allwp[i].getAttribute("n").indexOf("诗歌:")!=0&&allwp[i].getAttribute("n").indexOf("资料:")!=0)continue;tmtext1[++youbiao]="wp="+allwp[i].getAttribute("n");}sd.sp=tmtext1.join(",");
break;
}
var tmsp=sd.sp.split(","),rwshow=1;
for(var i=0;i<maitd.length;i++){
maitd[i].innerHTML="&nbsp;";if(tmsp[i]==null||tmsp[i]=="")continue;
if(sd.sdname=="技能"){
var alljn=xml.getjn(tmsp[i]),oldjn="无";i==0?oldjn="无":oldjn=tmsp[i-1];
var temstr="";if(alljn.getAttribute("xue")!=null)temstr="filter:xray;"
maitd[i].innerHTML="<img src='img/jn/"+alljn.getAttribute("src")+"' style='position:static;width:30;height:26;"+temstr+"' onclick='sd.mai(this)' oldjn='"+oldjn+"' xml_name='"+tmsp[i]+"' onmousemove=\"showtmk('jnobj1 or jnobj2%#&@!-$^="+tmsp[i]+"="+(alljn.childNodes.length-1)+"')\">"
}else if(sd.sdname.indexOf("任务-")==0){var getrw1=xml.getrw(tmsp[i]),thesrc="",wanchengcishu=shouce.findrw(tmsp[i]);
switch(getrw1.getAttribute("lei")){case "长期任务":thesrc="1";break;case "怪物猎人":thesrc="2";break;case "BOSS挑战":thesrc="3";break;
case "寻物类":thesrc="4";break;case "琐事类":thesrc="5";break;case "情感类":thesrc="qinggan";break;default:thesrc="qita";}
if(thesrc!="1"&&wanchengcishu>0)thesrc="clear";
if(wanchengcishu>0){}else{--rwshow}
if(rwshow>-1){  //判断是否显示高级任务
maitd[i].innerHTML="<img src='img/rw/"+thesrc+".gif' style='position:static;width:28;height:28;' onclick='sd.mai(this)' rwname='"+tmsp[i]+"' wanchengcishu='"+wanchengcishu+"' onmousemove=\"showtmk('任务名称:'+this.rwname+' 完成次数:'+this.wanchengcishu+'次')\">"
}else{  //不显示
maitd[i].innerHTML="<img src='img/wp/bumingwu.gif' style='position:static;width:28;height:28;' onmousemove=\"showtmk('任务名称:"+tmsp[i]+" 完成次数:0次<br>"+sd.sdname.replace("任务-","")+"暂时不信任你的实力,不打算把该任务交与你去做<br>看来你要好好的表现,赢得他们的尊重和信任呦!')\">"
}
}else{
var sp1=tmsp[i].split("="),getwp1=xml.getwp(sp1[0],sp1[1])
maitd[i].innerHTML="<img src='img/"+sp1[0]+"/"+getwp1.getAttribute("src")+"' style='position:static;width:26;height:26;' onclick='sd.mai(this)' xml_node='"+sp1[0]+"' xml_name='"+sp1[1]+"' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^="+sp1[0]+"='+this.xml_name)\">"
}
}},
mai:function(obj){  //列表物品单击
if(sl.suoding||sd_loading)return;
sd.chongzhi();sd.selspimg=obj;
obj.parentElement.style.backgroundColor="#FEBDF9"
if(sd.sdname=="超市"||sd.sdname=="黄金"){sl.open("购物",sd.selspimg)}
else if(sd.sdname=="精炼"){
var getwp1=xml.getwp(sd.selspimg.xml_node,sd.selspimg.xml_name),tempjinglian=wpzb.getjinglian(sd.selspimg.xml_name)
jlyulan.src="img/zb/"+xml.getwp("zb",sd.selspimg.xml_name).getAttribute("src");jlyulan.name1=sd.selspimg.xml_name
if(tempjinglian>0){jlyulan.onmousemove=function(){showtmk('wupin or zhuangbei%#&@!-$^=zb='+this.name1.replace(/(\$\$\$)\d+/g,"$1"+(tempjinglian+1)))};
}else{jlyulan.onmousemove=function(){showtmk('wupin or zhuangbei%#&@!-$^=zb='+this.name1+'$$$1')}}
}else if(sd.sdname=="分解"){var getwp1=xml.getwp(sd.selspimg.xml_node,sd.selspimg.xml_name),tempjinglian=wpzb.getjinglian(sd.selspimg.xml_name)
var fenjie1="wp=装备碎片=1".split("=");fenjie1[2]=parseInt(fenjie1[2])
if(getwp1.getAttribute("级别")!=null)fenjie1[2]+=Math.floor(getwp1.getAttribute("级别")/10)
if(getwp1.getAttribute("潜能")!=null)fenjie1[2]+=getwp1.getAttribute("潜能").split(",").length
fenjie1[2]*=(tempjinglian+1);var thechengdu=getwp1.getAttribute("程度");
switch(thechengdu){case "经典级":fenjie1[2]*=2;break;case "帝王级":fenjie1[2]*=3;break;case "传说级":fenjie1[2]*=4;break;case "神魔级":fenjie1[2]*=5;break;}
if(getwp1.getAttribute("hj")!=null)fenjie1[2]+=Math.ceil(getwp1.getAttribute("hj"))
fenjie1[2]=parseInt(fenjie1[2])
fjyulan1.src="img/"+fenjie1[0]+"/"+xml.getwp(fenjie1[0],fenjie1[1]).getAttribute("src");fjyulan1.name1=fenjie1[1]
fjyulan1.onmousemove=function(){showtmk('wupin or zhuangbei%#&@!-$^='+fenjie1[0]+'='+this.name1)}
fjshuliang1.innerText=fenjie1[2]
var fenjie2=getwp1.getAttribute("fenjie")!=null?getwp1.getAttribute("fenjie").split("="):null;
if(fenjie2==null){fjyulan2.src="img/ico/gray.gif";fjyulan2.onmousemove="";fjshuliang2.innerText=0}else{
fjyulan2.src="img/"+fenjie2[0]+"/"+xml.getwp(fenjie2[0],fenjie2[1]).getAttribute("src");fjyulan2.lei1=fenjie2[0];fjyulan2.name1=fenjie2[1];
fjyulan2.onmousemove=function(){showtmk('wupin or zhuangbei%#&@!-$^='+fenjie2[0]+'='+this.name1)}
fjshuliang2.innerText=fenjie2[2]}
fjfeiyong.innerText=fenjie1[2]*10;
}else if(sd.sdname=="锻制"||sd.sdname=="强化"){
var getwp1=xml.getwp(sd.selspimg.xml_node,sd.selspimg.xml_name),allcl=getwp1.getAttribute("mark").split(",");
for(var i=0;i<allcl.length;i++){
var lei1=allcl[i].split("=")[0],name1=allcl[i].split("=")[1],sl1=allcl[i].split("=")[2]
cl_grayimg[i].src="img/"+lei1+"/"+xml.getwp(lei1,name1).getAttribute("src");cl_grayimg[i].name1=name1;cl_grayimg[i].lei1=lei1;
cl_grayimg[i].onmousemove=function(){showtmk('wupin or zhuangbei%#&@!-$^='+this.lei1+'='+this.name1)};
cl_slmax[i].innerText=sl1;cl_sl[i].innerText=wpzb.findwp(lei1,name1);
fuwufei.innerText=sd.sdname=="锻制"?round(wpzb.getjiage(getwp1)/4):20;
}}else if(sd.sdname=="技能"){
var alljn1=xml.getjn(obj.xml_name),i=0;if(alljn1.getAttribute("lei")=="神说系")i=1;
for(i=i;i<alljn1.childNodes.length;i++){
jn_grayimg[i].src="img/jn/"+alljn1.getAttribute("src");jn_grayimg[i].jnnum=i
jn_grayimg[i].onmousedown=function(){sd.seljn(this)}
jn_grayimg[i].onmousemove=function(){showtmk('jnobj1 or jnobj2%#&@!-$^='+obj.xml_name+'='+this.jnnum)};
jn_lv[i].innerText="Lv"+(i+1);jn_lv[i].style.color="red";
}}else if(sd.sdname.indexOf("任务")==0){var getrw1=xml.getrw(sd.selspimg.rwname);
sd_rw1[0].innerHTML=getrw1.getAttribute("help");sd_rw1[1].innerHTML=getrw1.getAttribute("yaoqiu");
sd_rw1[2].innerHTML=getrw1.getAttribute("jiangli").replace(/(wp|zb)\=(.*?)(\+\d+)/g,"<font style='color:blue;' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^=$1=$2')\">$2$3</font>").replace(/\$\$\$(\d+\+\d+)/g,"$1");
}
},
seljn:function(obj2){  //选定所学技能
if(sl.suoding||sd_loading)return;
for(var i=0;i<jn_grayimg.length;i++){jn_grayimg[i].style.border="0"}
obj2.style.border="2 solid #"+getcolor();
var jnname1=sd.selspimg.xml_name,jnlv=obj2.jnnum
var jnobj1=xml.getjn(jnname1),jnobj2=jnobj1.childNodes[jnlv];
var jnlei=xml.getjn(jnname1).getAttribute("lei")
if(jnlei=="魔物系")return gdtext(event.x,event.y,"这是魔物们对立派技能,仅供参考/无法修炼!");
jn_xq[0].innerText="未习得";sd_xiulian.disabled=false;jn_allxq.style.display="";
var find1=jn.find(jnname1);if(find1!=false){
if(find1[1]>=jnlv+1){jn_xq[0].innerText="已练成";sd_xiulian.disabled=true;}
}
var templv=parseInt(xml.getjn(jnname1).getAttribute("lv_one"))+(obj2.jnnum*6)
jn_xq[1].innerText=templv;
jnlei=="神说系"?jn_xq[2].innerText="命中之人":jn_xq[2].innerText=zy.getzyname(jnobj1.getAttribute("lei"),Math.floor(templv/15)-1);
jn_newxq.innerText=Math.floor(templv/15);
jn_xq[3].innerText=templv*30;jn_xq[4].innerText=templv*30;
jn_xq[5].innerText=jnobj1.getAttribute("战心")==null?0:jnobj1.getAttribute("战心")*templv;
jn_xq[6].innerText=jnobj1.getAttribute("魔心")==null?0:jnobj1.getAttribute("魔心")*templv;
jn_xq[7].innerText=jnobj1.getAttribute("守心")==null?0:jnobj1.getAttribute("守心")*templv;
jn_xq[8].innerText=jnobj1.getAttribute("军心")==null?0:jnobj1.getAttribute("军心")*templv;
sd.seljnnum=jnlv
},
rwok:function(){  //任务递交
if(sd.selspimg==null)return gdtext(event.x,event.y,"你未选择对应的任务!");
var rwname=sd.selspimg.rwname,getrw1=xml.getrw(rwname),findrw=shouce.findrw(rwname),rwok=false
if(getrw1.getAttribute("lei")!="长期任务"&&findrw>0)return gdtext(event.x,event.y,"该任务并非是长期任务,你已完成无法再做!")
eval(getrw1.text);
if(rwok){shouce.jiangli(rwname);return shouce.addrw(rwname);}
return lt.help("无法完成该任务,任务要求没有达成!")
},
rwshow:function(){  //任务浏览
if(sd.selspimg==null)return gdtext(event.x,event.y,"你未选择对应的任务!");
showshige(sd.selspimg.rwname,"是任务");
},
jinghua:function(){  //装备净化
if(sd.selspimg==null)return gdtext(event.x,event.y,"你未选择对应净化的装备!")
if(rpg.glod<30)return gdtext(event.x,event.y,"净化服务费不够");
if(wpzb.getjinglian(sd.selspimg.xml_name)==0)return gdtext(event.x,event.y,"对应的装备是+0,无需净化已经是原始状态!")
if(!confirm('你确定没有看错?要把这个装备的精炼效果完全净化?'))return;
for(var i=0;i<rpg.zb.length;i++){if(rpg.zb[i]!=sd.selspimg.xml_name)continue;
wpzb.zbadd(rpg.zb[i],"模拟脱下计算","但不要删除现有装备");rpg.zb[i]=rpg.zb[i].replace(/(\$\$\$)\d+/g,"");
sd.selspimg.xml_name=rpg.zb[i];sd.mai(sd.selspimg);lt.help("净化完毕,装备失去超常能力,还原为纯净状态");
var oldlv=rpg.lv;rpg.lv=99999;wpzb.zbadd(rpg.zb[i]);rpg.lv=oldlv;rpg.glod-=30;
gx_rpg();if(zt_kuang.style.display!="none")tbzt.zhuangtai();saveuser();
}},
jinglian:function(){  //瞬间精炼
if(sd.selspimg==null)return gdtext(event.x,event.y,"你未选择对应精炼的装备!")
if(rpg.glod<30)return gdtext(event.x,event.y,"精炼服务费不够");
for(var i=1;i<5;i++){if(document.getElementById('jlrad'+i).checked)break;}
var value1=document.getElementById('jlrad'+i).value,chenggonglv=i*25;
if(wpzb.findwp("wp",value1)<1)return gdtext(event.x,event.y,"你没有一个 ["+value1+"],无法精炼!");
if(wpzb.getjinglian(sd.selspimg.xml_name)>=12)return gdtext(event.x,event.y,"该装备已精炼至极限,连我也无法再精炼下去!");
wp_add("wp",value1,-1);wpzb.wupin();var xingyunzhi=round(random()*100);jlxingyun.innerText=xingyunzhi+"<"+chenggonglv
if(xingyunzhi<=chenggonglv){var oldi=0;
for(var i=0;i<rpg.zb.length;i++){if(rpg.zb[i]!=sd.selspimg.xml_name)continue;oldi=i
wpzb.zbadd(rpg.zb[i],"模拟脱下计算","但不要删除现有装备")
rpg.zb[i].indexOf("$$$")!=-1?rpg.zb[i]=rpg.zb[i].replace(/(\$\$\$)\d+/g,"$1"+(wpzb.getjinglian(rpg.zb[i])+1)):rpg.zb[i]=rpg.zb[i]+"$$$1";
sd.selspimg.xml_name=rpg.zb[i];sd.mai(sd.selspimg);lt.help("恭喜精炼成功!装备目前+"+wpzb.getjinglian(rpg.zb[i])+"-已存档");}
}else{
for(var i=0;i<rpg.zb.length;i++){if(rpg.zb[i]!=sd.selspimg.xml_name)continue;oldi=i
wpzb.zbadd(rpg.zb[i],"模拟脱下计算","但不要删除现有装备");rpg.zb[i]=rpg.zb[i].replace(/(\$\$\$)\d+/g,"");
sd.selspimg.xml_name=rpg.zb[i];sd.mai(sd.selspimg);lt.help("运不佳精炼失败,装备被净化!-已存档");}
}
var oldlv=wj[0].lv;wj[0].lv=99999;wpzb.zbadd(rpg.zb[oldi]);wj[0].lv=oldlv;rpg.glod-=30;
gx_rpg();if(zt_kuang.style.display!="none")tbzt.zhuangtai();saveuser();
},
mark:function(){  //开始制作,修炼,分解
if(sd.selspimg==null)return gdtext(event.x,event.y,"你未选择相应的东西!")
var num=new Number(parseInt(sd_cishu.value))
if(num==0||isNaN(num)||num<0)sd_cishu.value=1
if(sd.sdname=="锻制"||sd.sdname=="强化"){
for(var i=0;i<cl_slmax.length;i++){
if(parseInt(cl_sl[i].innerText)<parseInt(cl_slmax[i].innerText)){return lt.help("操作中断(所需材料不足)")}
}
if(rpg.glod<parseInt(fuwufei.innerText))return lt.help("操作中断(服务费不足)")

sd_queren.disabled=true;sd_cishu.disabled=true;
return loading(sd.sdname+" "+sd.selspimg.xml_name,1,sd.selspimg,sd.sdname,20,2)
}else if(sd.sdname=="分解"){
if(rpg.glod<parseInt(fjfeiyong.innerText))return lt.help("无法分解,服务费不够")
fjbutton.disabled=true;
return loading(sd.sdname+" "+sd.selspimg.xml_name.replace("$$$","+"),1,sd.selspimg,sd.sdname,20,2)
}else if(sd.sdname=="技能"){var x1=event.x,y1=event.y
var findjn=jn.find(sd.selspimg.xml_name);
if(findjn!=false){
if(sd.seljnnum+1<=findjn[1])return gdtext(x1,y1,"你已经掌握了 ["+(sd.seljnnum+1)+"重 "+sd.selspimg.xml_name+"],无需再次修炼");
if(sd.seljnnum+1-findjn[1]>1)return gdtext(x1,y1,"要学习 ["+(sd.seljnnum+1)+"重],必须先精通 ["+(sd.seljnnum)+"重]");
}else{
if(sd.seljnnum+1>1)return gdtext(x1,y1,"你 ["+sd.selspimg.xml_name+" 1重] 都没有学,无法学习更高级")
}
if(sd.selspimg.oldjn!="无"){
if(jn.find(sd.selspimg.oldjn)==false){return gdtext(x1,y1,"学习 ["+sd.selspimg.xml_name+"]前,需要至少学习 1重["+sd.selspimg.oldjn+"]");}
}

if(!zy.find(jn_xq[2].innerText))return gdtext(x1,y1,"你未晋升职业到["+jn_xq[2].innerText+"]");
if(rpg.zhuanzhi.split("=")[0]<jn_newxq.innerText)return gdtext(x1,y1,"你的最强转职未突破["+jn_newxq.innerText+"段]");
if(wj[0].lv<jn_xq[1].innerText||rpg.yuanling<jn_xq[3].innerText||rpg.glod<jn_xq[4].innerText)return gdtext(x1,y1,"你的[级别 元灵 金币],至少有一项不满足条件");
for(var i=0;i<4;i++){if(rpg.dian[i]<jn_xq[i+5].innerText)return gdtext(x1,y1,"你的加点不满足修炼条件");}


sd_xiulian.disabled=true;
return loading(sd.sdname+" ["+sd.selspimg.xml_name+"]"+(sd.seljnnum+1)+"重",1,sd.selspimg,sd.sdname,25)
}
},
markend:function(){  //制作,修炼完毕
if(sd.sdname=="锻制"||sd.sdname=="强化"){
sd_queren.disabled=false;sd_cishu.disabled=false;
var getwp1=xml.getwp(sd.selspimg.xml_node,sd.selspimg.xml_name),allcl=getwp1.getAttribute("mark").split(",");
if(wp_add(sd.selspimg.xml_node,sd.selspimg.xml_name,1)!=true)return lt.help("操作中断(你的包裹已满)")
for(var i=0;i<allcl.length;i++){
var lei1=allcl[i].split("=")[0],name1=allcl[i].split("=")[1],sl1=allcl[i].split("=")[2]
wp_add(lei1,name1,-sl1);
}
rpg.glod-=parseInt(fuwufei.innerText);
wp_kuang.style.display='';gx_rpg();sd.mai(sd.selspimg)
wpzb.wupin();lt.help("成功制作了1个 ["+sd.selspimg.xml_name+"]");yinxiao("锤音");
if(sd_cishu.value>1){sd_cishu.value-=1;sd.mark()}
}else if(sd.sdname=="分解"){
fjbutton.disabled=false;rpg.glod-=parseInt(fjfeiyong.innerText);
wp_kuang.style.display='';gx_rpg();
if(parseInt(fjshuliang2.innerText)!=0){
if(wp_add(fjyulan2.lei1,fjyulan2.name1,parseInt(fjshuliang2.innerText))!=true)return lt.help("操作中断(你的包裹已满)");
}
wp_add("zb",sd.selspimg.xml_name,-1);wp_add("wp",fjyulan1.name1,fjshuliang1.innerText);
wpzb.wupin();lt.help("["+sd.selspimg.xml_name+"] 分解完成!");sd.open('分解');yinxiao("锤音");
}else if(sd.sdname=="技能"){
sd_xiulian.disabled=false;rpg.yuanling-=parseInt(jn_xq[3].innerText);rpg.glod-=parseInt(jn_xq[4].innerText);
jn.addjn(sd.selspimg.xml_name,sd.seljnnum+1);
gx_rpg();tbzt.zhuangtai();gx_qianneng();sd.seljn(jn_grayimg[sd.seljnnum]);jn.show(jn.oldjnlei);
lt.help("恭喜你,技能 ["+sd.selspimg.xml_name+"]"+(sd.seljnnum+1)+"重 修炼成功!");yinxiao("锤音");
}
}
}