-
Notifications
You must be signed in to change notification settings - Fork 0
/
XQScript.js
2518 lines (2514 loc) · 116 KB
/
XQScript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var isBIG5='';
var PVer='110717';
var MNot;
var bch='\u8F66\u9A6C\u76F8\u8C61\u4ED5\u58EB\u5E05\u5C06\u70AE\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5175\u5352\u4E00\uFF11\u4E8C\uFF12\u4E09\uFF13\u56DB\uFF14\u4E94\uFF15\u516D\uFF16\u4E03\uFF17\u516B\uFF18\u4E5D\uFF19\u524D\u4E2D\u540E\u8FDB\u9000\u5E73';
var ben='\uFF32\uFF28\uFF25\uFF25\uFF21\uFF21\uFF2B\uFF2B\uFF23\u3000\u3000\u3000\u3000\u3000\u3000\u3000\uFF30\uFF30\uFF11\uFF11\uFF12\uFF12\uFF13\uFF13\uFF14\uFF14\uFF15\uFF15\uFF16\uFF16\uFF17\uFF17\uFF18\uFF18\uFF19\uFF19\uFF0B\uFF1D\uFF0D\uFF0B\uFF0D\uFF1D';
var bvi='\uFF38\uFF2D\uFF34\uFF34\uFF33\uFF33\uFF2B\uFF2B\uFF30\u3000\u3000\u3000\u3000\u3000\u3000\u3000\uFF22\uFF22\uFF11\uFF11\uFF12\uFF12\uFF13\uFF13\uFF14\uFF14\uFF15\uFF15\uFF16\uFF16\uFF17\uFF17\uFF18\uFF18\uFF19\uFF19\uFF0B\uFF1D\uFF0D\uFF0B\uFF0D\uFF1D';
var bja='\u329F\u329A\u32A1\u32AA\u3293\u328F\u329E\u3295\u329C\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u329B\u3285\uFF11\uFF11\uFF12\uFF12\uFF13\uFF13\uFF14\uFF14\uFF15\uFF15\uFF16\uFF16\uFF17\uFF17\uFF18\uFF18\uFF19\uFF19\uFF0B\uFF1D\uFF0D\uFF0B\uFF0D\uFF1D';
var TT=[Number(new Date()),0,0,0,0,0];
window.onerror=showalert;
var fz,fzt,w0,h0,p0,lh,aHeight,tWidth;
var fdbs,hm,wm,MessFunc='',ViewUrl='';
var P90,D400,sMI,pMI,nnum,lnum,move,cnum,P,tree;
var fnum,xqtitle,hits,refer,MoveDIV,VarDIV,cText,sText,sText1,Mscroll;
var allowLR,isTurn,timer,canauto,isMirror,CSS,pClick,pCid;
var xmlok,LiveUpMove,LiveMove,LiveMoveLen,LiveID,LiveAdmin,AllowLive,Livetime,Livetimer,AllowAdd,LiveComment,isAddMove,BPos;
var NoFile=(self.name.substr(0,6)=='NoFile'||window==top)?true:false;
try {P=parent.location.href;} catch(e) {NoFile=true;}
var B='8979695949392919097717866646260600102030405060708012720323436383';
var REOK=checkRegExp();
var tQZ='\u8F66\u9A6C\u76F8\u4ED5\u5E05\u4ED5\u76F8\u9A6C\u8F66\u70AE\u70AE\u5175\u5175\u5175\u5175\u5175\u8F66\u9A6C\u8C61\u58EB\u5C06\u58EB\u8C61\u9A6C\u8F66\u70AE\u70AE\u5352\u5352\u5352\u5352\u5352';
var iQZ='r1r2r3r4r5r4r3r2r1r6r6r7r7r7r7r7b1b2b3b4b5b4b3b2b1b6b6b7b7b7b7b7';
if (!DhtmlXQimgpath) var DhtmlXQimgpath='';if (!ads_dpxq) var ads_dpxq='';if (!isMXQ) var isMXQ=false;if (!ads_board) var ads_board='HOCCOTUONG.NET';
var isSP=(NoFile)?false:((parent.location.href.search(/\/hldcg\/search(\/?$|\/?\?.*|\/(index|mini)\.asp.*)/gi)!=-1)?true:false);
var SURL=location.hostname;SURL='http://'+(SURL=='localhost'?SURL:'www.dpxq.com')+'/hldcg/search/';
var UBB=unconv((NoFile)?self.name:$P(self.name.substr(5)).innerHTML).replace(/[\r\n]*(\[\/DhtmlXQ_\w+\])[\r\n]*/gi,'$1\r\n').replace(/[\r\n]*(\[DhtmlXQ_\w+\])[\r\n]*/gi,'\r\n$1').match(eval('/\\[(DhtmlXQ_\\w+)\\].+'+REOK+'\\[\\/\\1\\]/gi'));
UBB=(UBB==null)?('[DhtmlXQ_ver]www_dpxq_com'+isBIG5+'[/DhtmlXQ_ver]\r\n[DhtmlXQ_init]500,350[/DhtmlXQ_init]'):(UBB.join('\r\n')).replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/ /gi,' ');
var NS=getBrowser();
var WIN=getWinVer();
var ZHCN=(navigator.systemLanguage||navigator.language).toLowerCase()=='zh-cn'?1:0;
var IMGPATH=(isSP?parent.IMGPATH:DhtmlXQimgpath).substr(0,100);
if (IMGPATH!='') IMGPATH=(IMGPATH+'/').replace(/[\/\\]+$/gi,'/');
if (!viewtype) var viewtype=isSP?parent.VIEWTYPE:getvar('viewtype');
var VIMG=viewtype=='img'?1:0;
var RT=isSP?('\\u'+'00FF-\\u'+'FFFF'):'';
var diyimg=isSP?parent.DIYIMG:getvar('diyimg');
var r=new RegExp('^[\\w\\-\\.'+RT+']+(\\/[\\w\\-\\.'+RT+']+)*,[0127](,[01]){4}(,(00|[2-7]\\d)){2}(,\\-?\\d{1,4})*$','gi');
if (!VIMG||diyimg.search(r)==-1) diyimg='';
var song=((WIN.w9x&&!ZHCN)||WIN.other||WIN.w95)?false:true;
var imgQiZi=(isBIG5||VIMG||WIN.other||WIN.w95||NS.other||(!WIN.wxp&&(!ZHCN||!NS.IE)))?true:false;
var baseQiZi=(NS.IE>=8||NS.Firefox>=3||NS.Opera>=11||NS.Chrome||NS.Safari||NS.WebKit||NS.Gecko)?true:false;
var wTitle=getFdbs(diyimg==''?2.20:2.99);
var qzdx,qgdx=parseInt(25*fdbs);
var qpzb=getQPZB();
fz=parseInt(12*fdbs);//font-size
if(isBIG5) fz=[12,12,13,15,15,15,15,15,15,15,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23][fz-12];
else{ fz=[12,12,14,14,16,16,18,18,18,18,18,18,18,18,26,26,26,26,26,26,26,26,26,26,26][fz-12];if(fz==18&&!song)fz=16;}
lh=parseInt(16*fdbs);//Do cao dong (line-height
w0=parseInt(500*fdbs);//Chieu Rong
if (w0%2==1) w0--;
h0=Math.round(w0*7/10);//Chieu cao = 7/10 chieu rong
p0=parseInt(4*fdbs);//Border
hm=parseInt(h0/3);//Variation panel
wm=Math.round(w0*wTitle/500);
if (wTitle==240) wm=wm-wm%2;
var BGIMG='',BDIMG='',CPIMG='',LNIMG='',CLIMG='',QZIMG=[],rQZ=[],bQZ=[];
var UWD=0,qznum=0,qzasbg=1,qclimg=0,qpbdxy='',qplnxy='',qpclxy='',qzxy=[0,0,0,0,0,0];
//var bgColor='#9CF',bdColor='#666',blColor='#9DF',brColor='#FFF',qbColor='#666',qpColor='#eed3b3',qgColor='#666',bxColor='#FFF',bsColor='#316ac5';
var bgColor='#0B9CF5',bdColor='#666',blColor='#9DF',brColor='#FFF',qbColor='#666',qpColor='#F5D2B4',qgColor='#666',bxColor='#FFF',bsColor='#316ac5';
var diyclr=isSP?parent.DIYCLR:getvar('diyclr');getCLR();
var NOBD=qbColor=='transparent'?1:0;
var CNTW=isBIG5?'zhtw/':'zhcn/';
var qzimg=iQZ.match(/../g),qztxt=tQZ.split('');
if (VIMG) getIMG(); else getTXT();
var S=('<style type="text/css">');
S+=('* {font-size:'+fz+'px;line-height:'+lh+'px;margin:0;padding:0;'+((!isBIG5)?'font-family:\u5B8B\u4F53,\u65B0\u5B8B\u4F53,"MS Song",SimSun,NSimSun;':'font-family:\u7EC6\u660E\u4F53,\u65B0\u7EC6\u660E\u4F53,MingLiU,PMingLiU;')+'}');
S+=('a:link,a:active,a:visited {text-decoration:none;color:#000;}');
S+=('a:hover {text-decoration:underline;}');
S+=('body {overflow:hidden;background-color:transparent;}');
S+=('textarea {word-wrap:break-word;resize:none;padding-left:1px;}');
S+=('textarea:focus,input:focus,select:focus {outline:none;}');
S+=('#divs,#divsave {position:absolute;left:0;top:0;text-align:left;width:100%;height:100%;'+bgColor+BGIMG+'}');
S+=('#m_text div,#v_text div {white-space:nowrap;overflow:hidden;line-height:'+(lh-1)+'px!important;line-height:'+(lh-2)+'px;padding-top:1px!important;padding-top:2px;cursor:default;}');
S+=('#div19 div {position:absolute;overflow:hidden;'+qgColor+'font-size:1px;line-height:1px;}');
S+=('#treetxt input {height:'+lh+'px;width:'+(lh+1)+'px;}');
S+=('#addred a {color:#f00;}');
S+=('</style>');
document.write(S+'<div id="message" style="position:absolute;left:'+(wm/10)+'px;top:'+hm+'px;width:'+(wm*0.8)+'px;border:2px solid #0f0;background-color:#f4fcf3;"><div style="margin:2px;color:#00f;text-align:center;height:'+(hm-lh-lh)+'px;width:'+(wm*0.8-4)+'px;overflow:hidden;" id="messdiv">DongPing DhtmlXQ ChessBoard Loading ......<br>Powered By dpxq.com Program Version '+PVer+'</div><div style="margin-bottom:'+(fz/2)+'px;text-align:center;width:100%;"><button style="width:'+(fz*5)+'px;padding-top:2px;margin-right:20%;" onclick="clickYES()">Yes</button><button style="width:'+(fz*5)+'px;padding-top:2px;" onclick="clickNO()">No</button></div></div><div id="divs" style="overflow:hidden;"></div><div id="divsave" style="display:none;overflow:auto;"></div>');
function $(o) {return document.getElementById(o);}
function $P(o){return parent.document.getElementById(o);}
function getInfo()
{
var i,s='Time:'+(TT[1]-TT[0])+'ms '+(TT[3]-TT[2])+'ms '+(TT[5]-TT[4])+'ms\n';
var FDBS=(''+(fdbs-0+0.001)).substr(0,4);
s+='Version:'+PVer+'\n';
s+='Image:'+(VIMG?'Bitmap':'Text')+'\n';
s+='Zoom:'+FDBS+' '+(wTitle==350?'Large':(wTitle==240?'Small':''))+'\n';
var h=wTitle,w=Math.round(FDBS*wTitle);
if (h==240) h=Math.round(w*35/24);
else if (h==350) h=Math.round(w);
else h=Math.round(w*7/10);
s+='Width:'+w+'px\n';
s+='Height:'+h+'px\n';
s+='Font-size:'+fz+'px\n';
s+='Cell width:'+qgdx+'px\n';
s+='Piece size:'+qzdx+'px '+(imgQiZi?(qznum+'\u56FE\u5F62'):baseQiZi?'dataURL':UWD?'WebDings':'\u5B8B\u4F53')+'\u68CB\u5B50\n';
s+='System:'+(WIN.w95?'Win95':WIN.w9x?'Win9X':WIN.w2000?'Win2000':WIN.wxp?'WinXP+':'other')+'\n';
s+='Language:'+(ZHCN?'':'\u975E')+'\u7B80\u4F53\u4E2D\u6587\n';
s+='Browser:'+(NS.IE?('IE '+NS.IE):NS.Firefox?('Firefox '+NS.Firefox):NS.Chrome?('Chrome '+NS.Chrome):NS.Safari?('Safari '+NS.Safari):NS.Opera?('Opera '+NS.Opera):NS.WebKit?('WebKit '+NS.WebKit):NS.Gecko?('Gecko '+NS.Gecko):'other')+'\n';
s+='Image path:'+(DhtmlXQimgpath==''?'\u540CHTML\u6587\u4EF6':DhtmlXQimgpath)+'\n';
if (imgQiZi)
{
s+='\u56FE\u7247:'+(IMGPATH==''?'\u540CHTML\u6587\u4EF6':IMGPATH)+'\n';
s+='\u524D\u7F00:'+CNTW+'\n';
if (VIMG)
{
s+='\u80CC\u666F:'+BGIMG.split('(')[1].split(')')[0]+'\n';
s+='Comment:'+CPIMG.split('(')[1].split(')')[0]+'\n';
s+='\u68CB\u76D8:'+BDIMG.split('(')[1].split(')')[0]+'\n';
if (qpbdxy) s+='\u504F\u79FB:'+qpbdxy.split(':')[1].split(';')[0]+'\n';
s+='\u683C\u7EBF:'+LNIMG.split('(')[1].split(')')[0]+'\n';
if (qplnxy) s+='\u504F\u79FB:'+qplnxy.split(':')[1].split(';')[0]+'\n';
if (CLIMG) {s+='\u70B9\u51FB:'+CLIMG.split('(')[1].split(')')[0]+'\n';
if (qpclxy) s+='\u504F\u79FB:'+qpclxy.split(':')[1].split(';')[0]+'\n';}
}
if (qznum==7)
{
var t=[0,1,2,3,4,9,11];
for(i=1;i<8;i++) s+='\u7EA2'+tQZ.charAt(t[i-1])+':'+QZIMG[i]+'\n';
for(i=11;i<18;i++) s+='\u9ED1'+tQZ.charAt(16+t[i-11])+':'+QZIMG[i]+'\n';
}
else if (qznum==2)
{
s+='\u7EA2\u65B9:'+QZIMG[0]+'\n';
s+='\u9ED1\u65B9:'+QZIMG[1]+'\n';
if (diyimg=='')
{
s+='\u7EA2\u5706:'+QZIMG[2]+'\n';
s+='\u9ED1\u5706:'+QZIMG[3]+'\n';
}
}
else s+='\u68CB\u5B50:'+QZIMG[0]+'\n';
}
if (FDBS!='1.00'||wTitle!=500) s+='[DhtmlXQ_zoom]'+FDBS+'.'+wTitle+'[/DhtmlXQ_zoom]\n';
if (VIMG) s+='[DhtmlXQ_viewtype]img[/DhtmlXQ_viewtype]\n';
var diy=UBB.match(eval('/\\[(DhtmlXQ_diy'+(VIMG?'\\w+':'clr')+')\\].+'+REOK+'\\[\\/\\1\\]/gi'));
if (diy!=null) s+=diy.join('\n');
cText.value=s;
sText1.value=s;
if (wTitle!=500) copycode(cText);
}
function getCLR()
{
var P=(diyclr+',,,,,,,,,').split(',');
r=/^(#([\dA-F]{3}){1,2}|[A-Z]{3,})$/gi;
if (P[0].search(r)!=-1) bgColor=P[0];
if (P[1].search(r)!=-1) bdColor=P[1];
if (P[2].search(r)!=-1) blColor=P[2];
if (P[3].search(r)!=-1) brColor=P[3];
if (P[4].search(r)!=-1) qbColor=P[4];
if (P[5].search(r)!=-1) qpColor=P[5];
if (P[6].search(r)!=-1) qgColor=P[6];
if (P[7].search(r)!=-1) bxColor=P[7];
if (P[8].search(r)!=-1) bsColor=P[8];
P='background-color:';
bgColor=P+bgColor+';';
bdColor=P+bdColor+';';
blColor=P+blColor+';';
brColor=P+brColor+';';
qbColor=P+qbColor+';';
qpColor=P+qpColor+';';
qgColor=P+qgColor+';';
bxColor=P+bxColor+';';
}
function getIMG()
{
if (diyimg!='')
{
P=(diyimg+',0,0,0,0,0,0,0,0,0,0,0,0').split(',');
diyimg=P[0];
qznum=P[1]-0;
qzasbg=P[2]-0;
qclimg=P[3]-0;
if (P[4]==0) qpzb=[['',''],['',''],['',''],['','']];
if (P[5]==0) ads_board='';
if (P[6]!='00') qzdx=P[6]-0;
if (P[7]!='00') qgdx=P[7]-0;
qpbdxy='background-position:'+P[8]+' '+P[9]+';';
qplnxy='background-position:'+P[10]+' '+P[11]+';';
qpclxy='background-position:'+P[12]+' '+P[13]+';';
qzxy=[P[14]-0,P[15]-0,P[16]-0,P[17]-0,P[18]-0,P[19]-0];
CNTW=(diyimg+'/').replace(/_\/$/gi,'_');
}
if (qgdx<25) qgdx=25;
if (qgdx>75) qgdx=75;
if (diyimg=='')
{
if (qgdx>55) qgdx=55;
if (qgdx%2==0) qgdx--;
qzdx=qgdx-1;
}
if (qzdx>qgdx) qzdx=qgdx;
var diyurl=isSP?parent.DIYURL:(diyimg==''?'':getvar('diyurl'));
P=(diyurl+',,,,,,,,,,,,,,,,,,').split(',');
var i,j,r=new RegExp('^[\\w\\-\\.'+RT+']+(\\/[\\w\\-\\.'+RT+']+)*\\.(gif|png|jpg|bmp)$','gi');
for (i=0;i<P.length;i++)
{
if (P[i].search(r)!=-1) P[i]=IMGPATH+CNTW+P[i];
else P[i]='';
}
if (P[0]!='') BGIMG='background-image:url('+P[0]+');';
else BGIMG='background-image:url('+IMGPATH+CNTW+'bg_00.gif);';
if (P[1]!='') CPIMG='background-image:url('+P[1]+');';
else CPIMG='background-image:url('+IMGPATH+CNTW+'cp_00.gif);';
if (P[2]!='') BDIMG='background-image:url('+P[2]+');'+qpbdxy;
else BDIMG='background-image:url('+IMGPATH+CNTW+'bd_'+qgdx+'.gif);'+qpbdxy;
if (P[3]!='') LNIMG='background-image:url('+P[3]+');'+qplnxy;
else LNIMG='background-image:url('+IMGPATH+CNTW+'ln_'+qgdx+'.gif);'+qplnxy;
if (P[4]!='') CLIMG='background-image:url('+P[4]+');'+qpclxy;
else CLIMG='background-image:url('+IMGPATH+CNTW+'cl_'+qgdx+'.gif);'+qpclxy;
CPIMG+='background-attachment:fixed;';
LNIMG+='background-repeat:no-repeat;';
CLIMG+='background-repeat:no-repeat;';
if (qclimg==0) CLIMG='';
var diyiqz=isSP?parent.DIYIQZ:(diyimg==''?'':getvar('diyiqz'));
if (qznum==0) qznum=fdbs==1?7:2;
if (qznum==7)
{
for (i=5;i<19;i++)
{
if (P[i]!='') QZIMG[i-(i<12?4:1)]=P[i];
else QZIMG[i-(i<12?4:1)]=IMGPATH+CNTW+(i<12?('r'+(i-4)):('b'+(i-11)))+'_'+qzdx+'.gif';
}
}
else if (qznum==2)
{
if (diyimg=='')
{
j=parseInt(16*fdbs);
j+=j%2;
}
else
{
j=qzdx;
if (diyiqz.search(/^([rb][1-7]){32}$/gi)!=-1) qzimg=diyiqz.match(/../g);
}
if (P[5]!='') QZIMG[0]=P[5];
else QZIMG[0]=IMGPATH+CNTW+'r8_'+j+'.gif';
if (P[6]!='') QZIMG[1]=P[6];
else QZIMG[1]=IMGPATH+CNTW+'b8_'+j+'.gif';
if (P[7]!='') QZIMG[2]=P[7];
else QZIMG[2]=IMGPATH+CNTW+'r0_'+qgdx+'.gif';
if (P[8]!='') QZIMG[3]=P[8];
else QZIMG[3]=IMGPATH+CNTW+'b0_'+qgdx+'.gif';
}
else
{
if (P[5]!='') QZIMG[0]=P[5];
else QZIMG[0]=IMGPATH+CNTW+'rb_'+qzdx+'.gif';
if (diyiqz.search(/^(0[1-9]|1[0-4]){32}$/gi)!=-1) iQZ=diyiqz;
else iQZ='0102030405040302010606070707070708091011121110090813131414141414';
qzimg=iQZ.match(/../g);
}
}
function getTXT()
{
IMGPATH=DhtmlXQimgpath;
if (qgdx>55) qgdx=55;
if (qgdx<25) qgdx=25;
if (qgdx%2==0) qgdx--;
qzdx=qgdx-1;
qznum=fdbs==1?7:2;
if (imgQiZi)
{
if (qznum==7) {for (var i=1;i<18;i++) QZIMG[i]=IMGPATH+CNTW+(i<11?'r':'b')+i%10+'_'+qzdx+'.gif';}
else
{
var j=parseInt(16*fdbs);j+=j%2;
QZIMG[0]=IMGPATH+CNTW+'r8_'+j+'.gif';
QZIMG[1]=IMGPATH+CNTW+'b8_'+j+'.gif';
QZIMG[2]=IMGPATH+CNTW+'r0_'+qgdx+'.gif';
QZIMG[3]=IMGPATH+CNTW+'b0_'+qgdx+'.gif';
}
}
}
function getFdbs(m)
{
var w=isSP?((''+(parent.ZOOM+0.001)).substr(0,4)+'.500'):getvar('zoom');
if (w.search(/^[12]\.\d\d\.(50|35|24)0$/gi)!=-1)
{
fdbs=w.substr(0,4)-0;
if (fdbs>m) fdbs=m;
return w.substr(5)-0;
}
w=getvar('init');fdbs=1;
if (w.search(/^\d+,\d+$/gi)==-1) return 500;
w=w.split(',');var h=w[1]-0;w=w[0]-0;
if (h>350)
{
if (h==Math.round(w)) {fdbs=h/350;w=350;}
else if (h==Math.round(w*7/10)) {fdbs=h/350;w=500;}
else if (h==Math.round(w*35/24)) {fdbs=h/350;w=240;}
if (fdbs>m) fdbs=m;
}
if (fdbs==1) w=(w<350)?240:((w<500)?350:500);
return w;
}
function getQPZB()
{
var q=[];
q[4]='\uFF19\uFF18\uFF17\uFF16\uFF15\uFF14\uFF13\uFF12\uFF11';
q[5]='\uFF11\uFF12\uFF13\uFF14\uFF15\uFF16\uFF17\uFF18\uFF19';
q[6]=q[4].split('').reverse().join('');
q[7]=q[5].split('').reverse().join('');
q[0]=[q[4],q[5]];
q[1]=[q[6],q[7]];
q[2]=[q[7],q[6]];
q[3]=[q[5],q[4]];
return q;
}
function showalert(sMag,sUrl,sLine,sFunc)
{
MessFunc='';
var sp=sMag.split('|');
if (sp.length>1) {sMag=sp[0];MessFunc=sp[1];}
sMag=(!sUrl)?sMag:('\u9519\u8BEF:'+sMag+' \u884C\u53F7:'+sLine+'<br><nobr>\u7F51\u5740:'+sUrl+'</nobr><br>\u8BF7\u6309Ctrl+F5\u5237\u65B0,\u5237\u65B0\u65E0\u6548\u8BF7\u62A5\u9519: <nobr><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="\u70B9\u51FB\u8FD9\u91CC\u53D1\u6D88\u606F" /></a> <a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&uid=hldcg&site=cntaobao&s=1&charset=utf-8" ><img border="0" src="http://amos.im.alisoft.com/online.aw?v=2&uid=hldcg&site=cntaobao&s=1&charset=utf-8" alt="\u70B9\u51FB\u8FD9\u91CC\u53D1\u6D88\u606F" /></a></nobr>');
$('messdiv').innerHTML=sMag;
$('messdiv').style.width=wm*0.8-4;
$('message').style.zIndex=3;
return true;
}
function clickYES()
{
eval(MessFunc);
MessFunc='';
clickNO();
}
function clickNO()
{
$('messdiv').style.width=0;
$('message').style.zIndex=-1;
}
function Xnc_KEvent(Xnc_K)
{
if (allowLR) {if (Xnc_K==39) gotonum('Next'); else if (Xnc_K==37) gotonum('Prev');}
}
function checkRegExp()
{
var r='';
try {r=new RegExp('.+?','gi');r='?';}catch(e){}
return r;
}
function getvar(v)
{
var r=eval('/\\[(DhtmlXQ_'+v+')\\](.*'+REOK+')\\[\\/\\1\\]/gi');
var s=UBB.match(r);
return (s==null)?'':s[0].replace(r,'$2').replace(/\|\|/gi,'\r\n');
}
function ls(x,y)
{
var i,s='',l=qgdx;
for (i=-l;i<l;i++) s+=('<div style="width:1px;height:1px;left:'+(x+i)+'px;top:'+(y+i)+'px;"></div><div style="width:1px;height:1px;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;top:'+a+'px;left:'+b+'px;'+qpColor+'"></div></div>';
}
function getBrowser()
{
var s,b=navigator.userAgent.toLowerCase();
var IE=0,Fi=0,Ch=0,Op=0,Sa=0,We=0,Ge=0,ot=0;
if (s=b.match(/msie (\d+(\.\d+)?)/)) IE=s[1]-0;
else if (s=b.match(/firefox\/(\d+(\.\d+)?)/)) Fi=s[1]-0;
else if (s=b.match(/chrome\/(\d+(\.\d+)?)/)) Ch=s[1]-0;
else if (s=b.match(/opera.(\d+(\.\d+)?)/)) {if(s[1]-9.8==0){if(s=b.match(/version.(\d+(\.\d+)?)/)) Op=s[1]-0;else Op=9.8;}else Op=s[1]-0;}
else if (s=b.match(/safari/)) Sa=1;
else if (s=b.match(/webkit/)) We=1;
else if (s=b.match(/gecko/)) Ge=1;
else ot=1;
return {IE:IE,Firefox:Fi,Chrome:Ch,Safari:Sa,Opera:Op,WebKit:We,Gecko:Ge,other:ot};
}
function getWinVer()
{
var b=navigator.userAgent;
var w95=0,w9x=0,w20=0,wxp=0,oth=0;
if (b.search(/Win(dows)? ?(95|NT 4)/gi)>=0) w95=1;
else if (b.search(/Win(dows)? ?(98|me|9x)/gi)>=0) w9x=1;
else if (b.search(/Win(dows)? ?(NT 5.0|2000)/gi)>=0) w20=1;
else if (b.search(/Win(dows)? ?(NT [5-9]|XP)/gi)>=0) wxp=1;
else if (navigator.platform.search(/Win(dows)?/gi)>=0) wxp=1;
else oth=1;
return {w95:w95,w9x:w9x,w2000:w20,wxp:wxp,other:oth};
}
function cDIV(x,y,w,h,p,s,f,t)
{
if (x!=='') x='left:'+x+'px;';
if (y!=='') y='top:'+y+'px;';
if (w!=='') w='width:'+w+'px;';
if (h!=='') h='height:'+h+'px;';
if (p!=='') p='position:'+((p==0)?'absolute;':'relative;');
return '<div style="'+p+x+y+w+h+s+'" '+f+'>'+((t=='head')?'':(t+'</div>'));
}
function dataURLQZ()
{
var t;
t='gAAAACH5BAEAAAAALAAAAAA2ADYAAAT0EMhJaw1ikGK6KcQgBFZpnuUxeGzLDgcqywLn3m4hzPyE2LhgS9dDJRTC5E2RKFoOQKXUE3NKFtNsi2FlaL8ebs8LLotl2LL6bDqo34ZqKRGFawvNEtKuVpQQfHAIFnWBdxUChnA7E4WKWQUTbo9vVSuUagMSmHAAAZxvGKBqGaNlGqZgG6lfjqyvsLGyZa6zHiC2QiG5QSK8OCO/NyTCLhKXxQaaAJPJcrWxkROJxYyNwtIU1LzWFHu2fnO8eSm2gyhksGwn6anr6KzvaKbyM1Cc51YSR49M+hY/+BD5Z6KGmoEEUajQAiOhEwwaooAQQeJfBAA7';
rQZ[55]='R0lGODlhNgA2AOMAAOzStPS2nPSahPR+bPRyZPQ+NPwCBPSqjPSijOy+pPRmVPSSfPSKdAAAAICA'+t;
bQZ[55]='R0lGODlhNgA2AOMAAOzStMy2nKyahIx+bHxyZEQ+NAQCBLyqjLSijNS+pHRmVKSSfJyKdAAAAICA'+t;
for (t=29;t<55;t+=2) {rQZ[t]=rQZ[55];bQZ[t]=bQZ[55];}
t='AICAgCH5BAEAAAAALAAAAAAwADAAAATcEMhJqwxskGK6OcQgIFZpnkCQcF7rGoUSoHQVDG+eD3ONJrpgTuErIRbCpKtAKkoaB6W0xXAyplhPtXbNerenrvd7QkTH3kPTgkSPCyWgG02kBObzngSHRw8md31uPXKCY3Ushl5wgYpjCAKOaAJ8klkall4bmVmJnJ+goaKCnqMvBQSmQSGqOiKtOSOwLySlrXAACrMedY2zepWtf4C7ehKFpnUVbaO4FmamaxZioGAm1JnWYZ/aKAxnjt00R4pMThXIbsrndsGXxuw2K1Mx8PEmAZSbHiAi0j4RAAA7';
rQZ[27]='R0lGODlhMAAwAOMAAOzStOzGpPSijPSKdPRyZPRWTPwCBPQ+NOy+pPSahPSSfPRmVPSqjPSylAAA'+t;
bQZ[27]='R0lGODlhMAAwAOMAAOzStNzGpLSijJyKdHxyZFxWTAQCBEQ+NNS+pKyahKSSfHRmVLyqjMSylAAA'+t;
t='AAAAACH5BAEAAAAALAAAAAAkACQAAASUEMhJZRCDlF3IMEEljtSBcGiKHGQLJGcqo0jiVsqsp8otabvghnADCoVEkvGIHOWY0B4lAa0WbJOY9YiYHLZVFkALFnYD5eolDcWwmZn3cSmv2+/4Kj3fGfBTH38oIIIcIWR5XQBfggJZf4oSVHxYE093AyN7aUmadZ1Kb6Atl1uZPpKIZpWoEiZcjq0jF3EcHiA+EQA7';
rQZ[25]='R0lGODlhJAAkAOMAAOzStOy+pPSijPR+bPRmVPwCBPSahPSqjPRWTPSylPSKdAAAAICAgAAAAAAA'+t;
bQZ[25]='R0lGODlhJAAkAOMAAOzStNS+pLSijIx+bHRmVAQCBKyahLyqjFxWTMSylJyKdAAAAICAgAAAAAAA'+t;
rQZ[16]='R0lGODlhdgAQAIAAAPwCBPz+/CH5BAEAAAAALAAAAAB2ABAAAAL9hB+nluvaQHwM2jWnxKg/DQXg9THieXIVgjZZBGaqt63em37t7lK2LbuxSLRa0ZhI8oxM33HW1MCIvV9z0+OJkFhV0HkZfa1aZnVLylam62Hsp0WnS0fp0IRaKePdPjdZsxNI5TNWZBcGaLb2xqEG1AU4VQVHEZeDsxT4qKdI1OY36UKpODZCB1XYxjl49cY5SdPSWglmdUsnGZJH+1TKBQp8czlLnLdXNlqrd/saHNsHjYjrIGZLa8qcCiz66yds8okqnnsY1iyk3erp2fFSDWZd6L2YjrxE+dnuiiR2ivtP1qFZvVSdkuKvWDhL/+RdAxckYLWG25zsgwegAAA7';
bQZ[16]='R0lGODlhdgAQAIAAAAQCBPz+/CH5BAEAAAAALAAAAAB2ABAAAAL0hB+nluva2IMvLhst2rI6PXUeEJSmeUFnmX4Thqxi1oJkuObsjbc8R3GNOrDZTZdIIk/DpubJWNKEH9rOKEnWgsCRrdg9/sDfF0lJ5LJADbCIWg5Do8iYlKn9vcVtWZu71xW3N8fjNugz9pfFt7Eoxnhx9yZFqBgWSHmm1me0OPVoRhViGBOlh5qpWDl1hvIH0yqa2OPaeYWZSpfn0zqHqHK3ZqtTerpZCEjxqRZptStcSyuKhqw5CujLAduMTaprI5ThO+x9vTmWzgb+Pa1rCpscmqunHYnJq/wNPLReJhwKyrgKOdi1yxVulj5VCtfRU0ivAAA7';
rQZ[18]='R0lGODlhhAASAIAAAPwCBPz+/CH5BAEAAAAALAAAAACEABIAAAL+hI95oZ3sIoxt0ndrto7jy4Xbtygi4llqRwWuR6LG9Na1jGvAWca7/+vNcqFbx4a8wXy8JIM3ZJIgqwUyKsxkdTmsNwiOVrtisTP8DIOhZOEyJU2qqW14kL4up5sPp4v7ZlI39UFjd1eGmPjEqLTFFkNDBqnyt3OF2HiGx9lDt1ciOSnhZzlHiAaKk6bW2qmYiSUp+qj19VjK+qPqOVi42OsWWksEwmKLt0s8tqX4CrvmOJRr0/Jr7CyLyXz7mpycV2yLQv2ySx0re90tmK38DWvq2iZxrAUeHswu5R6u295MXj0uI059AWeH1rx1/4bNWHIJG8BjCqNVQ3PpTD4gX5DeQWwG5JYJbhUR3hM5D8amcSxDShz30R7Mlq0yFAAAOw==';
bQZ[18]='R0lGODlhhAASAIAAAAQCBPz+/CH5BAEAAAAALAAAAACEABIAAAL+hI95oZ3sIoxt0ndr3lZ1jXyW6HxLiHnoCaabYUJTQNf2+Ny0y/NdvIIFTQBcSIfcEYNCFrOpKjGR0OLx1kxipRTSc6bdVZ8omROKY/zOVrKL6GWr1XK2/WS2zlZ0+rC3hMY1FSX418Ji5qeXMleEtffVdTi25hOGFwYpFJfIuBfJiVeiWXcIJDFY2AaTJ8oK6hQ7pvpVSjIS2kNYZWTImAWYAffSlgtsufo2p8UKawNby9E4HPyYJebmjKGk6pvMrCkmDh3e7Hr9uUs7Gn02C6YdKM3OJROJTuxN6b6ofHdB37Rt2cD4k9SLn6uDr/5VQwQCX0FnecjlU2EkWRkbegE5HtG2DeCkO2tiUBFYLFXKkA9TzoM4MGUBADs=';
}
function initboard()
{
TT[2]=Number(new Date());
var ps=parseInt(2*fdbs);
var w1=Math.round(w0*48/100)-p0*2;
if (w1%2==1) w1--;
var h1=parseInt(h0*0.84);
if (h1%2==1) h1--;
if (fdbs==1) h1=293;
var x1=p0;
var y1=parseInt((h0-h1)/2);
var b1=parseInt(3*fdbs);
var p1=parseInt(3*fdbs);
var bw1=parseInt(5*fdbs);
var bh1=parseInt(2*fdbs);
var w2=h0-p0-p0-w1-ps;
var ln=16;
var bh=parseInt(18*fdbs)+4;
if (bh>37) bh=37;
var bsp=parseInt(2*fdbs)-1;
var by=h0-bh-y1-Math.max(Math.floor((y1-bh)/2),p0);
var thh=Math.max(Math.round((h1-ln*lh-2)/2),lh+4);
var fzy,lht,lhy,pty,ptt,i,j,s;
if (qgdx<=25) {s=[16,20,32,40];}
else if (qgdx<=27) {s=[16,20,34,41];}
else if (qgdx<=29) {s=[18,23,38,44];}
else if (qgdx<=31) {s=[18,23,40,47];}
else if (qgdx<=33) {s=[26,31,42,49];}
else if (qgdx<=35) {s=[26,31,44,51];}
else if (qgdx<=37) {s=[26,31,48,56];}
else if (qgdx<=39) {s=[26,31,50,58];}
else if (qgdx<=41) {s=[28,33,54,63];}
else if (qgdx<=43) {s=[28,33,56,65];}
else if (qgdx<=45) {s=[28,33,58,67];}
else if (qgdx<=47) {s=[30,35,60,69];}
else if (qgdx<=49) {s=[32,39,64,74];}
else if (qgdx<=51) {s=[34,40,66,76];}
else if (qgdx<=53) {s=[34,40,68,78];}
else if (qgdx<=55) {s=[36,42,70,81];}
else {s=[36,42,70,81];}
fzt=s[0];lht=s[1];fzy=s[2];lhy=s[3];
if (!song&&fzt==18) {fzt=16;lht=20;}
if (NS.Firefox>=3||NS.Gecko) {ptt='1221222222222222';pty='3332332322333433';}
else if (NS.Firefox>=2) {ptt='2221222222222222';pty='3221222322332324';}
else if (NS.Opera) {ptt='2222222222222222';pty='3333333433344444';if(!ZHCN&&WIN.wxp){ptt='1211222212222222';pty='2210111101111112';}}
else if (NS.Safari||NS.Chrome||NS.WebKit) {ptt='2222222222222222';pty='3232233333334444';}
else {ptt='1111111111111111';pty='1121111111111111';}
var ptopy,ptopt,PNG,PT,PL,PW;
qzimg[32]='<div style="position:absolute;top:0;left:0;width:'+(qgdx-(qgdx-qzdx)%2)+'px;height:'+(qgdx-(qgdx-qzdx)%2)+'px;'+(CLIMG==''?'background-color:#0F0;':CLIMG)+'"></div>';
qztxt[32]=qzimg[32];
if (imgQiZi)
{
var tqizi='<div style="position:absolute;top:'+parseInt((qgdx-qzdx)/2)+'px;left:'+parseInt((qgdx-qzdx)/2)+'px;width:'+qzdx+'px;height:'+qzdx+'px;';
j=parseInt(16*fdbs);j+=j%2;
}
else if (NS.IE)
{
$('messdiv').innerHTML+='<div id="webdings" style="font-family:WebDings;font-size:12px;line-height:14px;">n</div>';
UWD=(($('webdings').scrollHeight-14>0)&&(NS.IE>=7||qgdx>30||!window.screen.fontSmoothingEnabled))?1:0;
}
for (i=0;i<32;i++)
{
if (imgQiZi)
{
if (qznum==7)
{
PNG=QZIMG[qzimg[i].replace('r','0').replace('b','1')-0];
if ((NS.IE==6||NS.IE==5.5)&&PNG.search(/\.png$/gi)!=-1) qzimg[i]=tqizi+'"><div style="position:absolute;width:'+qzdx+'px;height:'+qzdx+'px;top:0;left:0;overflow:hidden;"><div style="position:absolute;width:'+(qzdx-qzxy[0])+'px;height:'+(qzdx-qzxy[1])+'px;top:'+qzxy[1]+'px;left:'+qzxy[0]+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+PNG+'\',sizingMethod=\'crop\');"></div></div></div>';
else qzimg[i]=tqizi+'background-image:url('+PNG+');background-position:'+qzxy[0]+' '+qzxy[1]+';"></div>';
}
else if (qznum==2&&diyimg=='')
{
qzimg[i]=tqizi+'background-image:url('+QZIMG[i<16?2:3]+');"><div style="position:absolute;width:'+j+'px;height:'+j+'px;top:'+(qzdx-j)/2+'px;left:'+(qzdx-j)/2+'px;background-image:url('+QZIMG[i<16?0:1]+');background-position:-'+((qzimg[i].charAt(1)-1)*(j+1))+' 0;"></div></div>';
}
else
{
if (qznum==2)
{
PNG=QZIMG[i<16?0:1];
PL=qzxy[i<16?0:3]-(qzimg[i].charAt(1)-1)*(qzdx+qzxy[i<16?2:5]);
PT=qzxy[i<16?1:4];
PW=7*(qzdx+qzxy[i<16?2:5])-PT;
}
else
{
PNG=QZIMG[0];
PL=qzxy[0]-(qzimg[i]-1)*(qzdx+qzxy[2]);
PT=qzxy[1];
PW=14*(qzdx+qzxy[2])-PT;
}
if ((NS.IE==6||NS.IE==5.5)&&PNG.search(/\.png$/gi)!=-1) qzimg[i]=tqizi+'"><div style="position:absolute;width:'+qzdx+'px;height:'+qzdx+'px;top:0;left:0;overflow:hidden;"><div style="position:absolute;width:'+PW+'px;height:'+(qzdx-PT)+'px;top:'+PT+'px;left:'+PL+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+PNG+'\',sizingMethod=\'crop\');"></div></div></div>';
else qzimg[i]=tqizi+'"><div style="position:absolute;width:'+qzdx+'px;height:'+qzdx+'px;top:0;left:0;background-image:url('+PNG+');background-position:'+PL+' '+PT+';"></div></div>';
}
}
else
{
if (baseQiZi) dataURLQZ();
ptopy=pty.charAt((qgdx-25)/2)-0;
ptopt=ptt.charAt((qgdx-25)/2)-0;
if (baseQiZi) tqizi='<div style="position:absolute;top:0px;left:0px;width:'+(qgdx-1)+'px;height:'+(qgdx-1)+'px;"><img style="width:'+(qgdx-1)+'px;height:'+(qgdx-1)+'px;" src="data:image/gif;base64,'+(i<16?rQZ[qgdx]:bQZ[qgdx])+'" /></div>';
else if (UWD) tqizi='<div style="left:0px;top:'+((' 29 31 35 39 45 49 55'.indexOf(''+qgdx)>0)?-1:0)+'px;width:'+(qgdx-1)+'px;height:'+(qgdx-1)+'px;position:absolute;font-size:'+(qgdx-1)+'px;line-height:'+(qgdx)+'px;color:#'+((i<16)?'f':'0')+'00;font-family:WebDings;">n</div>';
else tqizi='<div style="left:'+(qgdx-1-fzy)/2+'px;top:'+((qgdx-1-fzy)/2-ptopy)+'px;width:'+fzy+'px;position:absolute;font-size:'+fzy+'px;line-height:'+(lhy)+'px;color:#'+((i<16)?'f':'0')+'00;">\u25CF</div>';
if (baseQiZi&&(fzt==16||fzt==18)) tqizi+='<div style="position:absolute;width:'+fzt+'px;height:'+fzt+'px;top:'+(qgdx-1-fzt)/2+'px;left:'+(qgdx-1-fzt)/2+'px;overflow:hidden;" /><img style="position:absolute;left:-'+((qzimg[i].charAt(1)-1)*(fzt+1))+'px;" src="data:image/gif;base64,'+((i<16?rQZ[fzt]:bQZ[fzt]))+'" /></div>';
else tqizi+='<div style="top:'+((qgdx-1-fzt)/2-((qztxt[i]=='\u5175'&&fzt>=26)?1:0)-ptopt)+'px;left:0px;width:'+(qgdx-1)+'px;text-align:center;position:absolute;color:#fff;font-size:'+fzt+'px;line-height:'+lht+'px;" class="'+((i<16)?'r':'b')+'t">'+qztxt[i]+'</div>';
qztxt[i]=tqizi;
}
}
tWidth=wm-p0*2;
aHeight=h0;
var DIVS=$('divs');
if (NoFile||isSP){
aHeight=Math.max(h0,parseInt(DIVS.clientHeight));
}else{
var ww=$P('id_'+self.name.substr(5));
if (ww)
{
ww.style.width=w0;
aHeight=Math.max(h0,parseInt(DIVS.clientHeight));
if (aHeight<(h0+6+lh*2)) aHeight=h0;
else if (aHeight<w0) aHeight=h0+6+lh*2;
ww.style.height=aHeight+'px';
ww.style.width=wm+'px';
}
}
var tx=(w1-qgdx*8)/2;
var ty=(h1-qgdx*9-1)/2;
// title+board
s=cDIV(p0,0,tWidth,'',0,"overflow:hidden;text-align:center;white-space:nowrap;padding-top:2px;line-height:"+(y1-2)+"px;",'id="div1"','');
s+=('<div style="position:absolute;top:'+y1+'px;left:'+x1+'px;width:'+w1+'px;height:'+h1+'px;">');
s+=cDIV(0,0,w1,h1,0,qbColor+(NOBD?BDIMG:''),'','');
s+=cDIV(1,1,w1-2,h1-2,0,((VIMG&&NOBD)?'':(qpColor+BDIMG)),'','');
if (VIMG)
{
if (LNIMG) s+=cDIV(tx-(qgdx+1)/2,ty-(qgdx+1)/2,qgdx*9+2,qgdx*10+2,0,LNIMG,'','');
}
else
{
s+=cDIV(tx-b1-p1,ty-b1-p1,qgdx*8+1+p1*2+b1*2,qgdx*9+1+p1*2+b1*2,0,qgColor,'','');
s+=cDIV(tx-p1,ty-p1,qgdx*8+1+p1*2,qgdx*9+1+p1*2,0,qpColor,'','');
s+=cDIV(tx-p1,ty-p1,qgdx*8+1+p1*2,qgdx*9+1+p1*2,0,qpColor,'','');
s+=cDIV(tx,ty,8*qgdx+2,9*qgdx+2,0,bxColor,'','');
s+=cDIV(tx,ty,8*qgdx+1,9*qgdx+1,0,qgColor,'','head');
for (i=0;i<9;i++)
{
if (i==4) s+=cDIV(1,i*qgdx+1,8*qgdx-1,qgdx-1,0,bxColor,'','head')+cDIV(1,1,8*qgdx-2,qgdx-2,0,qpColor,'','')+'</div>';
else for (j=0;j<8;j++) s+=cDIV(j*qgdx+1,i*qgdx+1,qgdx-1,qgdx-1,0,bxColor,'','head')+cDIV(1,1,qgdx-2,qgdx-2,0,qpColor,'','')+'</div>';
}
s+=('</div>');
s+=('<div id="div19" style="position:absolute;top:'+ty+'px;left:'+tx+'px;">');
s+=ls(qgdx*4,qgdx);
s+=ls(qgdx*4,qgdx*8);
s+=lz(0,qgdx*3,2)+lz(qgdx*2,qgdx*3)+lz(qgdx*4,qgdx*3)+lz(qgdx*6,qgdx*3)+lz(qgdx*8,qgdx*3,3);
s+=lz(qgdx,qgdx*2)+lz(qgdx*7,qgdx*2);
s+=lz(0,qgdx*6,2)+lz(qgdx*2,qgdx*6)+lz(qgdx*4,qgdx*6)+lz(qgdx*6,qgdx*6)+lz(qgdx*8,qgdx*6,3);
s+=lz(qgdx,qgdx*7)+lz(qgdx*7,qgdx*7);
s+=('</div>');
}
var zb=(fz>12&&fz<20)?((isBIG5)?15:16):fz;
var zh=zb+zb%2;
var bsy=parseInt((h1-qgdx*10-zh*2)/4);
var msy=parseInt(ty+4*qgdx+2);
var rsy=ty+9*qgdx+(ty-bsy-zh-1);
s+=cDIV(tx-zh/2+2,bsy,qgdx*10,'',0,'font-size:'+zb+'px;letter-spacing:'+(qgdx-zh)+'px;','id="bside"',qpzb[0][1]);
s+=cDIV(tx+2,msy,qgdx*8-2,qgdx-3,0,'overflow:hidden;text-align:center;line-height:'+(qgdx-1)+'px;','id="mside"',ads_board);
s+=cDIV(tx-zh/2+1,rsy,qgdx*10,'',0,'font-size:'+zb+'px;letter-spacing:'+(qgdx-zh)+'px;','id="rside"',qpzb[0][0]);
s+=cDIV((w1-qgdx*9+1)/2,(h1-qgdx*10)/2,qgdx*9,qgdx*10+2,0,'','','head');
for (i=32;i>=0;i--) s+=('<div id="z'+i+'" style="left:'+(10*qgdx)+'px;top:'+(9*qgdx)+'px;position:absolute;width:'+qgdx+'px;height:'+qgdx+'px;">'+(imgQiZi?qzimg[i]:qztxt[i])+'</div>');
s+=('<table style="position:absolute;top:0;left:0" cellspacing="0" cellpadding="0">');
for (i=0;i<10;i++)
{
s+=('<tr>');
for (j=0;j<9;j++) s+=('<td style="width:'+qgdx+'px;height:'+qgdx+'px;" onclick="getMove(\''+j+i+'\')"></td>');
s+=('</tr>');
}
s+=('</table>');
s+=('</div>');
var bw=parseInt((w2+bsp)/3)-bsp;
if (bw%2==1) bw++;
var bs='position:absolute;line-height:'+(bh-4)+'px;top:'+by+'px;width:'+bw+'px;height:'+bh+'px;';
s+=('<input type="button" style="'+bs+'left:0;" onclick="gotonum(\'First\')" value="<<">');
s+=('<input type="button" style="'+bs+'left:'+(bw+bsp)+'px;" onmouseup="gotonum(\'Prev\')" value="<">');
s+=('<input type="button" style="'+bs+'left:'+(2*bw+2*bsp)+'px;" onmouseup="gotonum(\'Next\')" value=">">');
s+=('<input type="button" style="'+bs+'left:'+(3*bw+3*bsp)+'px;" onclick="gotonum(\'Last\')" value=">>">');
s+=('<input type="button" style="'+bs+'left:'+(4*bw+4*bsp)+'px;width:'+(w1-bw-(bw+bsp)*4-bsp)+'px;border:0;background-color:transparent;color:#00f;" id="shownow" value="0/0">');
s+=('<input type="button" style="'+bs+'left:'+(w1-bw)+'px;" id="autoplay" onclick="AutoPlay()" value="Auto">');
s+=cDIV(w1-bw,by+bh-lh*13-4,bw,lh*13+6,0,'display:none;overflow:hidden;'+bdColor,'id="autotime"','head');
s+=cDIV(1,1,bw-2,lh*13+4,0,'line-height:'+lh+'px;background-color:#fff;text-align:center;','','<div style="height:3px;font-size:3px;line-height:3px;"></div><a href="javascript:turnBoard();">Turn</a><br><a href="javascript:mirrorBoard();">Mirro</a><br><a href="javascript:EditSave()">Save</a><br><a href="javascript:getUBB();copycode(sText);">UBB</a><br><a href="javascript:getInfo();">Info</a><br><a href="javascript:Autotimer(8000)">8s</a><br><a href="javascript:Autotimer(5000)">5s</a><br><a href="javascript:Autotimer(3000)">3s</a><br><a href="javascript:Autotimer(2000)">2s</a><br><a href="javascript:Autotimer(1000)">1s</a><br><a href="javascript:Autotimer(500)">0.5s</a><br><a href="javascript:Autotimer(200)">0.2s</a><br><a href="javascript:Autotimer(100)">0.1s</a>');
s+=('</div></div>');
// move
var typ='padding-top:1px!important;padding-top:2px;line-height:'+(thh-2)+'px;';
s+=('<div style="'+((wTitle==240)?'display:none;':'')+'position:absolute;top:'+y1+'px;left:'+(x1+w1+ps)+'px;">');
s+=cDIV(0,0,w2,h1,0,bdColor,'','');
s+=cDIV(1,1,w2-2,h1-2,0,blColor,'','');
s+=cDIV(1,thh,w2-2,ln*lh+2,0,brColor,'','');
s+=cDIV(6,1,w2-7,'',0,typ,'','Move List[<a href="javascript:HideMove();" id="hidemove">Hide</a>]');
s+=cDIV(2,thh+1,w2-3,ln*lh,0,'overflow:auto;'+CPIMG,'id="m_scroll"','head');
s+=('<div id="m_text" style="height:'+(ln*lh+1)+'px;-moz-user-select:none;" onselectstart="return false;">');
s+=(' <div id="move_0" onmouseup="gotonum(0)" style="background-color:'+bsColor+';color:#fff;">====\u68CB\u5C40\u5F00\u59CB</div>');
s+=('</div>');
s+=('</div>');
s+=('<input type="button" style="'+bs+'left:0;" value="Turn" id="turn_Board" onclick="turnBoard()">');
s+=('<input type="button" style="'+bs+'left:'+(bw+bsp)+'px;" value="Mirro" id="mirror_Board" onclick="mirrorBoard()">');
s+=('<input type="button" style="'+bs+'left:'+(2*bw+2*bsp)+'px;width:'+(w2-bw*2-2*bsp)+'px;" value="Save" onclick="EditSave()">');
s+=('</div>');
var scw=16;
// comm+var
var w3=w0-p0-(x1+w1+ps+w2+ps);
var ch=(ln-4)*lh-thh;
s+=('<div style="'+((wTitle!=500)?'display:none;':'')+'position:absolute;top:'+y1+'px;left:'+(x1+w1+ps+w2+ps)+'px;">');
s+=cDIV(0,0,w3,h1,0,bdColor,'','');
s+=cDIV(1,1,w3-2,h1-2,0,blColor,'','');
s+=cDIV(1,thh,w3-2,ch,0,brColor,'','');
s+=cDIV(6,1,w3-7,'',0,typ,'','Comment:<a href="javascript:TXTtoDhtmlXQ(cText)" title="Add Variation">AddVar</a> <a href="javascript:EditComment(cText)" title="Edit Comment" id="e_comm">\EditCom</a>');
s+=cDIV(2,thh+1,w3-3,ch-2,0,'overflow:'+(NS.IE&&NS.IE<5.5?'hidden':'auto')+';'+CPIMG,'id="c_scroll"','head');
s+=('<textarea id="c_text" style="height:'+(ch-2)+'px;overflow-y:scroll!important;overflow-y:'+(NS.IE&&NS.IE<5.5?'scroll':'visible')+';border:0;width:100%;padding-left:2px;background-color:transparent;" onblur="allowLR=true;" onfocus="allowLR=false;" ondblclick="this.select();"></textarea>');
s+=('</div>');
s+=cDIV(6,thh+ch+1,w3-7,'',0,typ,'','Variation:\u2000 <a href="javascript:UpMove()" title="Move up variation">Up</a>\u2000<a href="javascript:DownMove()" title="Move down variation">Dn</a>\u2000<a href="javascript:DelMove()" title="Delete variation">Del</a>');
s+=cDIV(1,thh+ch+thh,w3-2,4*lh+2,0,brColor,'','');
s+=cDIV(2,thh+ch+thh+1,w3-3,4*lh,0,'overflow:auto;'+CPIMG,'id="v_scroll"','head');
s+=('<div id="v_text" style="height:'+(4*lh+1)+'px;-moz-user-select:none;" onselectstart="return false;">'+ads_dpxq+'</div>');
s+=('</div>');
s+=('<input type="button" style="'+bs+'left:0;" value="Mini" onclick="ViewMini()">');
s+=('<input type="button" style="'+bs+'left:'+(bw+bsp)+'px;" value="Im/Ex" id="showsource" onclick="ViewSource()">');
s+=('<input type="button" style="'+bs+'left:'+(2*bw+2*bsp)+'px;width:'+(w3-bw*2-2*bsp)+'px;color:f00;" value="Search" id="showsearch" onclick="ViewSearch()">');
s+=('</div>');
// source
var w4=w2+w3+ps;
var ha=1;ch=ch-ha*lh;
s+=('<div id="sourceText" style="position:absolute;display:none;top:'+y1+'px;left:'+(x1+w1+ps)+'px;">');
s+=cDIV(0,0,w4,h1,0,bdColor,'','');
s+=cDIV(1,1,w4-2,h1-2,0,blColor,'','');
s+=cDIV(1,thh,w4-2,ch,0,brColor,'','');
s+=cDIV(6,1,w4-7,'',0,typ,'','Import Export');
s+=('<textarea id="source_Text" style="position:absolute;left:2px;top:'+(thh+1)+'px;width:'+(w4-3)+'px;height:'+(ch-2)+'px;'+CPIMG+'overflow-y:scroll;border:0;background-color:transparent;" onblur="allowLR=true;" onfocus="allowLR=false;" ondblclick="this.select();"></textarea>');
s+=cDIV(6,thh+ch+1,w4-7,'',0,typ,'','<a href="javascript:copycode(sText,0)" style="color:#f00">Copy code</a> <a href="javascript:setBinit(1)">Accept pos</a> <a href="javascript:setBinit(2)" style="color:#f00">Clear board</a> <a href="javascript:setBinit(3)">Start pos</a>');
s+=cDIV(1,thh+ch+thh,w4-2,(4+ha)*lh+2,0,brColor,'','');
s+=cDIV(2,thh+ch+thh+1,w4-3,(4+ha)*lh,0,'overflow-y:scroll;'+CPIMG,'','head');
s+=('<div style="position:absolute;left:4px;top:1px;">');
s+=('Export:<a href="javascript:getUBB()" Title="UBB for CCBridge">UBB</a> <a href="javascript:getFLASH(0)" style="color:#f00">FLASH</a> <a href="javascript:getHTML()">HTM</a> <a href="javascript:getJAVA()">JAVA</a> <a href="javascript:getIFRAME()">FRAME</a> <a href="javascript:TreeSet(1)" style="color:#f00">Text</a>');
s+=('<br>Export:<a href="javascript:getFLASH(4)" Title="Flash use Embed into forum"><span style="color:#F00">embed</span>FLASH</a> <a href="javascript:getFLASH(1)">\u641C\u72D0</a> <a href="javascript:getFLASH(2)" style="color:#F00">QQ\u7A7A\u95F4</a> <a href="javascript:getFLASH(3)">\u5E38\u89C1\u8BBA\u575B</a>');
s+=('<br>ExportPOS:<a href="javascript:getIMGTEXT()">Text</a> <a href="javascript:getANIGIF()">ANIGIF</a> <a href="javascript:getFENTEXT()">Text FEN</a> <a href="javascript:getXQSJTEXT()">XQSJTEXT</a>');
s+=('<br>InportPOS:<a href="javascript:getBinit(\'xqstudio\')">XQstudio</a> <a href="javascript:getBinit(\'xqqb\')">FEN</a> <a href="javascript:getBinit(\'xqsj\')">\u4E16\u5BB6</a>');
s+=('<br>Add Pieces:<span id="addred"><a href="javascript:addQizi(\'0_8\')" Title="Select Red Rook">\u8F66</a><a href="javascript:addQizi(\'1_7\')" Title="Select Red Horse">\u9A6C</a><a href="javascript:addQizi(\'9_10\')" Title="Select Red Cannon">\u70AE</a><a href="javascript:addQizi(\'11_12_13_14_15\')" Title="Select Red Pawn">\u5175</a><a href="javascript:addQizi(\'2_6\')" Title="Select Red Elephant">\u76F8</a><a href="javascript:addQizi(\'3_5\')" Title="Select Red Advisor">\u4ED5</a><a href="javascript:addQizi(\'4\')" Title="Select Red King">\u5E05</a></span> <a href="javascript:addQizi(\'16_24\')" Title="Select Black \u8F66">\u8F66</a><a href="javascript:addQizi(\'17_23\')" Title="Select Black \u9A6C">\u9A6C</a><a href="javascript:addQizi(\'25_26\')" Title="Select Black \u70AE">\u70AE</a><a href="javascript:addQizi(\'27_28_29_30_31\')" Title="Select Black \u5352">\u5352</a><a href="javascript:addQizi(\'18_22\')" Title="Select Black \u8C61">\u8C61</a><a href="javascript:addQizi(\'19_21\')" Title="Select Black \u58EB">\u58EB</a><a href="javascript:addQizi(\'20\')" Title="Select Black \u5C06">\u5C06</a>');
s+=('<form id="treetxt" action="" name="treetxt" style="display:none;background-color:#fff;position:absolute;top:0;left:0;">');
s+=('\u70B9\u94FE\u63A5\u8BBE\u7F6E\u53D8\u7740\u6587\u672C\u53C2\u6570--><a href="javascript:getTEXT(1)" style="color:#00f">\u786E\u8BA4\u5BFC\u51FA</a> <a href="javascript:TreeSet(0)" style="color:#f00">\u8FD4\u56DE</a>');
s+=('<br>\u5BFC\u51FA\u5185\u5BB9:<span id="nstart2"></span><a href="javascript:TreeSet(\'nstart\',0);" id="nstart0" style="color:#00f">\u25CE \u5168\u90E8</a> <a href="javascript:TreeSet(\'nstart\',1);" id="nstart1">\u25CE\u5F53\u524D\u5C40\u9762</a> <a href="javascript:getTEXT(\'\');" id="nstart3">\u25CE\u7B80\u5355\u6587\u672C</a>');
s+=('<br>\u5BFC\u51FA\u683C\u5F0F:<span id="stype3"></span><a href="javascript:TreeSet(\'stype\',1);" id="stype1" style="color:#00f">\u25CE \u6807\u51C6</a> <a href="javascript:TreeSet(\'stype\',0);" id="stype0">\u25CE\u5206\u79BB\u6A21\u5F0F</a> <a href="javascript:TreeSet(\'stype\',2);" id="stype2">\u25CE\u7D27\u51D1\u6A21\u5F0F</a>');
s+=('<br>\u6BCF\u884C\u5217\u6570:<span id="col0"></span><a href="javascript:TreeSet(\'col\',1);" id="col1" style="color:#00f">\u25CE \u4E00\u5217</a> <a href="javascript:TreeSet(\'col\',2);" id="col2">\u25CE\u6BCF\u884C\u4E8C\u5217</a> <a href="javascript:TreeSet(\'col\',3);" id="col3">\u25CE\u6BCF\u884C\u4E09\u5217</a>');
s+=('<br>\u70B9\u51FB\u76F8\u5E94\u5BFC\u51FA\u683C\u5F0F\u94FE\u63A5\u7136\u540E\u70B9\u786E\u8BA4\u5BFC\u51FA\u5373\u53EF');
s+=('<br>\u6CE8\u89E3\u884C\u9996 <input type="text" name="zhustr" value="0"> \u7740\u6CD5\u884C\u9996 <input type="text" name="lspace" value="4"> \u7740\u6CD5\u884C\u5C3E <input type="text" name="rspace" value="0">');
s+=('<br>\u56DE\u5408\u5185\u5DE6 <input type="text" name="lpad" value="1"> \u56DE\u5408\u5185\u53F3 <input type="text" name="rpad" value="1"> \u56DE\u5408\u4E4B\u95F4 <input type="text" name="mspace" value="3">');
s+=('<br>\u6CE8\u89E3\u6807\u793A <input type="text" name="zhujie" value="*"> \u53D8\u7740\u6807\u793A <input type="text" name="bianzhao" value="B"> \u53D8\u7740\u5C42\u6570 <input type="text" name="maxdepth" value="999">');
s+=('<br>\u6E05\u9664\u7A7A\u9879 <input type="text" name="delempty" value="1"> \u7740\u6570\u8BB0\u6570 <input type="text" name="istwo" value="0"> \u6309\u5C42\u7F16\u53F7 <input type="text" name="bianhao" value="1">');
s+=('<br><input type="hidden" name="nstart" value="0"><input type="hidden" name="stype" value="1"><input type="hidden" name="col" value="1">');
s+=('</form>');
s+=('</div></div>');
s+=('</div>');
// search
s+=('<div id="searchText" style="position:absolute;display:none;top:'+y1+'px;left:'+(x1+w1+ps)+'px;">');
s+=cDIV(0,0,w4,h1,0,bdColor,'','');
s+=cDIV(1,1,w4-2,h1-2,0,blColor,'','');
s+=cDIV(1,thh,w4-2,ln*lh+2,0,brColor,'','');
s+=cDIV(6,1,w4-7,'',0,'padding-top:1px!important;padding-top:2px;line-height:'+(thh-2)+'px;','','\u68CB\u8C31\u641C\u7D22');
s+=cDIV(2,thh+1,w4-3,ln*lh,0,''+CPIMG,'id="search_Text"','');
s+=('</div>');
// other
s+=('<div style="position:absolute;top:'+(h0+3)+'px;left:'+p0+'px;">');
s+=(' <div id="div16" style="position:relative;text-align:left;height:'+(lh*2+3)+'px;width:'+tWidth+'px;overflow:hidden;"></div>');
s+=(' <textarea id="showText" onblur="allowLR=true;" onfocus="allowLR=false;" ondblclick="this.select();" style="padding:1px;overflow-y:scroll;background-color:#fff;height:'+Math.max(aHeight-p0-(h0+lh*2+6),0)+'px;width:'+tWidth+'px;'+CPIMG+'"></textarea>');
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"><input type="text" name="f"></form>');
s+=('</div>');
DIVS.innerHTML=s;
DIVS.style.width=wm;
DIVS.style.height=aHeight;
TT[3]=Number(new Date());
}
function Conv_Ver2(S,MP)
{
if (!MP)
{
var r=eval('/\\[DhtmlXQ_movelist\\](.+'+REOK+')\\[\\/DhtmlXQ_movelist\\]/gi');
MP=S.match(r);
if (MP==null) return S;
else MP=MP[0].replace(r,'$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=['0_1'],MOVE=[''],i,l,M1,M2,MI=0,MII=[],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]=(M2>0&&MII[M2].split('_')[0]==MII[M2-1].split('_')[0])?MII[M2]:M[MII[M2].split('_')[0]];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(eval('/\\[DhtmlXQ_(comment\\d+|move\\w+)\\].*'+REOK+'\\[\\/DhtmlXQ_\\1\\]/gi'),'')+M.join('\r\n');
return S;
}
function initdata()
{
TT[4]=Number(new Date());
clearInterval(Livetimer);
clearInterval(Livetime);
clearInterval(timer);
showClick(10,9);
$('divsave').style.display='none';
$('autoplay').value='Auto';
$('turn_Board').style.color='';
$('mirror_Board').style.color='';
Mscroll=$('m_scroll');
MoveDIV=$('m_text');
VarDIV=$('v_text');
sText=$('source_Text');
sText1=$('showText');
cText=$('c_text');
// initvar
if (getvar('hidemove')) HideMove();
ViewUrl=getvar('viewurl');
refer='';
pClick='';
pCid=-1;
cnum=32;
nnum=0;
fnum=0;
lnum=0;
allowLR=true;
isTurn=false;
canauto=true;
LiveAdmin=false;
LiveID=0;
CSS=true;
isMirror=false;
isAddMove=false;
BPos=[];
AllowAdd=32;
sMI='0_1_0'.split(' ');
pMI='0_1_0'.split(' ');
D400=''.split('');
D400[1000]='';
P90=' '.replace(/ /gi,' ').replace(/ /gi,'99').match(/\d\d/gi);
P=(getvar('binit').replace(/\D/gi,'9')+B).match(/\d{64}/);
hits=getvar('hits');
if (hits!='') hits='\u6D4F\u89C8 '+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);
UBB=UBB.replace(/\[DhtmlXQ_comment(\d+)\](.+)\[\/DhtmlXQ_comment\1\]/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'),10);
if (isNaN(fnum)) fnum=0;
if (lnum>999) lnum=999;
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--;
$('z'+i).style.left=(x*qgdx)+((x==9)?qgdx:0);
$('z'+i).style.top=(y*qgdx);
P90[x*10+y]=i;
}
if (PVer<getvar('pver')) xqtitle=('\u8BF7[<a href="http://www.dpxq.com/hldcg/dhtmlxq/" target="_black" style="color:#f00">\u70B9\u6B64\u4E0B\u8F7D</a>]\u6700\u65B0\u68CB\u76D8\u652F\u6301\u6587\u4EF6 <a href="javascript:getInfo()">\u7248\u672C\u4FE1\u606F</a>');
else xqtitle=getvar('title').replace(/</g,'<');
$('div1').style.fontSize=(wTitle==240||xqtitle.replace(/[^\x00-\xff]/gi,'xx').length*(fzt/2)>tWidth)?fz:fzt;
$('div1').innerHTML=xqtitle;
MoveDIV.innerHTML='<div id="move_0" onmouseup="gotonum(0)" style="background-color:'+bsColor+';color:#fff;">-->Start'+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+=('\r\n<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;
var f=ViewUrl.match(/f=\d{1,3}[_\d]*/gi);
gotoMI((f!=null)?f[0].substr(2):(''+fnum));
if (NoFile)
{
if (location.href.search(/(live|room)=yes/gi)!=-1) refer=$('refer').innerHTML;
else if (document.referrer)
{
refer=document.referrer;
if (refer!='') refer=URLEscape(refer.replace(/(\w:\/+[^\/]+)(\/.*)?/gi,'$1')+'/\r\n'+refer);
}
}
else
{
refer=parent.location.href;
if (refer.search(/\/hldcg\/chess\/(view\.htm|live\/[mnu]_\d+\.html)/gi)!=-1)
{
refer=$P('refer').innerHTML;
}
else
{
if (refer.search(/dhtml\w{3}\.asp\?f=.+/gi)!=-1) refer=parent.parent.location.href;
refer=URLEscape(location.protocol+'//'+location.hostname+'/\r\n'+refer);
}
}
if (refer=='') refer=getvar('refer');
if (refer=='') refer=URLEscape('http://www.dpxq.com/\r\nhttp://www.dpxq.com/hldcg/search/');
getSEARCH();var div16=$('div16');
if (getvar('class')=='\u5BF9\u5C40\u76F4\u64AD') {div16.innerHTML=getvar('livetext');sText1.value='';LiveMain();}
else {div16.innerHTML=getrefer();if (aHeight>=w0||isSP||window==top) {getTEXT(getvar('txttype'));}}
if (isSP) {var l=parent.UBBS.length;if(l>=10)parent.UBBS[l-10]='';parent.UBBS[l]=UBB;}
TT[5]=Number(new Date());
}
function conv_ev(ev)
{
var ev=ev.match(/\d\d/gi),i;
if (ev==null) return '';
if (isMirror&&isTurn) {for (i=0;i<ev.length;i++) if (ev[i]<'90') 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]<'90') 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]<'90') ev[i]=(189-ev[i]).toString().substr(1);}
return ev.join('');
}
function CP(p)
{
var b=p.match(/\d\d/gi),a=p.match(/\d\d/gi);
if (b[0]<b[8]) {a[8]=b[0];a[0]=b[8];}
if (b[1]<b[7]) {a[7]=b[1];a[1]=b[7];}
if (b[2]<b[6]) {a[6]=b[2];a[2]=b[6];}
if (b[3]<b[5]) {a[5]=b[3];a[3]=b[5];}
if (b[9]<b[10]) {a[10]=b[9];a[9]=b[10];}
if (b[16]>b[24]) {a[24]=b[16];a[16]=b[24];}
if (b[17]>b[23]) {a[23]=b[17];a[17]=b[23];}
if (b[18]>b[22]) {a[22]=b[18];a[18]=b[22];}
if (b[19]>b[21]) {a[21]=b[19];a[19]=b[21];}
if (b[25]>b[26]) {a[26]=b[25];a[25]=b[26];}
return p=a.slice(0,11).join('')+b.slice(11,16).sort().reverse().join('')+a.slice(16,27).join('')+b.slice(27,32).sort().join('');
}
function showClick(x,y)
{
$('z32').style.left=x*qgdx;
$('z32').style.top=y*qgdx;
}
function getMove(ev)
{
var p,i,r,m,c=ev.split('');
p=conv_ev(getpos(1)).replace(/(\d\d)/gi,'$1_');
if (AllowAdd<32)
{
if (p.indexOf(ev)>=0) showalert('\u6B64\u5904\u6709\u68CB\u5B50');
else {p=p.split('_');p[AllowAdd]=ev;p=p.join('');DrawPOS(p);setBinit();AllowAdd=32;}
return;
}
CSS=false;
if (ev.length==4) pClick=ev;
else if (ev.length==2) pClick+=conv_ev(ev);
else return;
if (pCid>=0) {showClick(10,9);pCid=-1;}
if (pClick.length%4==2)
{
ev=pClick.substr(pClick.length-2);
pCid=p.indexOf(ev);
if (pCid>0) pCid=pCid/3;
if (pCid>=0) showClick(c[0],c[1]);
else pClick=pClick.replace(/\d\d$/gi,'');
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!=''&&((LiveID<=0)||(LiveID>0&&(LiveAdmin||ev.length==4))))
{
if (nnum==lnum)
{
lnum++;
move+=PT;
sMI[lnum]=sMI[nnum];
pMI[lnum]=sMI[nnum];
if (!$('move_'+lnum))
MoveDIV.innerHTML+=('\r\n<div id="move_'+lnum+'" onmouseup="gotonum('+lnum+')">'+((nnum%2==0)?(' '+(nnum/2+1)+'.').replace(/.*(.{4})$/gi,'$1'):(' ')).replace(/ /gi,' ')+move_ev+' </div>');
r=eval('/\\[(DhtmlXQ_move_'+sMI[nnum]+')\\](.*)\\[\\/\\1\\]/gi');
UBB=UBB.replace(r,'[$1]$2\$MOVE[/$1]').replace('$MOVE',PT);
UpData();
if (NS=='Safari'&&nnum<14) Mscroll.scrollTop=0;
gotonum('Next');
LiveMovePost('move$$$'+move);
}
else if (PT==move.substr(nnum*4,4)) gotonum('Next');
else if (PT==getvar('move_'+pMI[nnum+1]).substr((nnum-pMI[nnum+1].split('_')[1])*4+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)
{
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+='\r\n[DhtmlXQ_move_'+m+']'+ev+'[/DhtmlXQ_move_'+m+']';
UpData();
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)
{
var v=$('var_'+sMI[nnum]);
var r='<div style="position:absolute;top:0;left:0;background-color:'+bsColor+';"><a href=javascript:getMove("'+m+'") style="margin-left:2px;line-height:'+(lh-1)+'px!important;line-height:'+(lh-2)+'px;color:#ff0;">Add Variation '+cm+'</a></div>';
if (v!=null) v.innerHTML+=r;
else if (nnum==0) VarDIV.innerHTML=r;
else VarDIV.innerHTML+=r;
}
function auto_search()
{
if ($P('auto_search')) eval($P('auto_search').value);
if ($P('auto_getpos')) eval($P('auto_getpos').value);
}
function UpData()
{
if (NoFile) self.name='NoFile_[DhtmlXQiFrame]'+UBB+'[/DhtmlXQiFrame]';
else $P(self.name.substr(5)).innerHTML=UBB;
}
function gotoMI(gMI)
{
gMI=gMI.split('_');
var m=[];
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==999||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) {