DhtmlXQ_MXQ_MAIN.js
资源名称:xiangqi.rar [点击查看]
上传用户:hldjtg
上传日期:2022-07-28
资源大小:4250k
文件大小:60k
源码类别:
棋牌游戏
开发平台:
Java
- var isBIG5='';
- var PVer='070502';
- window.onerror=showalert;
- var qzdx=25,qgdx=25,w1=494,h0=350,ViewUrl='';
- var P90,D400,sMI,pMI,nnum,lnum,move,cnum,P;
- var fnum,xqtitle,hits,refer,MoveDIV,VarDIV,sText,Mscroll,qztxt,qzimg;
- var allowLR,isTurn,timer,canauto,isMirror,CSS,pClick,pCid;
- var xmlok,LiveUpMove,LiveMove,LiveMoveLen,LiveID,LiveAdmin,AllowLive,Livetimer;
- var NoFile=(self.name.substr(0,6)=='NoFile'||window==top)?true:false;
- try {P=parent.location.href} catch(e) {NoFile=true;}
- if (!DhtmlXQimgpath) var DhtmlXQimgpath='';if (!ads_dpxq) var ads_dpxq='';if (!isMXQ) var isMXQ=false;
- P=DhtmlXQimgpath+'DhtmlXQ_www_dpxq_com'+isBIG5;
- var BGIMG=P+'_background.gif',BIMG=P+'_board.gif',CIMG=P+'.gif';
- document.write('<style type="text/css">');
- document.write('* {font-size:12px;line-height:16px;margin:0;padding:0;'+((!isBIG5)?'font-family:u5B8Bu4F53,u65B0u5B8Bu4F53,MS Song,SimSun,NSimSun;':'font-family:u7EC6u660Eu4F53,u65B0u7EC6u660Eu4F53,MingLiU,PMingLiU;')+'}');
- document.write('.bz,.rz {top:-3px!important;line-height:32px;width:32px;position:absolute;height:32px;'+((!isBIG5)?'font-size:32px;left:-4px;top:-1px;':'font-size:27px;left:-1px;top:-2px;')+'}');
- document.write('.bt,.rt {font-size:16px;left:4px;width:25px;position:absolute;height:25px;color:#fff;'+((!isBIG5)?'line-height:18px;top:4px;':'line-height:25px;top:0px;')+'}');
- document.write('.bz {color:#000;}');
- document.write('.rz {color:#f00;}');
- document.write('a:link,a:active,a:visited {text-decoration:none;color:#000;}');
- document.write('a:hover {text-decoration:underline;}');
- document.write('body {overflow:hidden;background-color:transparent;}');
- document.write('#divs,#divsave {position:absolute;left:0;top:0;text-align:left;width:100%;height:100%;background-color:#f4fcf3;background-image:url('+BGIMG+');}');
- document.write('#div0,#div1,#div2,#div3,#div15,#div16 {position:absolute;overflow:hidden;}');
- document.write('#div0 {text-align:left;top:3px;}');
- document.write('#div1 {text-align:center;top:0;left:0;font-size:16px;line-height:20px;padding-top:4px;}');
- document.write('#div2 {left:2px;}');
- document.write('#div3 {position:absolute;cursor:default;}');
- document.write('#div3 img,#div3 div {position:absolute;margin:0;}');
- document.write('#div4 {position:absolute;left:2px;}');
- document.write('#div4 input {width:36px;height:22px;line-height:18px;margin-right:1px;}');
- document.write('#div5,#div8 {position:absolute;top:0;background-color:#666;}');
- document.write('#div6,#div9 {position:absolute;left:1px;top:1px;background-color:#fbfefb;overflow:hidden;}');
- document.write('#div7,#div10,#div11,#div12,#div13,#div14,#div17 {background-color:#69f;overflow:hidden;}');
- document.write('#div5 {left:0;}');
- document.write('#div15 {top:0;}');
- document.write('#div16 {text-align:left;top:353px;left:6px;height:32px;}');
- document.write('#bside,#rside {position:absolute;overflow:hidden;padding-left:6px;line-height:14px;height:14px;}');
- document.write('#bside {top:4px;}');
- document.write('#rside {bottom:0;}');
- document.write('#listtext {position:absolute;}');
- document.write('#m_scroll,#c_scroll,#v_scroll {overflow:auto;background-attachment:fixed;}');
- document.write('#c_scroll,#v_text div {position:relative;}');
- document.write('#m_text div,#v_text div {line-height:14px;padding-top:2px;cursor:default;}');
- document.write('#m_text,#v_text {border:0;margin:1px 0 1px 2px;}');
- document.write('#div18,#v_text div div {position:absolute;top:0;left:0;background-color:#316ac5;}');
- document.write('#div18 a {margin-left:2px;line-height:14px;color:#ff0;}');
- document.write('#c_text {overflow-y:scroll!important;overflow-y:visible;border:0;width:100%;padding-left:2px;background-color:transparent;}');
- document.write('#source_Text,#search_Text {position:absolute;border:0;padding:2px;text-align:left;background-attachment:fixed;}');
- document.write('#sourceText,#searchText {position:absolute;background-color:#666;top:0;left:1px;}');
- document.write('#sourceText0,#searchText0 {position:absolute;background-color:#69f;top:1px;}');
- document.write('#searchText0 {overflow:hidden;}');
- document.write('#search_Text input {width:180px;height:22px;line-height:18px;}');
- document.write('#shownow {border:0;background-color:transparent;color:#00f;height:22px;width:47px;line-height:22px;}');
- document.write('#showText {position:absolute;left:5px;top:386px;padding:2px;background-color:#fff;background-attachment:fixed;}');
- document.write('#autotime {position:absolute;bottom:2px;left:198px;background-color:#fff;border:1px solid #000;padding-top:3px;width:36px;text-align:center;}');
- document.write('#autotime a {line-height:13px;color:#000;}');
- document.write('#board {background-color:#666;}');
- document.write('#board td {background-color:#fff;height:24px;width:24px;padding:1px 0 0 1px;}');
- document.write('#board div {position:relative;width:23px;height:23px;background-color:#eed3b3;}');
- document.write('#t2 {position:absolute;}');
- document.write('#t2 td {width:25px;height:25px;}');
- document.write('#div19 div {overflow:hidden;background-color:#666;width:1px;height:1px;font-size:1px;line-height:1px;}');
- document.write('#message {position:absolute;left:10%;top:100px;width:80%;height:100px;padding:6px;border:2px solid #0f0;text-align:center;color:#00f;background-color:#f4fcf3;}');
- document.write('#message input {width:20%;height:22px;position:absolute;bottom:6px;left:40%;}');
- document.write('</style>');
- document.write('<div id="message"><br>DongPing DhtmlXQ ChessBoard Loading ......<br>Powered By dpxq.com Program Version '+PVer+'</div><div id="divs" style="overflow:hidden;"></div><div id="divsave" style="display:none;overflow:auto;"></div>');
- var isSP=(NoFile)?false:((parent.location.href.search(//hldcg/search(/?$|/??.*|/(index|mini).asp.*)/gi)!=-1)?true:false);
- var SURL=(location.hostname=='localhost')?'http://localhost/hldcg/search/':'http://www.dpxq.com/hldcg/search/';
- var UBB=((NoFile)?self.name:parent.document.getElementById(self.name.substr(5)).innerHTML).match(/[(DhtmlXQ_w+)].+[/1]/gi);
- UBB=(UBB==null)?('[DhtmlXQ_ver]www_dpxq_com'+isBIG5+'[/DhtmlXQ_ver]rn[DhtmlXQ_init]500,350[/DhtmlXQ_init]'):unconv(UBB.join('rn')).replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/ /gi,' ');
- function showalert(sMag,sUrl,sLine)
- {
- sMag=(!sUrl)?sMag:('u9519u8BEFuFF1A'+sMag+'u3000u884Cu53F7uFF1A'+sLine+'<br>u7F51u5740uFF1A'+sUrl+'<br>u62A5u544Au9519u8BEFuFF1A<a target="_blank" href="tencent://message/?uin=88081492&Site=DhtmlXQ.'+location.hostname+'&Menu=yes"><img border="0" SRC="http://wpa.qq.com/pa?p=1:88081492:16" alt="u70B9u51FBu8FD9u91CCu53D1u6D88u606F" /></a>u3000<a target="_blank href="http://amos1.taobao.com/msg.ww?v=2&uid=hldcg&s=1" ><img border="0" src="http://amos1.taobao.com/online.ww?v=2&uid=hldcg&s=1" alt="u70B9u51FBu8FD9u91CCu53D1u6D88u606F" /></a>');
- document.getElementById('message').innerHTML=sMag+'<br><input type=button value="u786Eu5B9A" id="cancel" onclick="document.getElementById('message').style.zIndex='';">';
- document.getElementById('message').style.zIndex=3;
- return true;
- }
- function Xnc_KEvent(Xnc_K)
- {
- if (allowLR) {if (Xnc_K==39) gotonum('Next'); else if (Xnc_K==37) gotonum('Prev');}
- }
- function getvar(v)
- {
- var r=eval('/\[(DhtmlXQ_'+v+')\](.*)\[\/\1\]/gi');
- var s=UBB.match(r);
- return (s==null)?'':s[0].replace(r,'$2').replace(/||/gi,'rn');
- }
- function board()
- {
- var i,j,s='';
- s+=('<div style="left:5px;top:5px;width:215px;height:240px;background-color:#666;"><div style="left:3px;top:3px;width:209px;height:234px;background-color:#eed3b3;"><div style="left:4px;top:4px;width:202px;height:227px;">');
- s+=('<table id="board" cellspacing="1" cellpadding="0" style="border-right:1px solid #fff;border-bottom:1px solid #fff;">');
- for (i=0;i<9;i++)
- {
- s+=('<tr>');
- if (i==4) s+=('<td colspan="8"><div style="width:198px;"><pre style="padding-top:4px;"> u695A u6CB3 u6C49 u754C</pre></div></td>');
- else for (j=0;j<8;j++) s+=('<td><div></div></td>');
- s+=('</tr>');
- }
- s+=('</table>');
- s+=('<div id="div19" style="top:0;left:0;">');
- s+=ls(100,25);
- s+=ls(100,200);
- s+=lz(0,75,2)+lz(50,75)+lz(100,75)+lz(150,75)+lz(200,75,3);
- s+=lz(25,50)+lz(175,50);
- s+=lz(0,150,2)+lz(50,150)+lz(100,150)+lz(150,150)+lz(200,150,3);
- s+=lz(25,175)+lz(175,175);
- s+=('</div></div></div></div>');
- return s;
- }
- function ls(x,y)
- {
- var i,s='',l=qgdx;
- for (i=-l;i<l;i++) s+=('<div style="left:'+(x+i)+'px;top:'+(y+i)+'px;"></div><div style="left:'+(x+i)+'px;top:'+(y-i)+'px;"></div>');
- return s;
- }
- function lz(x,y,m)
- {
- var s='',t=2,l=5;
- if (m!=2) s+=ld((x-t-l),(y-t-l),0,0,l)+ld((x-t-l),(y+t),1,0,l);
- if (m!=3) s+=ld((x+t),(y-t-l),0,1,l)+ld((x+t),(y+t),1,1,l);
- return s;
- }
- function ld(x,y,a,b,l)
- {
- return '<div style="left:'+x+'px;top:'+y+'px;width:'+(l+1)+'px;height:'+(l+1)+'px;"><div style="width:'+l+'px;height:'+l+'px;background-color:#eed3b3;top:'+a+'px;left:'+b+'px;"></div></div>';
- }
- function initboard()
- {
- var viewtype='txt';
- var i,s='',h2=26,h3=24,h4=18,h5=258,h6=175,h7=65;
- var bimgx=232,bimgy=291,bimgtop=22,bimgleft=4;
- var w0=500,w2=106,w3=144,w4=124,h1=344;
- w1=getvar('init');
- if (w1.search(/d+,d+/gi)==-1||isSP) w1=494;
- else
- {
- w1=w1.split(',')[0]-6;
- if (w1<=236) w1=236;
- else if (w1<=346) w1=346;
- else w1=494;
- }
- if (NoFile||isSP||(parent.location.pathname=='/hldcg/chess/view.htm'))
- h0=document.getElementById('divs').clientHeight;
- else
- {
- parent.document.getElementById('id_'+self.name.substr(5)).style.width=(w1+6);
- h0=parseInt(parent.document.getElementById('id_'+self.name.substr(5)).height);
- if (h0<500) {h0=h1+6;parent.document.getElementById('id_'+self.name.substr(5)).style.height=h0;}
- }
- qztxt='u8F66u9A6Cu76F8u4ED5u5E05u4ED5u76F8u9A6Cu8F66u70AEu70AEu5175u5175u5175u5175u5175u8F66u9A6Cu8C61u58EBu5C06u58EBu8C61u9A6Cu8F66u70AEu70AEu5352u5352u5352u5352u5352'.split('');
- for (i=0;i<32;i++) qztxt[i]='<div class="'+((i<16)?'r':'b')+'z" id="qz'+i+'">u25CF</div><div class="'+((i<16)?'r':'b')+'t">'+qztxt[i]+'</div>';
- qzimg='r1r2r3r4r5r4r3r2r1r6r6r7r7r7r7r7b1b2b3b4b5b4b3b2b1b6b6b7b7b7b7b7'.match(/../g);
- CIMG=(viewtype=='txt')?'':('background-image:url('+CIMG+');');
- s+=('<div id="div0" style="left:3px;width:'+w1+'px;height:'+h1+'px;">');
- //u751Fu6210u68CBu76D8
- s+=('<div id="div1" style="width:'+w1+'px;height:'+h2+'px;"></div>rn');
- if (viewtype=='txt') s+=('<div id="div2" style="top:'+h2+'px;width:'+bimgx+'px;height:'+(bimgy+2)+'px;background-color:#666;">rn<div style="background-color:#eed3b3;margin:1px 0 0 1px;width:'+(bimgx-2)+'px;height:'+(bimgy)+'px;"></div>');
- else s+=('<div id="div2" style="top:'+h2+'px;background-image:url('+BIMG+');width:'+bimgx+'px;height:'+(bimgy+2)+'px;">rn');
- s+=('<div id="bside" style="left:'+bimgleft+'px;width:'+(qgdx*9+12)+'px;letter-spacing:'+(qgdx-12)+'px;">uFF11uFF12uFF13uFF14uFF15uFF16uFF17uFF18uFF19</div>');
- s+=('<div id="div3" style="top:'+bimgtop+'px;left:'+bimgleft+'px;width:'+(qgdx*9)+'px;height:'+(qgdx*10+2)+'px;">');
- if (viewtype=='txt') s+=board();
- for (i=0;i<=31;i++) s+=('<div id="z'+i+'" style="width:'+qgdx+'px;height:'+qgdx+'px;left:'+(9*qgdx)+'px;top:'+(9*qgdx)+'px;">'+((viewtype=='txt')?qztxt[i]:('<img src="'+DhtmlXQimgpath+qzimg[i]+isBIG5+'.gif" style="width:'+(qzdx-1)+'px;height:'+(qzdx-1)+'px;">'))+'</div>');
- s+=('<table id="t2" cellspacing="0" cellpadding="0">');
- for (i=0;i<10;i++)
- {
- s+=('<tr>');
- for (j=0;j<9;j++) s+=('<td onclick="getMove(''+j+i+'')"></td>');
- s+=('</tr>');
- }
- s+=('</table>');
- s+=('</div>');
- s+=('<div id="rside" style="letter-spacing:'+(qgdx-12)+'px;left:'+bimgleft+'px;width:'+(qgdx*9+20)+'px;">u4E5Du516Bu4E03u516Du4E94u56DBu4E09u4E8Cu4E00</div>');
- s+=('</div>');
- s+=('<div id="div4" style="top:'+(bimgy+h2+4)+'px;width:'+w1+'px;">');
- s+=('<input type="button" value="u5F00u5C40" onclick="gotonum('First')">');
- s+=('<input type="button" value="u540Eu9000" onmouseup="gotonum('Prev')">');
- s+=('<input type="button" value="u524Du8FDB" onmouseup="gotonum('Next')">');
- s+=('<input type="button" value="u7EC8u5C40" onclick="gotonum('Last')">');
- s+=('<input type="button" value="0/0" id="shownow" style="width:47px;">');
- s+=('<input type="button" value="u81EAu52A8" id="autoplay" onclick="AutoPlay()">');
- s+=('<input type="button" value="u65CBu8F6C" id="turn_Board" onclick="turnBoard()">');
- s+=('<input type="button" value="u5BF9u79F0" id="mirror_Board" onclick="mirrorBoard()">');
- s+=('<input type="button" value="u5BFCu51FA" id="showsource" style="color:#f00;" onclick="ViewSource()">');
- s+=('<input type="button" value="u4FDDu5B58" id="showsave" onclick="EditSave()">');
- s+=('<input type="button" value="u4EA4u6362" id="swap_Color" onclick="swapColor()">');
- s+=('<input type="button" value="u68CBu8C31u641Cu7D22" id="showsearch" style="width:72px;color:#f00;" onclick="ViewSearch()">');
- s+=('</div>');
- //u68CBu76D8u7ED3u675F
- s+=('<div id="autotime" style="display:none;" onmouseout="setTimeout('document.getElementById(\'autotime\').style.display=\'none\';',5000)"><a href="javascript:Autotimer(8000)">8.0u79D2</a><br><a href="javascript:Autotimer(5000)">5.0u79D2</a><br><a href="javascript:Autotimer(3000)">3.0u79D2</a><br><a href="javascript:Autotimer(2000)">2.0u79D2</a><br><a href="javascript:Autotimer(1000)">1.0u79D2</a><br><a href="javascript:Autotimer(500)">0.5u79D2</a><br><a href="javascript:Autotimer(200)">0.2u79D2</a><br><a href="javascript:Autotimer(100)">0.1u79D2</a></div>');
- s+=('<div id="listtext" style="top:'+h2+'px;left:'+(bimgx+4)+'px;width:'+(w1-bimgx-4)+'px;height:'+bimgy+'px;">');
- s+=(' <div id="div5" style="height:'+(bimgy+2)+';width:'+(w2+2)+'px;">');
- s+=(' <div id="div6" style="height:'+bimgy+';width:'+w2+'px;">');
- s+=(' <div id="div7" style="height:'+h4+'px;width:'+w2+'px;line-height:'+(h4+2)+'px;"> u68CBu8C31u5E8Fu5217u3000[<a href="javascript:HideMove();" id="hidemove">u9690u85CF</a>]</div>');
- s+=(' <div id="m_scroll" style="'+CIMG+'width:'+w2+'px;height:'+h5+'px;">');
- s+=('<div id="m_text" style="height:'+h5+'px;" onselectstart="return false;">');
- s+=('<div id="move_0" onmouseup="gotonum(0)" style="background-color:#316ac5;color:#fff;">====u68CBu5C40u5F00u59CB</div>');
- s+=('</div>');
- s+=(' </div>');
- s+=(' <div id="div14" style="height:'+h4+'px;width:'+w2+'px;line-height:'+(h4+2)+'px;"> </div>');
- s+=(' </div>');
- s+=(' </div>');
- s+=(' <div id="div8" style="left:'+(w2+4)+'px;height:'+(bimgy+2)+'px;width:'+(w3+2)+'px;">');
- s+=(' <div id="div9" style="height:'+bimgy+'px;width:'+w3+'px;">');
- s+=(' <div id="div10" style="height:'+h4+'px;width:'+w3+'px;line-height:'+(h4+2)+'px;"> u6CE8u89E3u3000<a href="javascript:EditComment()">u70B9u51FBu6B64u5904u4FEEu6539u6CE8u89E3</a></div>');
- s+=(' <div id="c_scroll" style="'+CIMG+'width:'+w3+'px;height:'+h6+'px;">');
- s+=(' <textarea id="c_text" style="margin-top:1px;height:'+(h6-2)+'px;" onblur="allowLR=true;" onfocus="allowLR=false;" ondblclick="this.select();"></textarea>');
- s+=(' </div>');
- s+=(' <div id="div11" style="height:'+h4+'px;width:'+w3+'px;line-height:'+(h4+2)+'px;"> u53D8u7740(u5355u51FBu9009u62E9)u3000<a href="javascript:UpMove()" title="u63D0u5347u5F53u524Du9009u62E9u53D8u7740u7684u6392u5E8F">u5347</a><a href="javascript:DownMove()" title="u964Du4F4Eu5F53u524Du9009u62E9u53D8u7740u7684u6392u5E8F">u964D</a><a href="javascript:DelMove()" title="u5220u9664u672Cu6B65u4EE5u540Eu7740u6CD5u6216u5220u9664u5F53u524Du9009u62E9u7684u53D8u7740u53CAu5176u540Eu7EEDu53D8u7740">u5220</a></div>');
- s+=(' <div id="v_scroll" style="'+CIMG+'width:'+w3+'px;height:'+h7+'px;">');
- s+=(' <div id="v_text" style="height:'+h7+'px;" onselectstart="return false;">'+ads_dpxq+'</div>');
- s+=(' </div>');
- s+=(' <div id="div17" style="height:'+h4+'px;width:'+w3+'px;line-height:'+(h4+2)+'px;"> </div>');
- s+=(' </div>');
- s+=(' </div>');
- s+=(' <div id="sourceText" style="display:none;width:'+(w1-bimgx-8)+'px;height:'+(bimgy+2)+'px;">');
- s+=(' <div id="sourceText0" style="width:'+(w1-bimgx-8)+'px;height:'+bimgy+'px;">');
- s+=(' <div id="div13" style="width:'+(w1-bimgx-8)+'px;height:'+h4+'px;line-height:'+(h4+2)+'px;"> <a href="javascript:copycode(sText,0)">u590Du5236</a> <a href="javascript:getUBB()">UBB</a> <a href="javascript:getTEXT('100')">u6587u672C</a> <a href="javascript:getHTML()">HTML</a> <a href="javascript:getBLOG()">u535Au5BA2</a> <a href="javascript:getIFRAME()">IFRAME</a> <a href="javascript:getIMGTEXT()">u68CBu56FE</a></div>');
- s+=(' <textarea id="source_Text" ondblclick="this.select();" style="'+CIMG+'top:'+h4+'px;width:'+(w1-bimgx-8)+'px;height:'+h5+'px;"></textarea>');
- s+=(' </div>');
- s+=(' </div>');
- s+=(' <div id="searchText" style="display:none;width:'+(w1-bimgx-8)+'px;height:'+(bimgy+2)+'px;">');
- s+=(' <div id="searchText0" style="width:'+(w1-bimgx-8)+'px;height:'+bimgy+'px;">');
- s+=(' <div id="div15" style="width:'+(w1-bimgx-8)+'px;height:'+h4+'px;line-height:'+(h4+2)+'px;"> u68CBu8C31u641Cu7D22</div>');
- s+=(' <div id="search_Text" style="'+CIMG+'background-color:#fff;top:'+h4+'px;width:'+(w1-bimgx-8)+'px;height:'+h5+'px;"></div>');
- s+=(' </div>');
- s+=(' </div>');
- s+=('</div>');
- s+=('</div>');
- s+=('<div id="footDiv">');
- s+=('<div id="div16" style="width:'+(w1-8)+'px;"></div>');
- s+=('<form target="DhtmlXQ_dpxq" style="display:none;" name="DhtmlXQ_search" id="DhtmlXQ_search" method="post" action="'+SURL+'index.asp"><textarea name="ubb"></textarea><input type="text" name="s" value=""><input type="text" name="f" value=""></form>');
- s+=('<textarea id="showText" ondblclick="this.select();" style="height:'+((h0>392)?(h0-392):0)+'px;width:'+(w1-5)+'px;'+CIMG+'"></textarea>');
- s+=('</div>');
- document.getElementById('divs').innerHTML=s;
- }
- function Conv_Ver2(S,MP)
- {
- if (!MP)
- {
- MP=S.match(/[DhtmlXQ_movelist].+[/DhtmlXQ_movelist]/gi);
- if (MP==null) return S;
- else MP=MP[0].replace(/[DhtmlXQ_movelist](.+)[/DhtmlXQ_movelist]/gi,'$1').replace(/[^A-Za-z0-9]/gi,'');
- }
- if (MP.search(/D/gi)!=-1) MP=MP.replace(/(w{6}[XYZ])/gi,'|$1').substr(1).split('|');
- else return S;
- var M=new Array('0_1'),MOVE=new Array(''),i,l,M1,M2,MI=0,MII=new Array(),MIJ=0;
- l=MP.length;
- for (i=0;i<l;i++)
- {
- M1=MP[i].substr(0,4);
- M2=parseInt(MP[i].substr(8),10);
- if (i==M2) {MIJ++;MOVE[MI]+=M1;}
- else {MI++;M[MI]=MII[M2];MIJ=parseInt(MII[M2].split('_')[1],10);MOVE[MI]=M1;}
- MII[i]=MI+'_'+MIJ;
- S=S.replace('[DhtmlXQ_comment'+(i+1)+']','[DhtmlXQ_comment'+MII[i]+']').replace('[/DhtmlXQ_comment'+(i+1)+']','[/DhtmlXQ_comment'+MII[i]+']');
- }
- for (i=M.length-1;i>=0;i--) M[i]='[DhtmlXQ_move_'+M[i]+'_'+i+']'+MOVE[i]+'[/DhtmlXQ_move_'+M[i]+'_'+i+']';
- S=S.replace(/DhtmlXQ_comment0]/gi,'DhtmlXQ_comment0_0]').replace(/[DhtmlXQ_(commentd+|movew+)].*[/DhtmlXQ_1]/gi,'')+M.join('rn');
- return S;
- }
- function initdata()
- {
- //u6E05u9664u5B9Au65F6u5668
- clearInterval(Livetimer);
- clearInterval(timer);
- if(pCid>=0) document.getElementById('z'+pCid).style.backgroundColor='';
- document.getElementById('divsave').style.display='none';
- document.getElementById('autoplay').value='u81EAu52A8';
- document.getElementById('turn_Board').style.color='';
- document.getElementById('mirror_Board').style.color='';
- Mscroll=document.getElementById('m_scroll');
- MoveDIV=document.getElementById('m_text');
- VarDIV=document.getElementById('v_text');
- sText=document.getElementById('source_Text');
- //u521Du59CBu5316u53D8u91CF
- ViewUrl=getvar('viewurl');
- refer='';pClick='';pCid=-1;cnum=32;nnum=0;fnum=0;lnum=0;
- allowLR=true;isTurn=false;canauto=true;LiveAdmin=false;CSS=true;isMirror=false;
- sMI='0_1_0'.split(' ');
- pMI='0_1_0'.split(' ');
- D400=''.split('');D400[401]='';
- P90=' '.replace(/ /gi,' ').replace(/ /gi,'99').match(/dd/gi);
- P=(getvar('binit').replace(/D/gi,'9')+'8979695949392919097717866646260600102030405060708012720323436383').match(/d{64}/);
- xqtitle=getvar('title').replace(/&/g,'&').replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>').replace(/'/g,'’');
- hits=getvar('hits');
- if (hits!='') hits='u6D4Fu89C8 '+hits+' u6B21';
- move=getvar('movelist').replace(/[^A-Za-z0-9]/gi,'');
- if (UBB.search(/[(DhtmlXQ_move_d+_d+_d+)]d{4}.*[/1]/gi)==-1&&move.search(/D/gi)!=-1) UBB=Conv_Ver2(UBB,move); //u8001u4EE3u7801
- UBB=UBB.replace(/[DhtmlXQ_comment(d+)](.+)[/DhtmlXQ_comment1]/gi,'[DhtmlXQ_comment0_$1]$2[/DhtmlXQ_comment0_$1]');
- UBB=UBB.replace(/[DhtmlXQ_movelist](.*)[/DhtmlXQ_movelist]/gi,'[DhtmlXQ_move_0_1_0]$1[/DhtmlXQ_move_0_1_0]');
- if (UBB.search(/[DhtmlXQ_move_0_1_0].*[/DhtmlXQ_move_0_1_0]/gi)==-1) UBB+='[DhtmlXQ_move_0_1_0][/DhtmlXQ_move_0_1_0]';
- move=getvar('move_0_1_0');
- lnum=parseInt(move.length/4);
- fnum=parseInt(getvar('firstnum'));
- if (isNaN(fnum)) fnum=0;
- if (lnum>400) lnum=400;
- if (fnum>lnum) fnum=lnum;
- if (fnum<0) fnum=0;
- var i,j,x,y,t='';
- for (i=0;i<=31;i++)
- {
- x=P[0].charAt(i*2)-0;
- y=P[0].charAt(i*2+1)-0;
- if (x==9) cnum--;
- document.getElementById('z'+i).style.left=(x*qgdx);
- document.getElementById('z'+i).style.top=(y*qgdx);
- P90[x*10+y]=i;
- }
- document.getElementById('div1').innerHTML='<nobr><span style="'+(((w1==236)||(xqtitle.replace(/[^x00-xff]/gi,'xx').length*8>w1))?('font-size:10pt;'):('font-size:12pt;'))+'">'+xqtitle+'</span></nobr>';
- MoveDIV.innerHTML='<div id="move_0" onmouseup="gotonum(0)" style="background-color:#316ac5;color:#fff;">====u68CBu5C40u5F00u59CB'+havecomment(0,0)+'</div>';
- var c_m=getMovelistString(move,P[0]);
- for (i=1,j=0;i<=lnum;i++)
- {
- sMI[i]='0_1_0';
- pMI[i]='0_1_0';
- t+=('rn<div id="move_'+i+'" onmouseup="gotonum('+i+')">');
- if (i%2==1) {j++;t+=(j>=100)?(j+'.'):((j>=10)?(' '+j+'.'):(' '+j+'.'));}
- else t+=(' ');
- t+=(c_m.substr(i*4-4,4)+havecomment(0,i)+havevar(0,i)+'</div>');
- }
- MoveDIV.innerHTML+=t;
- document.getElementById('div16').innerHTML=getrefer();
- var f=ViewUrl.match(/f=d{1,3}[_d]*/gi);
- gotoMI((f!=null)?f[0].substr(2):(''+fnum));
- if (NoFile)
- {
- if (document.referrer)
- {
- refer=document.referrer;
- if (refer!='') refer=escape(refer.replace(/(w:/+[^/]+)(/.*)?/gi,'$1')+'/rn'+refer);
- }
- }
- else
- {
- refer=parent.location.href;
- if (refer.search(//hldcg/chess/view.htm/gi)!=-1)
- refer=parent.document.getElementById('refer').innerHTML;
- else
- {
- if (refer.search(/dhtmlw{3}.asp?f=.+/gi)!=-1) refer=parent.parent.location.href;
- refer=escape(location.protocol+'//'+location.hostname+'/rn'+refer);
- }
- }
- if (refer=='') refer=getvar('refer');
- if (refer=='') refer=escape('http://www.dpxq.com/rnhttp://www.dpxq.com/hldcg/search/');
- getSEARCH();
- if (h0>=392||isSP||window==top) getTEXT('100');
- if (getvar('class')=='u5BF9u5C40u76F4u64AD') LiveMain();
- }
- function conv_ev(ev)
- {
- var ev=ev.match(/dd/gi);
- if (ev==null) return '';
- if (isMirror&&isTurn) {for (i=0;i<ev.length;i++) if (ev[i]!='99') ev[i]=''+ev[i].substr(0,1)+(9-ev[i].substr(1));}
- else if (isMirror) {for (i=0;i<ev.length;i++) if (ev[i]!='99') ev[i]=''+(8-ev[i].substr(0,1))+ev[i].substr(1);}
- else if (isTurn) {for (i=0;i<ev.length;i++) if (ev[i]!='99') ev[i]=(189-ev[i]).toString().substr(1);}
- return ev.join('');
- }
- function CP(p)
- {
- var b=p.match(/dd/gi);p=b;
- if (b[0]<b[8]) {p[8]=b[0];p[0]=b[8];}
- if (b[1]<b[7]) {p[7]=b[1];p[1]=b[7];}
- if (b[2]<b[6]) {p[2]=b[2];p[2]=b[6];}
- if (b[3]<b[5]) {p[5]=b[3];p[3]=b[5];}
- if (b[9]<b[10]) {p[10]=b[9];p[9]=b[10];}
- if (b[16]>b[24]) {p[24]=b[16];p[16]=b[24];}
- if (b[17]>b[23]) {p[23]=b[17];p[17]=b[23];}
- if (b[18]>b[22]) {p[22]=b[18];p[18]=b[22];}
- if (b[19]>b[21]) {p[21]=b[19];p[19]=b[21];}
- if (b[25]>b[26]) {p[26]=b[25];p[25]=b[26];}
- return p=p.slice(0,11).join('')+b.slice(11,16).sort().reverse().join('')+p.slice(16,27).join('')+b.slice(27,32).sort().join('');
- }
- function getMove(ev)
- {
- isMXQ=true;
- CSS=false;
- if (ev.length==4) pClick=ev;
- else if (ev.length==2) pClick+=conv_ev(ev);
- else return;
- var p,i,r,m;
- p=conv_ev(getpos(1)).replace(/(dd)/gi,'$1_');
- if (pCid>=0) {document.getElementById('z'+pCid).style.backgroundColor='';pCid=-1;}
- if (pClick.length%4==2)
- {
- pCid=p.indexOf(pClick.substr(pClick.length-2))/3;
- if (pCid>=0) document.getElementById('z'+pCid).style.backgroundColor='#0f0';
- else pClick=pClick.replace(/^(.*)dd$/gi,'$1');//u9632u70B9u9519
- return;
- }
- var PT=pClick.replace(/^.*(d{4})$/gi,'$1');
- var s1='_'+PT.substr(0,2)+'_';
- var s2='_'+PT.substr(2,2)+'_';
- if (s1==s2) {pClick=pClick.replace(/^(.*)d{4}$/gi,'$1');return;}
- var move_ev=(pClick.length>4||isMXQ)?'':getMovelistString(PT,P[nnum]);
- if (move_ev!='')
- {
- if (nnum==lnum)
- {
- lnum++;
- move+=PT;
- if (!document.getElementById('move_'+lnum))
- MoveDIV.innerHTML+='rn<div id="move_'+lnum+'" onmouseup="gotonum('+lnum+')">'+((nnum%2==0)?(' '+(nnum/2+1)+'.').replace(/.*(.{4})$/gi,'$1'):(' ')).replace(/ /gi,' ')+move_ev+' </div>';
- sMI[lnum]=sMI[nnum];
- pMI[lnum]=sMI[nnum];
- r=eval('/\[(DhtmlXQ_move_'+sMI[nnum]+')\](.*)\[\/\1\]/gi');
- UBB=UBB.replace(r,'[$1]$2MOVE[/$1]').replace('MOVE',PT);
- UpData();
- gotonum('Next');
- LiveMovePost();
- }
- else if (PT==move.substr(nnum*4,4)) gotonum('Next');
- else if (PT==getvar('move_'+pMI[nnum+1]).substr(nnum*4,4))
- {
- gotonum('Next');
- if (sMI[nnum]!=pMI[nnum]) get_movetext(pMI[nnum],pMI[nnum]);
- }
- else
- {
- r=eval('/\[DhtmlXQ_move_('+pMI[nnum+1].split('_')[2]+'_'+(nnum+1)+'_\d+)\](\d{4}).*\[\/DhtmlXQ_move_\1\]/gi');
- m=UBB.match(r)||''.split('');
- for (i=0;i<m.length;i++)
- {
- if (m[i].replace(r,'$2')==PT)
- {
- gotonum('Next');
- if (sMI[nnum]!=m[i].replace(r,'$1')) get_movetext(pMI[nnum],m[i].replace(r,'$1'));
- }
- }
- }
- if (CSS) return;
- if (ev.length==4) //u65B0u53D8
- {
- r=/[(DhtmlXQ_move_d+_d+_(d+))].*[/1]/gi;
- m=UBB.match(r).join('n').replace(r,'0000000000$2_').replace(/0+(d{10})_/gi,'$1').split('n').sort();
- p=m.length-1;
- if (m[p]==p) i=p+1;
- else for (i=0;i<=p;i++) if (i!=m[i]-0) break;
- m=pMI[nnum+1].split('_')[2]+'_'+(nnum+1)+'_'+i;
- UBB+='rn[DhtmlXQ_move_'+m+']'+ev+'[/DhtmlXQ_move_'+m+']';
- gotonum('Next');
- get_movetext(pMI[nnum],m);
- }
- else VarAdd(PT,move_ev);
- }
- if (!CSS)
- {
- p='_'+p;
- if (p.indexOf(s2)>=0) p=p.replace(s2,'_99_').replace(s1,s2);
- else p=p.replace(s1,s2);
- DrawPOS(p.replace(/_/gi,''));
- if (isSP) auto_search();
- }
- }
- function VarAdd(m,cm)
- {
- v=document.getElementById('var_'+sMI[nnum]);
- r='<div id="div18"><a href=javascript:getMove("'+m+'")>u70B9u6B64u589Eu52A0u53D8u7740'+cm+'</a></div>';
- if (v!=null) v.innerHTML+=r;
- else if (nnum==0) VarDIV.innerHTML=r;
- else VarDIV.innerHTML+=r;
- }
- function auto_search()
- {
- if (parent.document.getElementById('auto_search')) eval(parent.document.getElementById('auto_search').value);
- if (parent.document.getElementById('auto_getpos')) eval(parent.document.getElementById('auto_getpos').value);
- }
- function UpData()
- {
- if (NoFile) self.name='NoFile_[DhtmlXQiFrame]'+UBB+'[/DhtmlXQiFrame]';
- else parent.document.getElementById(self.name.substr(5)).innerHTML=UBB;
- }
- function gotoMI(gMI)
- {
- gMI=gMI.split('_');
- var m=new Array();
- var r,i=0;
- if (gMI.length>1)
- {
- r=eval('/\[(DhtmlXQ_move_('+gMI[1]+'_'+gMI[2]+'_'+gMI[3]+'))\]\d{4}.*\[\/\1\]/gi');
- m[0]=UBB.match(r);
- while (m[i])
- {
- m[i]=m[i][0].replace(r,'$2');
- if (m[i]=='0_1_0') r='ok';
- if (i==400||m[i].search(/(d+)_d+_1$/gi)!=-1) break;
- r=eval('/\[(DhtmlXQ_move_(\d+_\d+_'+m[i].split('_')[0]+'))\]\d{4}.*\[\/\1\]/gi');
- i++;
- m[i]=UBB.match(r);
- }
- }
- if (r=='ok') while(i>0){gotonum(m[i-1].split('_')[1]);get_movetext(m[i],m[i-1]);i--;}
- gotonum((gMI[0]>lnum)?lnum:gMI[0]);
- if (gMI.length==9)
- {
- if (gMI[4]) turnBoard();
- if (gMI[5]) mirrorBoard();
- if (gMI[6].length==4) {r=getMovelistString(gMI[6],P[nnum]);if(r!=''){VarAdd(gMI[6],r);pClick=gMI[6];}};
- if (gMI[8].length==64) {
- CSS=false;DrawPOS(gMI[8]);
- if (gMI[7].length>0&&gMI[7]<32) {pCid=gMI[7];pClick+=gMI[8].substr(pCid*2,2);document.getElementById('z'+pCid).style.backgroundColor='#0f0';}
- }
- }
- }
- function gotonum(num)
- {
- canauto=false;
- var onum=nnum;
- if (num=='Next') Next();
- else if (num=='Prev') Prev();
- else if (num=='Last')
- {
- if (lnum-nnum>cnum) CSS=false;
- while (nnum<lnum) Next();
- }
- else if (num=='First')
- {
- num=(nnum>fnum)?fnum:0;
- if (nnum-num>cnum) CSS=false;
- while (nnum>num) Prev();
- }
- else if (nnum<num)
- {
- if (num-nnum>cnum) CSS=false;
- while (nnum<num) Next();
- }
- else if (nnum>num)
- {
- if (nnum-num>cnum) CSS=false;
- while (nnum>num) Prev();
- }
- M_GOTO(nnum,onum);
- if (!CSS) {CSS=true;DrawPOS(P[nnum]);pClick='';if(pCid>=0){document.getElementById('z'+pCid).style.backgroundColor='';pCid=-1;}}
- document.getElementById('shownow').value=nnum+'/'+lnum;
- ShowCommentText();
- ShowVarText();
- canauto=true;
- if (isSP&&nnum>0) auto_search();
- }
- function M_GOTO(n,o)
- {
- if (n==o) return;
- document.getElementById('move_'+o).style.backgroundColor='';
- document.getElementById('move_'+o).style.color='';
- document.getElementById('move_'+n).style.backgroundColor='#316AC5';
- document.getElementById('move_'+n).style.color='#FFF';
- if (o>n) {if ((Mscroll.scrollTop>(n-2)*16)||(Mscroll.scrollTop<(n-16)*16)) Mscroll.scrollTop=(n-1)*16;}
- else {if ((Mscroll.scrollTop<(n-14)*16)||(Mscroll.scrollTop>(n-1)*16)) Mscroll.scrollTop=(n-14)*16;}
- }
- function ShowCommentText()
- {
- document.getElementById('c_text').value=getvar('comment'+(sMI[nnum].split('_'))[2]+'_'+nnum);
- document.getElementById('c_scroll').scrollTop=0;
- }
- function ShowVarText()
- {
- if (nnum==0) VarDIV.innerHTML=ads_dpxq;
- else
- {
- var n=sMI[nnum].split('_');
- var p=pMI[nnum].split('_');
- var m=getvar('move_'+pMI[nnum]).substr((nnum-p[1])*4,4);
- var t='<div id="var_'+pMI[nnum]+'" onclick="get_movetext(''+pMI[nnum]+'',''+pMI[nnum]+'')"> 1.'+getMovelistString(m,P[nnum-1])+' '+havecomment(p[2],nnum)+'</div>';
- var mi,i;
- var r=eval('/\[(DhtmlXQ_move_('+p[2]+'_'+nnum+'_[1-9]\d*))\](\d{4}.*)\[\/\1\]/gi');
- var s=UBB.match(r);
- if (s!=null)
- {
- for (i=1;i<=s.length;i++)
- {
- m=s[i-1].replace(r,'$3').substr(0,4);
- mi=s[i-1].replace(r,'$2');
- t+=('rn<div id="var_'+mi+'" onclick="get_movetext(''+pMI[nnum]+'',''+mi+'')">');
- t+=(i<9)?' ':((i<99)?' ':'');
- t+=((i+1)+'.'+getMovelistString(m,P[nnum-1])+' '+havecomment((mi.split('_'))[2],nnum));
- t+='</div>';
- }
- }
- VarDIV.innerHTML=t;
- var v=document.getElementById('var_'+sMI[nnum]);
- if (v!=null)
- {
- v.style.backgroundColor='#316AC5';
- v.style.color='#FFF';
- v.innerHTML+=' <--';
- v=v.innerHTML.replace(/^.*(d+).*$/gi,'$1');
- document.getElementById('v_scroll').scrollTop=(v>3)?v*16-48:0;
- }
- }
- }
- function get_movetext(npMI,nsMI)
- {
- var nNUM=(nnum==0)?1:nnum;
- if (nsMI==sMI[nNUM]) return;
- var n=nsMI.split('_');
- var p=npMI.split('_');
- var m=getvar('move_'+nsMI).replace(/^(d*).*$/gi,'$1');
- if (m=='') return;
- else if (nsMI==pMI[nNUM]) m=m.substr((nNUM-n[1])*4);
- canauto=false;
- Prev();
- move=(move.substr(0,nnum*4)+m).match(/d{4}/gi).join('');
- var c_m=MoveDIV.innerHTML.match(/[^x00-xff]{4}/gi).join('').substr(0,nNUM*4)+getMovelistString(m,P[nnum]);
- var i,t='',j=parseInt(nNUM/2);
- lnum=move.length/4;
- for (i=nNUM;i<=lnum;i++)
- {
- sMI[i]=nsMI;
- pMI[i]=(i==nNUM)?npMI:nsMI;
- t+=('rn<div id="move_'+i+'" onmouseup="gotonum('+i+')">');
- if (i%2==1) {j++;t+=(j>=100)?(j+'.'):((j>=10)?(' '+j+'.'):(' '+j+'.'));}
- else t+=(' ');
- t+=(c_m.substr(i*4,4)+havecomment(n[2],i)+havevar((i==nNUM)?p[2]:n[2],i)+'</div>');
- }
- sMI=sMI.slice(0,lnum+1);
- pMI=pMI.slice(0,lnum+1);
- MoveDIV.innerHTML=MoveDIV.innerHTML.match(/<div.+</div>/gi).slice(0,nNUM).join('rn')+t;
- canauto=true;
- gotonum('Next');
- }
- function havecomment(nMI,nNUM)
- {
- return (UBB.search(eval('/\[(DhtmlXQ_comment'+nMI+'_'+nNUM+')\].+\[\/\1\]/gi'))==-1)?' ':'*';
- }
- function havevar(nMI,nNUM)
- {
- return (UBB.search(eval('/\[(DhtmlXQ_move_'+nMI+'_'+nNUM+'_[1-9]\d*)\]\d{4}.*\[\/\1\]/gi'))==-1)?' ':'m';
- }
- function HideMove()
- {
- MoveDIV.style.visibility=(MoveDIV.style.visibility=='hidden')?'inherit':'hidden';
- document.getElementById('hidemove').innerHTML=(document.getElementById('hidemove').innerHTML=='u9690u85CF')?'u663Eu793A':'u9690u85CF';
- }
- function DP(p,z)
- {
- p=conv_ev((100+p).toString().substr(1));
- document.getElementById('z'+z).style.left=p.substr(0,1)*qgdx;
- document.getElementById('z'+z).style.top=p.substr(1,1)*qgdx;
- }
- function Prev()
- {
- if ((nnum>0)&&(nnum<=lnum))
- {
- nnum--;
- var o=move.substr(nnum*4+2,2)-0;
- var n=move.substr(nnum*4,2)-0;
- P90[n]=P90[o];
- if (CSS) DP(n,P90[o]);
- if (D400[nnum+1]!=null)
- {
- if (CSS) DP(o,D400[nnum+1]);
- P90[o]=D400[nnum+1];
- D400[nnum+1]=null;
- cnum++;
- }
- else
- P90[o]=99;
- }
- }
- function Next()
- {
- if ((nnum>=0)&&(nnum<lnum))
- {
- var o=move.substr(nnum*4,2)-0;
- var n=move.substr(nnum*4+2,2)-0;
- var p=P[nnum].match(/dd/gi);
- nnum++;
- if (P90[n]!=99)
- {
- D400[nnum]=P90[n];
- if (CSS) DP(99,D400[nnum]);
- p[D400[nnum]]=99;
- cnum--;
- }
- P90[n]=P90[o];
- p[P90[o]]=(100+n).toString().substr(1);
- P[nnum]=p.join('');
- if (CSS) DP(n,P90[o]);
- P90[o]=99;
- }
- }
- function AutoPlay()
- {
- if (document.getElementById('autoplay').value=='u81EAu52A8')
- {
- document.getElementById('autoplay').value='u505Cu6B62';
- document.getElementById('autotime').style.display='';
- }
- else
- {
- document.getElementById('autoplay').value='u81EAu52A8';
- clearInterval(timer);
- }
- }
- function Autotimer(AutoHZ)
- {
- timer=setInterval('StopPlay();',AutoHZ);
- document.getElementById('autotime').style.display='none';
- }
- function StopPlay()
- {
- if ((nnum<lnum)&&canauto) gotonum('Next');
- else
- {
- clearInterval(timer);
- document.getElementById('autoplay').value='u81EAu52A8';
- }
- }
- function DrawPOS(p)
- {
- var i;
- p=conv_ev(p);
- for (i=0;i<32;i++)
- {
- document.getElementById('z'+i).style.left=(p.charAt(i*2)-0)*qgdx;
- document.getElementById('z'+i).style.top=(p.charAt(i*2+1)-0)*qgdx;
- }
- }
- function turnBoard()
- {
- canauto=false;
- var t=isTurn,m=isMirror;
- isTurn=true;isMirror=false;
- document.getElementById('turn_Board').style.color=(t)?'':'#f00';
- document.getElementById('bside').innerHTML=(t)?'uFF11uFF12uFF13uFF14uFF15uFF16uFF17uFF18uFF19':'u4E00u4E8Cu4E09u56DBu4E94u516Du4E03u516Bu4E5D';
- document.getElementById('rside').innerHTML=(t)?'u4E5Du516Bu4E03u516Du4E94u56DBu4E09u4E8Cu4E00':'uFF19uFF18uFF17uFF16uFF15uFF14uFF13uFF12uFF11';
- DrawPOS(getpos(1));
- isTurn=(t)?false:true;
- isMirror=m;
- canauto=true;
- }
- function mirrorBoard()
- {
- canauto=false;
- var t=isTurn,m=isMirror;
- isTurn=false;isMirror=true;
- document.getElementById('mirror_Board').style.color=(m)?'':'#f00';
- DrawPOS(getpos(1));
- isMirror=(m)?false:true;
- isTurn=t;
- canauto=true;
- }
- function swapColor()
- {
- canauto=false;
- var t,i;
- for (i=0;i<16;i++)
- {
- t=document.getElementById('z'+i).innerHTML;
- document.getElementById('z'+i).innerHTML=document.getElementById('z'+(i+16)).innerHTML;
- document.getElementById('z'+(i+16)).innerHTML=t;
- }
- canauto=true;
- }
- function ViewSource()
- {
- getUBB();
- document.getElementById('sourceText').style.display=(document.getElementById('sourceText').style.display=='none'?'':'none');
- document.getElementById('showsource').value=(document.getElementById('showsource').value=='u5BFCu51FA'?'u9690u85CF':'u5BFCu51FA');
- hideSearch();
- }
- function ViewSearch()
- {
- document.getElementById('searchText').style.display=(document.getElementById('searchText').style.display=='none'?'':'none');
- document.getElementById('showsearch').value=(document.getElementById('showsearch').value=='u68CBu8C31u641Cu7D22'?'u9690u85CFu641Cu7D22':'u68CBu8C31u641Cu7D22');
- hideSource();
- }
- function hideSearch()
- {
- document.getElementById('searchText').style.display='none';
- document.getElementById('showsearch').value='u68CBu8C31u641Cu7D22';
- }
- function hideSource()
- {
- document.getElementById('sourceText').style.display='none';
- document.getElementById('showsource').value='u5BFCu51FA';
- }
- function copycode(obj,t)
- {
- obj.select();
- var c=obj.createTextRange();
- if (c!=null)
- {
- c.execCommand("Copy");
- if (!t) showalert('u590Du5236u4EE3u7801u6210u529FuFF0Cu53EFu4EE5u7C98u8D34u5C40u9762u5230u8F6Fu4EF6u4E2DuFF0Cu6216u53D1u8868u68CBu8C31u5230u7F51u7AD9u8BBAu575Bu4E2D');
- }
- else showalert('u975EIEu5185u6838u6D4Fu89C8u5668u5982u679Cu6CA1u590Du5236u6210u529Fu8BF7u624Bu52A8u590Du5236uFF0Cu53CCu51FBu53EFu5168u9009u68CBu8C31u4EE3u7801');
- }
- function getpos(t)
- {
- var p=new Array(),i;
- for (i=0;i<32;i++) p[i]=(parseInt(document.getElementById('z'+i).style.left)/qgdx+''+parseInt(document.getElementById('z'+i).style.top)/qgdx);
- if (t) return p.join('');
- if (isTurn) {for (i=0;i<32;i++) if (p[i]!='99') p[i]=(189-p[i]).toString().substr(1);}
- return p;
- }
- function SearchP(t)
- {
- var p=getpos().join('');
- if (isSP) {var d=parent.search_diy.document.s;d.e.value='';d.p.value=p+t;d.submit();}
- else PostData('&p='+p+t,'');
- }
- function SearchRB(s)
- {
- var s=getvar(s).split(' ');
- var r='';
- if (s.length==3) r=s[1];
- else if (s.length==2) r=(s[1].search(/(.*)/gi)==-1)?s[1]:s[0];
- else if (s.length==1) r=(s[0].search(/(.*)/gi)==-1)?s[0]:s[0].replace(/(.*)/gi,'');
- if (isSP) {var d=parent.search_diy.document.s;d.red.value=r;d.black.value=r;d.submit();}
- else PostData('&red='+r+'&black='+r,'');
- }
- function SearchE()
- {
- var p=getpos();
- var n=new Array(1,2,4,5,0,5,4,2,1,3,3,6,6,6,6,6,7,8,10,11,0,11,10,8,7,9,9,12,12,12,12,12);
- var t='0000000000000'.split('');
- for (i=0;i<32;i++){if (p[i]<90) t[n[i]]++;}
- t=t.join('8').substr(2);
- if (isSP) {var d=parent.search_diy.document.s;d.e.value=t;d.submit();}
- else PostData('&e='+t,'');
- }
- function EditSave()
- {
- PostData('','&isSave=yes');
- }
- function PostData(s,f)
- {
- var m=VarDIV.innerHTML.match(/getMove(.d{4}.)/gi);
- m=(m==null)?'':(m[0].match(/d{4}/gi)[0]);
- document.DhtmlXQ_search.ubb.value=conv(get_arg());
- document.DhtmlXQ_search.s.value='?site='+location.hostname+s;
- document.DhtmlXQ_search.f.value=nnum+'_'+sMI[nnum]+((isTurn)?'_1':'_')+((isMirror)?'_1':'_')+'_'+m+((pCid>=0)?('_'+pCid):'_')+((CSS)?'_':('_'+conv_ev(getpos(1))))+f;
- document.DhtmlXQ_search.submit();
- }
- function get_arg()
- {
- return ('[DhtmlXQ]rn'+UBB.replace(/DhtmlXQ_move_0_1_0/gi,'DhtmlXQ_movelist').replace(/DhtmlXQ_comment0_/gi,'DhtmlXQ_comment').replace(/[(DhtmlXQ_(refer|generator|viewurl|liveadmin))][wW]*[/1]/gi,'')+'rn[DhtmlXQ_refer]'+refer+'[/DhtmlXQ_refer]rn[DhtmlXQ_generator]www.dpxq.com[/DhtmlXQ_generator]rn[/DhtmlXQ]').replace(/[rn]+/gi,'rn');
- }
- function getUBB()
- {
- sText.value=get_arg();
- }
- function getHTML()
- {
- var ID=parseInt(Math.random()*10000,10);
- sText.value='<div id="dhtmlxq_'+ID+'" style="display:none;">rn'+get_arg().replace(/([/?DhtmlXQ)]/g,'$1HTML]')+'rnu68CBu8C31u7531<a href="http://www.dpxq.com/hldcg/dhtmlxq/" target="_blank">http://www.dpxq.com/hldcg/dhtmlxq/</a>u751Fu6210rn</div>rn<iframe src="/DhtmlXQ_www_dpxq_com/DhtmlXQ_www_dpxq_com'+isBIG5+'.htm" name="name_dhtmlxq_'+ID+'" id="id_dhtmlxq_'+ID+'" width="500" height="350" frameborder="0" allowTransparency="true" bgcolor="transparent" scrolling="no" marginwidth="0" marginheight="0"></iframe>';
- }
- function getIFRAME()
- {
- sText.value='<iframe src="http://www.dpxq.com/DhtmlXQ_www_dpxq_com/DhtmlXQ_www_dpxq_com'+isBIG5+'.htm" frameborder="0" scrolling="no" width="500" height="350" marginwidth="0" marginheight="0" name='NoFile_rn'+get_arg().replace(/([/?DhtmlXQ)]/g,'$1iFrame]').replace(/[']/gi,'"')+''></iframe>';
- }
- function getBLOG()
- {
- var s=ViewUrl.match(/owner=.+&id=d{1,9}/gi);
- if (s==null) sText.value='u3000u3000u672Cu4EE3u7801u662Fu7528u5728u652Fu6301u6846u67B6(IFRAME)u7684u535Au5BA2(u65B0u6D6Au535Au5BA2)u3001u7F51u7AD9u6216u8BBAu575Bu4E2Du7684u4EE3u7801uFF0Cu9700u8981u7528u6E90u4EE3u7801u65B9u5F0Fu6DFBu52A0u3002nu3000u3000u53EAu6709u4FDDu5B58u5728u4E1Cu840Du68CBu8C31u4ED3u5E93u4E2Du7684u68CBu8C31u624Du53EFu5BFCu51FAu672Cu4EE3u7801uFF0Cu8BF7u6CE8u518Cu5E76u767Bu9646u68CBu8C31u4ED3u5E93';
- else sText.value='<iframe src="http://www.dpxq.com/hldcg/chess/view.htm?'+s[0]+'" allowtransparency="true" bgcolor="transparent" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="500" height="350"></iframe>';
- }
- function getTEXT(v)
- {
- var r=getvar('redrating');
- var b=getvar('blackrating');
- r=(r=='0')?'':r;
- b=(b=='0')?'':b;
- var t=('u6807u9898: '+getvar('title')+'rnu5206u7C7B: '+getvar('class')+'rnu8D5Bu4E8B: '+getvar('event')+'rnu8F6Eu6B21: '+getvar('round')+'rnu65E5u671F: '+getvar('date')+'rnu5730u70B9: '+getvar('place')+'rnu5E03u5C40: '+getvar('open')+'rnu7EA2u65B9: '+getvar('red')+'rnu9ED1u65B9: '+getvar('black')+'rnu7ED3u679C: '+getvar('result').replace('u7EA2u80DC','u7EA2u65B9u80DC').replace('u9ED1u80DC','u9ED1u65B9u80DC')+'rnu8BC4u8BBA: '+getvar('remark')+'rnu4F5Cu8005: '+getvar('author')+'rnu5907u6CE8: '+getvar('other')+'rnu7ED3u675Fu65B9u5F0F: '+getvar('endtype')+'rnu8BB0u65F6u89C4u5219: '+getvar('timerule')+'rnu7EA2u65B9u7528u65F6: '+getvar('redtime')+'rnu9ED1u65B9u7528u65F6: '+getvar('blacktime')+'rnu7EA2u7B49u7EA7u5206: '+r+'rnu9ED1u7B49u7EA7u5206: '+b+'rnu68CBu5C40u7C7Bu578B: '+getvar('type')+'rnu68CBu5C40u6027u8D28: '+getvar('gametype')+'rnu68CBu8C31u4E3Bu4EBA: '+getvar('owner')+'rnu68CBu8C31u4EF7u503C: '+getvar('price')+'rnu6D4Fu89C8u6B21u6570: '+getvar('hits')+'rnu6765u6E90u7F51u7AD9: '+unescape(getvar('refer')).split('r')[0]).replace(/<[x00-xff][^>]*>/gi,'');
- var s='u68CBu8C31u7531 http://dhtmlxq.dpxq.com/ u751Fu6210';
- if (v=='100')
- {
- var m=MoveDIV.innerHTML.replace(/<[^>]*>|r|n/gi,'').replace(/ /gi,' ').substr(9).replace(/(.{10,20})/gi,'$1rn');
- var f=(CP(P[0])=='8979695949392919097717866646260600102030405060708012720323436383')?'':('u521Du59CBu5C40u9762:n'+getIMGTEXT('binit')+'n');
- sText.value=t+'rnrn'+f+m+'rn'+s;
- if (w1==494) m=m.replace(/(.*)rn(.*)rn/gi,'$1 $2rn');
- document.getElementById('showText').value=t+'rnrn'+f+m+'rn'+s;
- }
- else
- {
- sText.value=s;
- document.getElementById('showText').value=s;
- }
- }
- function getIMGTEXT(t)
- {
- var t1='ababababuFF3CbuFF0FbabababaababababuFF0FbuFF3Cbabababaabababababababababaabababababababababaabaaaaaaaaaaaaaaaba'.replace(/a/gi,'u3000').replace(/b/gi,'u2502').match(/.{19}/gi);
- t1[5]=t1[2];t1[6]=t1[2];t1[7]=t1[0];t1[8]=t1[1];t1[9]='';
- var t2=' u250C-aaaaaaa-u2510 fdbbb-u203B-bbbefdbbbbbbbefdbbbbbbbefdcccccccefdaaaaaaaefdbbbbbbbefdbbbbbbbefdbbb-u203B-bbbef u2514-ccccccc-u2518 f';
- t2=t2.replace(/f/gi,'xxx').replace(/a/gi,'-u252C-').replace(/b/gi,'-u253C-').replace(/c/gi,'-u2534-').replace(/d/gi,' u251C-').replace(/e/gi,'-u2524 ').match(/(.{3})/gi);
- var t3=qztxt.join('n').replace(/.+rt"?>(.)<.+/gi,'($1)').replace(/.+bt"?>(.)<.+/gi,'[$1]').match(/.../gi);
- var p=(t=='binit')?P[0].match(/dd/gi):getpos();
- for (i=0;i<32;i++) t2[(p[i].substr(1,1)+''+p[i].substr(0,1)-0)]=t3[i];
- t2[99]='';t2=t2.join('').split('xxx');
- var s='aaaaaaaa u9ED1u65B9aaaaaaaa rnaaaaaaaaaaaaaaaaaaa';
- for (i=0;i<10;i++) s+='rn '+t2[i]+' rn'+t1[i];
- s+='aaaaaaaaaaaaaaaaaaarnaaaaaaaa u7EA2u65B9aaaaaaaa rn';
- s=s.replace(/( |a)/gi,'u3000').replace(/--/gi,'u2500').replace(/u4ED5/gi,'u58EB');
- if (t=='xqstudio') {sText.value=s;copycode(sText,1);}
- else if (t=='binit') return s;
- else sText.value=s;
- }
- function getFENTEXT(t)
- {
- var p=getpos();
- var b='RNBAKABNRCCPPPPPrnbakabnrccppppp'.split('');
- var f=' '.replace(/ /gi,'111111111/').split('');
- for (i=0;i<32;i++) f[(p[i].substr(1,1)+''+p[i].substr(0,1))-0]=b[i];
- f=f.join('').substr(0,99).replace(/111111111/g,'9').replace(/11111111/g,'8').replace(/1111111/g,'7').replace(/111111/g,'6').replace(/11111/g,'5').replace(/1111/g,'4').replace(/111/g,'3').replace(/11/g,'2');
- f+=(nnum%2==1)?'/ b':'/ r';
- sText.value=f;
- if (t!=null) copycode(sText,1);
- }
- function getXQSJTEXT(t)
- {
- var b='11 12 13 14 15 9 10 1 7 0 8 2 6 3 5 4 27 28 29 30 31 25 26 17 23 16 24 18 22 19 21 20'.split(' ');
- var s='';
- var p=getpos();
- for (i=0;i<32;i++) s+=(p[b[i]]==99)?'0 ':(52+16*(p[b[i]].substr(1,1)-0)+(p[b[i]].substr(0,1)-0)+' ');
- s+=(nnum%2==1)?'+B':'+R';
- sText.value=s;
- if (t!=null) copycode(sText,1);
- }
- function getSEARCH()
- {
- document.getElementById('search_Text').innerHTML='<input type="button" value="u641Cu7D22u4E0Eu68CBu76D8u5269u4F59u5B50u529Bu76F8u540Cu7684u5BF9u5C40" onclick="SearchE()"> <span style="color:#f00;">u590Du5236u5C40u9762u4E32</span><br><input type="button" value="u641Cu7D22u4E0Eu5F53u524Du68CBu76D8u5C40u9762u76F8u540Cu7684u5BF9u5C40" onclick="SearchP('next')"> <a href="javascript:getXQSJTEXT('xqsj')">u8C61u68CBu4E16u5BB6</a><br><input type="button" value="u641Cu7D22u5F53u524Du5C40u9762u7684u6240u6709u53D8u7740u53CAu7EDFu8BA1" onclick="SearchP('tnew')"> <a href="javascript:getIMGTEXT('xqstudio')">u8C61u68CBu6F14u64ADu5BA4</a><br><input type="button" value="u641Cu7D22u7EA2u65B9u68CBu624Bu7684u6240u6709u5BF9u5C40" onclick="SearchRB('red')"> <a href="javascript:getFENTEXT('xqqb')">u5947u5175u5927u5723</a><br><input type="button" value="u641Cu7D22u9ED1u65B9u68CBu624Bu7684u6240u6709u5BF9u5C40" onclick="SearchRB('black')"> <span style="color:#f00;">u5230u526Au8D34u677Fu4E2D</span><br><br><div style="width:245px;">u3000u3000<a href="http://www.dpxq.com/hldcg/shop/vip.htm" target="_blank" style="color:#00f;">u68CBu8C31u4ED3u5E93u62E5u6709u68CBu8C31u767Eu4E07uFF0Cu662F<span style="color:#f00;">u6781u5F3Au5927u7684u8C61u68CBu5F00u5C40u5E93</span>uFF0Cu53EFu505Au4E3Au8C61u68CBu5F00u5C40u8F85u52A9u8F6Fu4EF6uFF0Cu5E76u53EFu4E3Au7814u7A76u68CBu8C31u548Cu5BF9u624Bu63D0u4F9Bu8BE6u7EC6u8D44u6599u3002u767Eu4E07u68CBu8C31uFF0Cu63A2u7D22u5E03u5C40u6DF1u5C42u53D8u5316uFF01u6253u8C31u590Du76D8uFF0Cu5206u6790u81EAu5DF1u5BF9u5C40u5F97u5931u53D8u7740u7EDFu8BA1uFF0Cu5F08u5929u780Du4EBAu6700u4F73u5E2Eu51F6uFF01<br>u3000u3000VIPu4F1Au5458u6BCFu5E74100u5143u62163000u70B9uFF0Cu5F08u5929u4E1Cu90AAu8054u7CFB<span style="color:#f00;">u7535u8BDD13898991761 QQ:88081492 u65FAu65FA:hldcg</span></a><br>u52A8u6001u68CBu76D8u751Fu6210u9875u9762 <a href="http://dhtmlxq.dpxq.com" target="_blank" style="color:#00f;">http://dhtmlxq.dpxq.com</a></div>';
- }
- function EditComment()
- {
- var c=document.getElementById('c_text').value.replace(/s+$/gi,'').replace(/ /gi,'u3000').replace(/</?[a-z][^>n]*>/gi,'').replace(/[/?DhtmlXQ(_w+)?]/gi,'').replace(/r?n/gi,'||');
- var n=sMI[nnum].split('_');
- var r=eval('/\[(DhtmlXQ_comment'+n[2]+'_'+nnum+')\].*\[\/\1\]/gi');
- UBB=UBB.replace(r,'');
- if (c!='') UBB+='[DhtmlXQ_comment'+n[2]+'_'+nnum+']'+c+'[/DhtmlXQ_comment'+n[2]+'_'+nnum+']';
- var m=document.getElementById('move_'+nnum).innerHTML.replace(/ /gi,' ');
- document.getElementById('move_'+nnum).innerHTML=(m.substr(0,8)+havecomment(n[2],nnum)+m.substr(9)).replace(/ /gi,' ');
- UpData();
- if (nnum<1) return;
- var m=document.getElementById('var_'+sMI[nnum]).innerHTML.replace(/ /gi,' ');
- if (m.substr(0,1)!='<') document.getElementById('var_'+sMI[nnum]).innerHTML=(m.substr(0,9)+havecomment(n[2],nnum)+m.substr(10)).replace(/ /gi,' ');
- }
- function conv(s)
- {
- return unescape(escape(s).replace(/%u([0-9A-F]{4})/gi,'\u$1'));
- }
- function unconv(s)
- {
- return unescape(escape(s).replace(/%(5C|5F|25)u([0-9A-F]{4})/gi,'%u$2'));
- }
- function getrefer()
- {
- var r=getvar('refer').split('%0D%0A');
- var rer=unescape(r[0]).replace('http://','').replace(/</?w+>/gi,'');
- if (r.length==2) var rer_url=unescape(r[1]).replace('http://','').replace(/</?w+>/gi,'');
- else var rer_url=(isSP)?'www.dpxq.com/bbs':'www.dpxq.com/hldcg/search';
- rer=(rer!='')?('http://'+rer):('http://www.dpxq.com');
- rer_url=(rer_url!='')?('http://'+rer_url):('http://www.dpxq.com/bbs');
- return ('<nobr>u6765u6E90u7F51u7AD9uFF1A<a href="'+rer+'" style="color:#000;" target="_blank">'+rer+'</a></nobr><br><nobr>u53C2u4E0Eu8BA8u8BBAuFF1A<a href="'+rer_url+'" style="color:#000;" target="_blank">'+rer_url+'</a></nobr>');
- }
- function getMovelistString(m0,p0)
- {
- var i,t=99,ms='';
- var p=' '.replace(/ /gi,' ').replace(/ /gi,'99').match(/dd/gi);
- var b='0000000000'.replace(/0/gi,'000000000').split('');
- var s='abcdedcbaffgggggABCDEDCBAFFGGGGG'.split('');
- if (p0=='') p0='8979695949392919097717866646260600102030405060708012720323436383';
- p0=p0.match(/d{2}/gi);
- for (i=0;i<32;i++) {p[p0[i]-0]=i;b[p0[i]-0]=s[i];}
- var m=m0.match(/d{4}/gi);
- if (m==null) return '';
- var ml=m.length;
- for (i=0;i<ml;i++)
- {
- t=p[m[i].substr(0,2)-0];
- if ((t>=0)&&(t<=15)) ms+=c_move(getMoveText(m[i],p,0));//0u7EA2
- else if ((t>=16)&&(t<=31)) ms+=c_move(getMoveText(m[i],p,1));//1u9ED1
- else break;
- p[m[i].substr(2,2)-0]=p[m[i].substr(0,2)-0];
- p[m[i].substr(0,2)-0]=99;
- b[m[i].substr(2,2)]=b[m[i].substr(0,2)];
- b[m[i].substr(0,2)]=99;
- }
- return ms;
- }
- function c_move(m)
- {
- var b='u8F66u9A6Cu76F8u8C61u4ED5u58EBu5E05u5C06u70AEu3000u3000u3000u3000u3000u3000u3000u5175u5352u4E00uFF11u4E8CuFF12u4E09uFF13u56DBuFF14u4E94uFF15u516DuFF16u4E03uFF17u516BuFF18u4E5DuFF19u524Du4E2Du540Eu8FDBu9000u5E73';
- var s='',n,x;
- for (x=0;x<4;x++) {n=m.charCodeAt(x)-49;s+=b.charAt(n);}
- return s;
- }
- function getMoveText(s,p,b)
- {
- var tP,m,i,I=' ';
- var f='12357532199AAAAA12468642199BBBBB';
- var r='CDEFGHIJKLMNOPQRST';
- var fC=s.charAt(0)-0;
- var fR=s.charAt(1)-0;
- var tC=s.charAt(2)-0;
- var tR=s.charAt(3)-0;
- var fP=f.charAt(p[s.substr(0,2)-0]);
- if (b==0)
- {
- m=fP+r.charAt((8-fC)*2);
- if ((fP=='1')||(fP=='2')||(fP=='9')||(fP=='A'))
- {
- for (i=0;i<=9;i++) {tP=p[fC*10+i]; if ((tP<16)&&(f.charAt(tP)==fP)) I+=i;}
- if (I.length==3) m=' UW'.charAt(I.indexOf(fR))+fP;
- else if (I.length==4) m=' UVW'.charAt(I.indexOf(fR))+fP;
- else if (I.length==5) m=' UEGW'.charAt(I.indexOf(fR))+fP;
- else if (I.length==6) m=' UEGIW'.charAt(I.indexOf(fR))+fP;
- }
- if (fR==tR) m+='Z'+r.charAt((8-tC)*2);
- else if (fR>tR) m+='X'+r.charAt(((fP>1)&&(fP<7))?((8-tC)*2):((fR-tR-1)*2+b));
- else m+='Y'+r.charAt(((fP>1)&&(fP<7))?((8-tC)*2):((tR-fR-1)*2+b));
- }
- else
- {
- m=fP+r.charAt(fC*2+b);
- if ((fP=='1')||(fP=='2')||(fP=='9')||(fP=='B'))
- {
- for (i=0;i<=9;i++) {tP=p[fC*10+i]; if ((tP>15)&&(tP<32)&&(f.charAt(tP)==fP)) I+=i;}
- if (I.length==3) m=' WU'.charAt(I.indexOf(fR))+fP;
- else if (I.length==4) m=' WVU'.charAt(I.indexOf(fR))+fP;
- else if (I.length==5) m=' WGEU'.charAt(I.indexOf(fR))+fP;
- else if (I.length==6) m=' WIGEU'.charAt(I.indexOf(fR))+fP;
- }
- if (fR==tR) m+='Z'+r.charAt(tC*2+b);
- else if (fR>tR) m+='Y'+r.charAt(((fP>1)&&(fP<7))?(tC*2+b):((fR-tR-1)*2+b));
- else m+='X'+r.charAt(((fP>1)&&(fP<7))?(tC*2+b):((tR-fR-1)*2+b));
- }
- return m;
- }
- function LiveMain()
- {
- xmlok=0;
- LiveMove='';
- LiveUpMove='';
- LiveMoveLen=0;
- AllowLive=false;
- LiveAdmin=getvar('liveadmin');
- LiveID=getvar('liveid').replace(/D/gi,'').replace(/^0+/gi,'');
- var url=location.href.search(/(localhost|dpxq.com)/hldcg/search/DhtmlXQ_www_dpxq_com.htm$/gi);
- var s='u5BF9u4E0Du8D77uFF0Cu60A8u7684u6D4Fu89C8u5668u4E0Du652Fu6301xmlhttpu7EC4u4EF6uFF0Cu8BF7u4F7Fu7528u65B0u7248u672Cu6D4Fu89C8u5668uFF0Cu4F8Bu5982MSIE6.0uFF01';
- try {xmlok=new ActiveXObject('Msxml2.XMLHTTP');xmlok=1;}
- catch (e0) {try {xmlok=new ActiveXObject('Microsoft.XMLHTTP');xmlok=2;}
- catch (e1) {try {xmlok=new XMLHttpRequest();xmlok=3;}
- catch (e2) {xmlok=0;showalert(s);LiveAdmin=false;return;}}}
- if (LiveID=='') LiveAdmin=false;
- else if (LiveAdmin=='yes'&&url!=-1)
- {
- LiveAdmin=true;
- LiveMoveLen=lnum;
- LiveMove=move;
- AllowLive=true;
- }
- else
- {
- LiveAdmin=false;
- AllowLive=true;
- LiveMoveLen=lnum;
- LiveMove=move;
- if (url!=-1) {LiveAuto();return;}
- showalert('<input type="button" onclick="location.href=''+SURL+'../chess/view.htm?owner=u&id='+LiveID+''" style="font-size:36px;line-height:48px;top:6px;left:85px;width:230px;height:60px;" value="u8FDBu5165u76F4u64ADu5BA4">');
- document.getElementById('cancel').value='u53D6u6D88';
- }
- }
- function LiveAuto()
- {
- Livetimer=setInterval('getLiveMove()',1000);
- Livetime=setInterval('AutoLiveMove()',100);
- }
- function LiveHttp()
- {
- var x=false;
- if (xmlok==1) x=new ActiveXObject('Msxml2.XMLHTTP');
- else if (xmlok==2) x=new ActiveXObject('Microsoft.XMLHTTP');
- else if (xmlok==3) x=new XMLHttpRequest();
- return x;
- }
- function getLiveMove()
- {
- if (!AllowLive) return;
- var xmlhttp=LiveHttp();
- if (!xmlhttp) return;
- xmlhttp.open('GET','/hldcg/search/liveget.asp?rand='+Math.random()+'&id='+LiveID,true);
- xmlhttp.onreadystatechange=function(){if ((xmlhttp.readyState==4)||(xmlhttp.readyState=='complete')) {if (xmlhttp.status==200) {LiveUpMove=xmlhttp.responseText;LiveMoveGet();}}}
- xmlhttp.send(null);
- }
- function LiveMoveGet()
- {
- if (!AllowLive) return;
- LiveUpMove=LiveUpMove.match(/d{4}/gi);
- if (LiveUpMove==null)
- {
- LiveMoveLen=0;
- LiveMove='';
- return;
- }
- var i=0;
- while (LiveMove.substr(i*4,4)==LiveUpMove[i]) i++;
- if (i<LiveMoveLen)
- {
- LiveMoveLen=i;
- LiveMove=LiveUpMove.slice(0,i).join('');
- }
- else
- {
- LiveMoveLen=LiveUpMove.length;
- LiveMove=LiveUpMove.join('');
- }
- }
- function AutoLiveMove()
- {
- if ((AllowLive)&&(nnum==lnum))
- {
- if (LiveMoveLen>lnum) getMove(LiveMove.substr(nnum*4,4));
- else if (LiveMoveLen<lnum) DelMove(LiveMoveLen);
- }
- }
- function LiveMovePost()
- {
- if (LiveAdmin&&(nnum==lnum))
- {
- AllowLive=false;
- LiveMoveLen=lnum;
- LiveMove=move;
- document.getElementById('c_text').value='u6B63u5728u66F4u65B0';
- var postdata='id='+LiveID+'&move='+move;
- var xmlhttp=LiveHttp();
- if (!xmlhttp) return;
- xmlhttp.open('POST','/hldcg/search/livepost.asp',true);
- xmlhttp.onreadystatechange=function(){if ((xmlhttp.readyState==4)||(xmlhttp.readyState=='complete')) {if (xmlhttp.status==200) {document.getElementById('c_text').value=unescape(xmlhttp.responseText);AllowLive=true;}}}
- xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
- xmlhttp.send(postdata);
- AllowLive=true;
- }
- }
- function UpMove()
- {
- var v=VarDIV.innerHTML;
- var r=eval('/<div.+var_(\d+_\d+_\d+).+>.*(\d{1,3})\.[^<]+/gi');
- var s=v.match(r);
- var i,m=new Array();
- var l=(s==null)?0:(s.length);
- if (l<=1) return;
- for(i=0;i<l;i++)
- {
- m[i]=s[i].replace(r,'$1');
- if (sMI[nnum]==m[i]) break;
- }
- if (i==0) showalert('u4E3Bu7740u6CD5u4E0Du80FDu63D0u5347');
- else if (i==l) ;
- else if (i==1)
- {
- s=getvar('move_'+m[0]);
- m[0]=m[0].split('_');
- m[2]=s.substr(0,(nnum-m[0][1])*4);
- m[3]=s.substr((nnum-m[0][1])*4);
- s=getvar('move_'+m[1]);
- m[1]=m[1].split('_');
- m[2]+=''+s;
- r=eval('/\[(DhtmlXQ_move_'+m[1][2]+'_\d+_(\d+))\].*\[\/\1\]/gi');
- m[4]=UBB.match(r);
- if (m[4]==null) m[4]='';
- else
- {
- UBB=UBB.replace(r,'');
- m[4]=eval('m[4].join("\r\n").replace(/DhtmlXQ_move_'+m[1][2]+'/gi,"DhtmlXQ_move_'+m[0][2]+'")');
- }
- UBB=eval('UBB.replace(/\[(DhtmlXQ_comment'+m[1][2]+'(_\d+))\](.*)\[\/\1\]/gi,"[DhtmlXQ_comment\t$2]$3[/DhtmlXQ_comment\t$2]")');
- l=parseInt(m[3].length/4);
- for (i=0;i<l;i++)
- {
- if (i>0) UBB=eval('UBB.replace(/\[(DhtmlXQ_move_'+m[0][2]+'(_'+(nnum+1+i)+'_\d+))\](.*)\[\/\1\]/gi,"[DhtmlXQ_move_'+m[1][2]+'$2]$3[/DhtmlXQ_move_'+m[1][2]+'$2]")');
- UBB=eval('UBB.replace(/\[(DhtmlXQ_comment'+m[0][2]+'(_'+(nnum+i)+'))\](.*)\[\/\1\]/gi,"[DhtmlXQ_comment'+m[1][2]+'$2]$3[/DhtmlXQ_comment'+m[1][2]+'$2]")');
- }
- UBB=eval('UBB.replace(/\[(DhtmlXQ_comment\t(_\d+))\](.*)\[\/\1\]/gi,"[DhtmlXQ_comment'+m[0][2]+'$2]$3[/DhtmlXQ_comment'+m[0][2]+'$2]")');
- m[0]=m[0].join('_');m[1]=m[1].join('_');
- for (i=nnum;sMI[i]==m[1];i++) {sMI[i]=m[0];pMI[i]=m[0];}
- if (pMI[i]==m[1])
- {
- m[6]=sMI[i];m[7]=sMI[i].replace(m[1].split('_')[2]+'_',m[0].split('_')[2]+'_');
- pMI[i]=m[0];sMI[i]=m[7];
- for (i++;(sMI[i]==m[6]);i++) {sMI[i]=m[7];pMI[i]=m[7];}
- if (pMI[i]==m[6]) pMI[i]=m[7];
- }
- r=eval('/\[(DhtmlXQ_move_'+m[0]+')\].*\[\/\1\]/gi');
- UBB=UBB.replace(r,'[$1]t[/$1]').replace('t',m[2]);
- r=eval('/\[(DhtmlXQ_move_'+m[1]+')\].*\[\/\1\]/gi');
- UBB=UBB.replace(r,'[$1]t[/$1]').replace('t',m[3]);
- UBB=UBB+m[4];
- UpData();
- ShowVarText();
- }
- else
- {
- s=getvar('move_'+m[i]);
- UBB=UBB.replace(eval('/\[(DhtmlXQ_move_'+m[i]+')\](.*)\[\/\1\]/gi'),'').replace(eval('/\[(DhtmlXQ_move_'+m[i-1]+')\](.*)\[\/\1\]/gi'),'t[$1]$2[/$1]').replace('t','[DhtmlXQ_move_'+m[i]+']'+s+'[/DhtmlXQ_move_'+m[i]+']');
- UpData();
- ShowVarText();
- }
- }
- function DownMove()
- {
- var v=VarDIV.innerHTML;
- var r=eval('/<div.+var_(\d+_\d+_\d+).+>.*(\d{1,3})\.[^<]+/gi');
- var s=v.match(r);
- var i,m=new Array();
- var l=(s==null)?0:(s.length);
- if (l<=1) return;
- for(i=l-1;i>=0;i--)
- {
- m[i]=s[i].replace(r,'$1');
- if (sMI[nnum]==m[i]) break;
- }
- if (i==-l) ;
- else if (i==l-1) showalert('u6700u540Eu4E00u4E2Au53D8u7740u4E0Du80FDu964Du4F4E');
- else if (i==0)
- {
- m[1]=s[1].replace(r,'$1');
- get_movetext(m[0],m[1]);
- UpMove();
- get_movetext(m[0],m[1]);
- }
- else
- {
- s=getvar('move_'+m[i]);
- UBB=UBB.replace(eval('/\[(DhtmlXQ_move_'+m[i]+')\](.*)\[\/\1\]/gi'),'').replace(eval('/\[(DhtmlXQ_move_'+m[i+1]+')\](.*)\[\/\1\]/gi'),'[$1]$2[/$1]t').replace('t','[DhtmlXQ_move_'+m[i]+']'+s+'[/DhtmlXQ_move_'+m[i]+']');
- UpData();
- ShowVarText();
- }
- }
- function DelMove(num)
- {
- if (num==null) num=nnum;
- num=(num==lnum)?(num-1):num;
- if (num<0||num>lnum) return;
- var i,r,MI;
- AllowLive=false;
- canauto=false;
- if (sMI[nnum]!=pMI[nnum])
- {
- DelTree(sMI[nnum]);
- get_movetext(pMI[nnum],pMI[nnum]);
- UpData();
- }
- else if (MoveDIV.innerHTML.replace('move_'+(num+1),'|').split('|')[1].search(/m</div>/gi)!=-1)
- showalert('u6B64u53D8u662Fu4E3Bu7740u6CD5uFF0Cu8BF7u5148u5220u9664u672Cu6B65u4E4Bu540Eu7684u9644u5C5Eu53D8u7740');
- else
- {
- gotonum(num);
- r=sMI[nnum].split('_')[2];
- for (i=num+1;i<=lnum;i++) UBB=UBB.replace(eval('/\[(DhtmlXQ_comment'+r+'_'+i+')\](.*)\[\/\1\]/gi'),'');
- lnum=nnum;
- move=move.substr(0,nnum*4);
- document.getElementById('shownow').value=nnum+'/'+lnum;
- MoveDIV.innerHTML=MoveDIV.innerHTML.match(/<div.+</div>/gi).slice(0,nnum+1).join('rn');
- sMI=sMI.slice(0,nnum+1);
- pMI=pMI.slice(0,nnum+1);
- r=eval('/\[(DhtmlXQ_move_'+sMI[nnum]+')\](.*)\[\/\1\]/gi');
- MI=getvar('move_'+sMI[nnum]).substr(0,(nnum-(sMI[nnum].split('_')[1]-1))*4);
- if (MI==''&&sMI[nnum]!='0_1_0') UBB=UBB.replace(r,'');
- else UBB=UBB.replace(r,'[$1]MOVE[/$1]').replace('MOVE',MI);
- UpData();
- LiveMovePost();
- }
- AllowLive=true;
- canauto=true;
- }
- function DelTree(nMI)
- {
- var r=eval('/\[DhtmlXQ_move_('+(nMI.split('_'))[2]+'_\d+_[1-9]\d*)\].*\[\/DhtmlXQ_move_\1\]/gi');
- var i,MI=UBB.match(r);
- if (MI!=null) for (i=0;i<MI.length;i++) DelTree(MI[i].replace(r,'$1'));
- r=eval('/\[(DhtmlXQ_move_'+nMI+'|DhtmlXQ_comment'+nMI.split('_')[2]+'_\d+)\].*\[\/\1\]/gi');
- UBB=UBB.replace(r,'');
- }
- if (isSP)
- document.write('<script type="text/javascript" src="DhtmlXQ_www_dpxq_com_save.js"></script>');
- else
- {
- if (document.getElementById('divs')) {initboard();initdata();}
- else setTimeout('initboard();initdata();',10);
- }