function showshige(idname,isrw){
if(isrw==null){shige_kuang.isrw=false;shigespan.style.fontFamily="楷体_gb2312";
if(idname.indexOf("诗歌:")==0){shige_kuang2.style.backgroundImage="url('img/background/fengmian1.gif')";shige_kuang.style.backgroundImage="url('img/background/zhizhang4.jpg')";yinxiao("资料配乐")}
else if(idname.indexOf("资料:")==0){shige_kuang2.style.backgroundImage="url('img/background/fengmian2.gif')";shige_kuang.style.backgroundImage="url('img/background/zhizhang2.jpg')";yinxiao("资料配乐")}
else if(idname.indexOf("石板:")==0||idname.indexOf("神说:")==0){shige_kuang2.style.backgroundImage="url('img/background/fengmian3.jpg')";shige_kuang.style.backgroundImage="url('img/background/zhizhang3.jpg')";yinxiao("神说配乐")}
var shigemsg="《"+idname.substr(3)+"》\n原著-"+xml.getwp("wp",idname).getAttribute("v1")+" 计:"+xml.getwp("wp",idname).getAttribute("v2").replace(/\\n|\,|，|\.|。|\!|\！|\?|\？|\-|\_/g,"").length+"字\n \n"+xml.getwp("wp",idname).getAttribute("v2"),showsudu=2
if(rpg.wenxian.indexOf(idname)==-1)rpg.wenxian+=idname+","
}else{shige_kuang.isrw=true;shigespan.style.fontFamily="";
yinxiao("使用");shige_kuang2.style.backgroundImage="url('img/background/fengmian4.jpg')";shige_kuang.style.backgroundImage="url('img/background/zhizhang1.jpg')";var therw=xml.getrw(idname);
var shigemsg="这件事："+therw.getAttribute("help")+"\n \n请求你："+therw.getAttribute("yaoqiu")+"\n委托方-"+therw.getAttribute("hui")+" 计:"+therw.getAttribute("help").replace(/\\n|\,|，|\.|。|\!|\！|\?|\？|\-|\_/g,"").length+"字\n任务名《"+idname+"》",showsudu=2
}
if(shigemsg.length>800){shigespan.style.fontSize="22px"}else if(shigemsg.length>400){shigespan.style.fontSize="25px"}else shigespan.style.fontSize="30px";
shige_ying.style.display="";
shigespan.innerText=shigemsg.replace(/\\n/g,"\n")
shige_kuang.style.left=bodywid/2-(shige_kuang.offsetWidth/2);
shige_kuang2.style.left=shige_kuang.style.left;shige_kuang2.style.width=shige_kuang.offsetWidth;shige_kuang2.style.display="";
shige_kuang.style.visibility="visible";if(shige_kuang2.go!=null)clearInterval(shige_kuang2.go);
shigespan.style.filter=null;shige_kuang2.go=setInterval(function(){
if(shige_kuang2.offsetWidth>showsudu+parseInt(shige_kuang2.style.borderLeftWidth)){shige_kuang2.style.width=shige_kuang2.offsetWidth-$(showsudu/2);
shige_kuang2.style.backgroundPositionX=shige_kuang2.offsetWidth;
}else{
if(isrw==null)shigespan.style.filter="glow(color=white,strength="+(1+round(random()*29))+")";
}
},50)
}
var dh={
num:0,  //记录对话进行至几条
mubiao:null,  //记录对话BOOS
npc:null,  //记录对话NPC
showcg:function(thesrc){yinxiao("谈话");
if(thesrc=="关闭")return cg_kuang.style.display="none";shouce.addcg(thesrc.replace(".jpg",""));
cg_kuang.src="img/cg/"+thesrc;cg_kuang.style.display="";
},
closecg:function(){cg_kuang.style.display="none";lihua.src=null;},
bqsrc:function(bqtext){
if(bqtext=="随便"){bqtext="哈,愤怒,生气,晕,惊,耍帅,拜,喜欢,你好,哭泣,谢谢,开心,牛,沉默,疑问,鄙视,被打,得瑟,解说,汗,叹气,恶心,害羞".split(",");
bqtext=bqtext[Math.floor(bqtext.length*random())]}
switch(bqtext){  //对话表情翻译
case "哈":bqtext="1_13,2_1,5_20,6_32,3_16";break;case "愤怒":bqtext="1_11,2_13,3_20,5_9,6_25,1_14";break;
case "生气":bqtext="2_21,7_2,5_1,3_18,6_14,7_5";break;case "晕":bqtext="1_24,2_14,3_14,6_19,7_15";break;
case "惊":bqtext="1_23,2_8,2_25,3_13,5_18,7_10,7_13";break;case "耍帅":bqtext="1_16,2_29,3_22,5_21,6_23,7_32";break;
case "拜":bqtext="1_17,2_12,5_11,7_8,7_19";break;case "喜欢":bqtext="1_20,2_19,3_25,3_26,3_27,5_19,6_7,7_20";break;
case "你好":bqtext="1_15,2_4,3_1,5_26,6_12,1_5,7_7";break;case "哭泣":bqtext="1_18,2_17,3_2,3_29,5_10,6_8,7_16,7_17";break;
case "谢谢":bqtext="1_12,2_22,3_24,5_32,6_15,7_14";break;case "开心":bqtext="1_25,2_11,3_16,5_24,6_5,7_14";break;
case "牛":bqtext="2_7,3_23,5_15,5_29,7_23";break;case "沉默":bqtext="1_2,2_9,3_3,5_13,6_4,7_25";break;
case "疑问":bqtext="2_5,5_8,5_12,5_31,6_1,6_22,7_3";break;case "鄙视":bqtext="1_8,2_31,3_12,5_23,6_21,7_18,7_22";break;
case "被打":bqtext="1_6,2_24,5_3,5_27,6_11,7_26,7_27";break;case "得瑟":bqtext="1_32,2_20,3_30,5_2,6_17,7_21,7_29";break;
case "解说":bqtext="2_10,2_23,3_7,5_17,7_7,7_31";break;case "汗":bqtext="1_31,2_3,2_15,5_14,5_28,6_24";break;
case "叹气":bqtext="1_27,2_6,5_16,7_1,7_4";break;case "恶心":bqtext="2_28,5_25,6_9,7_28";break;
case "害羞":bqtext="1_4,2_32,3_8,3_15,6_3,7_24";break;
}if(bqtext.indexOf(",")==-1)return bqtext;
return bqtext.split(",")[Math.floor(bqtext.split(",").length*random())]
},
zd:function(whatzhandou){  //对话统一战斗函数
zd.begin(dh.mubiao.boosis+','+dh.mubiao.shouxia,whatzhandou);dh.close()
},
shoubian:function(){  //收编武将
if(wjjs.add(msg.names)!=false){dh.close();dh.npc.removeNode(true);dh.npc=null;}
},
lihui:function(biwosrc){
if(biwosrc!=null){  //彼方立绘
lihua.style.height="100%";if(biwosrc=="放大形象"){lihua.src=dh.npc==null?dh.mubiao.src:dh.npc.src;
}else{lihua.src="img/lihui/"+biwosrc;}
if(dh.npc!=null&&biwosrc=="放大形象"){
switch(dh.npc.sname){
case "莉莉丝":lihua.src="img/lihui/wj1.gif";break;case "桃子":lihua.src="img/lihui/taozi.gif";break;
case "爆菊哈尼":lihua.src="img/lihui/hani3.gif";break;case "非超级美女不娶":lihua.src="img/lihui/fcjmnbq.gif";break;
case "希特勒":lihua.src="img/lihui/xitele.gif";break;case "初音":lihua.src="img/lihui/chuyin.gif";break;
case "露露":lihua.src="img/lihui/lulu.gif";break;case "望星":lihua.src="img/lihui/wangxing.gif";break;
case "柔柔公主":lihua.src="img/lihui/rourougongzhu.gif";break;case "战国貂蝉":lihua.src="img/lihui/diaochan.gif";break;
case "灰天":lihua.src="img/lihui/huitian.gif";break;case "灰天x2":lihua.src="img/lihui/huitian.gif";break;
case "银河美美":lihua.src="img/lihui/meimei.gif";break;case "雅典娜":lihua.src="img/lihui/yadianna.gif";break;
case "潘多拉":lihua.src="img/lihui/panduola.gif";break;case "哈迪斯":lihua.src="img/lihui/hadisi.gif";break;
case "唐僧":lihua.src="img/lihui/sanzang.gif";alert(2);break;case "观世音":lihua.src="img/lihui/guanshiyin.gif";break;
case "万华妹":lihua.src="img/lihui/wanhua.gif";break;case "神秘黑影":lihua.src="img/lihui/shenshuoying.gif";break;
case "梅尔菲":lihua.src="img/lihui/canmouzhang.gif";break;case "欧阳锋":lihua.src="img/lihui/ouyangfeng.gif";break;
case "瓦尔博士":lihua.src="img/lihui/waer.gif";break;case "凤天翔":lihua.src="img/lihui/liehuo.gif";break;
case "艾丽西亚":lihua.src="img/lihui/qingguo.gif";break;case "血影":lihua.src="img/lihui/xueying.gif";break;
case "米奥蕾拉":lihua.src="img/lihui/miaoleila.gif";break;case "阿波罗":lihua.src="img/lihui/aboluo.gif";break;
case "阿瑞斯":lihua.src="img/lihui/aruisi.gif";break;case "西提斯":lihua.src="img/lihui/xitisi.gif";break;
case "唐吉赫拉休斯":lihua.src="img/lihui/tangjihelaxiusi.gif";break;case "菲拉":lihua.src="img/lihui/feila.gif";break;
case "释迦摩尼":lihua.src="img/lihui/shijiamoni.gif";break;case "黑夜x3":lihua.src="img/lihui/heiye.gif";break;
case "如来":lihua.src="img/lihui/rulai.gif";break;case "月魔莉莉斯":lihua.src="img/lihui/wj1.gif";break;
case "上杉谦信":lihua.src="img/lihui/shangshan.gif";break;case "十月":lihua.src="img/lihui/shiyue.gif";break;
}}
setTimeout('lihua.style.visibility="visible";lihua.style.left=bodywid-lihua.offsetWidth;lihua.style.top=bodyhei-lihua.offsetHeight;',20)
}else{  //我方立绘
lihua.src=wj[0].xingbie=="女性"?"img/lihui/mewoman.gif":"img/lihui/meman.gif";lihua.style.height="100%"
lihua.style.left=0;lihua.style.top=bodyhei-lihua.offsetHeight;setTimeout('lihua.style.visibility="visible"',25);
}},
lihuiclose:function(){
lihua.style.visibility="hidden";lihua.src=null
},
showmsg:function(){
var tempmsg=xml.getjq(msg.jq,dh.num);if(tempmsg=="close")return dh.close();
if(dh.num==0){yinxiao("谈话");dhbutton[0].disabled=true}else{dhbutton[0].disabled=false}
tempmsg=tempmsg.split("(&*(%%3223889-=\..")
var tempcg=jqdom.getElementsByTagName(msg.jq)[0].childNodes[dh.num].getAttribute("cg")
if(tempcg!=null)dh.showcg(tempcg);
if(tempmsg[0]=="msg1"){  //彼方发言
templihua=jqdom.getElementsByTagName(msg.jq)[0].getAttribute("lihui")
if(templihua!=null){dh.lihui(templihua)
}else{dh.lihuiclose()}
msg1.style.textAlign="left"
msgface.src="img/"+msg.face1;msgface.style.left=0;msg1.style.left="32%";
}else{  //我方发言
dh.lihui()
msgface.src=wj[0].xingbie=="女性"?"img/lihui/mewoman_small.gif":"img/lihui/meman_small.gif";msgface.style.left="68%";msg1.style.left=0;
}
var temp1="",temp2=msg.names
if(tempmsg[0]=="msg2")temp2=wj[0].name
if(tempmsg[1]!="null"){temp1="<img src='img/biaoqing/"+dh.bqsrc(tempmsg[1])+".gif' style='position:static;margin-left:-3px;' valign='top' align='left'>"}
var tempshu="12,21,22".split(",")
msg1.style.filter="revealtrans(duration=0.2,transition="+tempshu[round(2*random())]+")";
msg1.filters[0].apply();
msg1.innerHTML="<font style='font-weight:bold;color:red;font-family:黑体;font-size:16px;'>"+temp2+"</font><br>"+temp1+tempmsg[2].replace(/\%playname\%/gi,wj[0].name).replace(/\%npcname\%/gi,msg.names).replace(/\%gonghui\%/gi,gh.name);msg1.scrollTop=0;
msg.style.display="";sd_duihua=true
msg1.filters[0].play();
},
close:function(){
dh.num=0;msg.style.display='none';lihua.src="";dh.closecg();lihua.style.visibility="hidden";return sd_duihua=false;
}
}