-
Notifications
You must be signed in to change notification settings - Fork 0
/
eHlpDhtm.js
4324 lines (3777 loc) · 120 KB
/
eHlpDhtm.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
// eHelp?Corporation Dynamic HTML JavaScript
// Copyright?1998-2003 eHelp?Corporation.All rights reserved.
// Version=5.0
// Warning:Do not modify this file.It is generated by RoboHELP?and changes will be overwritten.
//// Segment Begin -- (JavaScript 1.0)
/// Section Begin - General and relative topics(JavaScript 1.0)
//{{HH_SYMBOL_SECTION
var HH_ChmFilename = "C:\\Users\\Administrator\\Documents\\WinCHM Projects\\Project5_output\\HTML Help\\VISUAL DMIS使用帮助手册.chm";
var HH_WindowName = "main";
var HH_GlossaryFont = ",8,0";
var HH_Glossary = "0";
var HH_Avenue = "0";
var HH_ActiveX = false;
//}}HH_SYMBOL_SECTION
//Begin to support previous generic parameters
//Get the information about the browser.
var gstrBsAgent = navigator.userAgent.toLowerCase();
var gnBsVer = parseInt(navigator.appVersion);
var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1);
var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1);
var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1);
var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
var gbBsMac = (gstrBsAgent.indexOf('mac') != -1);
var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));
var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1);
var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2));
var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3));
var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2));
var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3));
var gbBsIE300301 = ((gbBsIE) && (gnBsVer == 2) && ((gstrBsAgent.indexOf("3.00") != -1)||(gstrBsAgent.indexOf("3.0a") != -1)||(gstrBsAgent.indexOf("3.0b")!=-1)||(gstrBsAgent.indexOf("3.01")!=-1)));
var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));
var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4));
var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5));
var gbBsNS7 = false;
var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4));
var gbBsIE5 = false;
var gbBsIE55 = false;
var gbBsOpera6 = false;
var gbBsOpera7 = false;
var gbBsKonqueror3 = false;
gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;;
if (gbBsIE)
{
if (parseInt(navigator.appVersion) >= 4) {
gbBsIE4 = true;
if (gbBsIE4) {
var nPos = gstrBsAgent.indexOf("msie");
var strIEversion = gstrBsAgent.substring(nPos + 5);
var nVersion = parseFloat(strIEversion);
if (nVersion >= 5)
gbBsIE5 = true;
if (nVersion >= 5.5)
gbBsIE55 = true;
}
}
}
if (gbBsNS6)
{
var nPos=gstrBsAgent.indexOf("gecko");
if(nPos!=-1)
{
var nPos2=gstrBsAgent.indexOf("/", nPos);
if(nPos2!=-1)
{
var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1));
if (nVersion>=20020823)
gbBsNS7=true;
}
}
}
if (gbBsOpera)
{
var nPos = gstrBsAgent.indexOf("opera");
if(nPos!=-1)
{
var nVersion = parseFloat(gstrBsAgent.substring(nPos+6));
if (nVersion >= 6)
{
gbBsOpera6=true;
if (nVersion >=7)
gbBsOpera7=true;
}
}
}
if (gbBsKonqueror)
{
var nPos = gstrBsAgent.indexOf("konqueror");
if(nPos!=-1)
{
var nVersion = parseFloat(gstrBsAgent.substring(nPos+10));
if (nVersion >= 3)
{
gbBsKonqueror3=true;
}
}
}
function insertAdjacentHTML(obj, where, htmlStr)
{
if (gbBsIE || gbBsOpera7)
{
obj.insertAdjacentHTML(where, htmlStr);
}
else if (gbBsNS6 || gbBsSafari)
{
var r = obj.ownerDocument.createRange();
r.setStartBefore(obj);
var parsedHTML = r.createContextualFragment(htmlStr);
switch (where){
case 'beforeBegin':
obj.parentNode.insertBefore(parsedHTML,obj);
break;
case 'afterBegin':
obj.insertBefore(parsedHTML,obj.firstChild);
break;
case 'beforeEnd':
obj.appendChild(parsedHTML);
break;
case 'afterEnd':
if (obj.nextSibling){
obj.parentNode.insertBefore(parsedHTML,obj.nextSibling);
} else {
obj.parentNode.appendChild(parsedHTML);
}
break;
}
}
}
// Utilities functions.
function BsscHasExtJs()
{
if( gbBsIE3Before || gbBsNS3Before)
return false;
return true;
}
// Register event handler
var gBsOnLoads = new Array(); // An array holds all the onload event handler.
var gBsOnClicks = new Array(); // An array holds all the onClick event handler.
var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler.
var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler.
var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler.
var gbOrignalOnMouseDown = null;
function BsscRegisterOnLoad(funcHandler)
{
var nLength = gBsOnLoads.length;
gBsOnLoads[nLength] = funcHandler;
}
function BsscRegisterOnClick(funcHandler)
{
var nLength = gBsOnClicks.length;
gBsOnClicks[nLength] = funcHandler;
}
function BsscRegisterOnUnLoad(funcHandler)
{
var nLength = gBsOnUnLoads.length;
gBsOnUnLoads[nLength] = funcHandler;
}
function BsscRegisterOnMouseOver(funcHandler)
{
var nLength = gBsOnMouseOvers.length;
gBsOnMouseOvers[nLength] = funcHandler;
}
function BsscRegisterOnMouseOut(funcHandler)
{
var nLength = gBsOnMouseOuts.length;
gBsOnMouseOuts[nLength] = funcHandler;
}
function BsGeneralOnLoad()
{
if (!gbBsIE4 && !gbBsNS4)
return;
// Make everything visible in navigator
if (gbBsNS4 && !gbBsNS6) {
// Make some special effects items visible
for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
document.layers[iLayer].visibility = "show";
document.layers[iLayer].left = 0;
}
}
}
// If resize the netscape browser, need to reload it.
function BsReDo()
{
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
// End of the local functions.
// The following functions are used by the html files.
function BSSCOnLoad()
{
if( !BsscHasExtJs() )
return;
for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)
gBsOnLoads[nElement]();
}
function BSSCOnClick()
{
if (!BsscHasExtJs()) return;
for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)
gBsOnClicks[nElement]();
}
function BSSCOnUnload()
{
if (!BsscHasExtJs()) return;
for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)
gBsOnUnLoads[nElement]();
}
function BSSCOnMouseOver()
{
if (!BsscHasExtJs()) return;
for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)
gBsOnMouseOvers[nElement]();
}
function BSSCOnMouseOut()
{
if (!BsscHasExtJs()) return;
for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)
{
gBsOnMouseOuts[nElement]();
}
}
// End of invocation of the event handle functions.
// Add the GereralOnLoad to the onload array.
if (typeof(BsscRegisterOnLoad) != "undefined")
{
BsscRegisterOnLoad(BsGeneralOnLoad);
}
if (gbBsNS4&&!gbBsNS6) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = BsReDo;
}
//End to support previous generic parameters
//Begin to support previous HHActiveX invoking
function BsHHActivateComponents()
{
if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
{
var objBody = getElementsByTag(document,"BODY")[0];
if( typeof(objBody) == "object" )
{
insertAdjacentHTML(objBody, "beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
if (HHComponentActivator.object)
HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
}
}
}
function BsHHActivXOnLoad()
{
if( gbBsIE4 )
BsHHActivateComponents();
}
if( typeof(BsscRegisterOnLoad) != "undefined" )
{
BsscRegisterOnLoad(BsHHActivXOnLoad);
}
//End to support previous HHActiveX invoking
//Begin to support previous relative topics
//If webHelp needs Related Topics DHTMLcode, it's supposed to add it here
var gbPopupMenuTimeoutExpired = false;
var gbInPopupMenu = false;
var gbPopupMenuTopicList = null;
var gOlddocumentClick = null;
//////////////////////////////////////////////////////////////////////////////////////////
//
// Popup Menu code
//
//////////////////////////////////////////////////////////////////////////////////////////
var g_bIsPopupMenuInit = false;
function _WritePopupMenuLayer()
{
if (!g_bIsPopupMenuInit)
{
if (gbBsNS4&&!gbBsNS6) {
//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...
document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
} else{
document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
if (!(gbBsNS4&&!gbBsNS6)) {
document.write("<STYLE TYPE='text/css'>");
if (gbBsMac&&gbBsIE4) {
document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
} else {
document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
}
document.write("</STYLE>");
}
}
g_bIsPopupMenuInit = true;
}
}
//Seek for the bsscright frame
function _SeekFrameByName( cRoot, strName )
{
if( cRoot == null ) return null;
if( cRoot.frames == null ) return null;
if( cRoot.frames[strName] != null ) return cRoot.frames[strName];
for (var i=0; i<cRoot.frames.length; i++)
{
var cObj = null;
if (!gbBsNS6)
cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
else
cObj = _SeekFrameByName( cRoot.frames[i], strName );
if( cObj != null ) return cObj;
};
return null;
}
function _GetFrameByName( cRoot, strName )
{
if( cRoot == null ) return null;
var cRet = _SeekFrameByName(cRoot, strName);
if( cRet != null ) return cRet;
if (cRoot.parent != cRoot)
return _GetFrameByName( cRoot.parent, strName );
else
return null;
}
var gfn_arguments = null;
function _PopupMenu_Invoke(fn_arguments)
{
gfn_arguments = fn_arguments;
if (gbBsOpera6&&gbBsMac)
{
var wndOldPopupLinks= window.open(document.location.href, "popuplinks");
wndOldPopupLinks.close();
setTimeout("_PopupMenu_Invoke_2();",100);
}
else
{
_PopupMenu_Invoke_2();
}
}
function _PopupMenu_Invoke_2()
{
var fn_arguments = gfn_arguments;
gfn_arguments = null;
// Make sure we have reasonable arguments
var argLen = fn_arguments.length;
if (argLen < 3) {
return false;
}
// Check to see if we only have one target
var strTarget = "";
var targetDoc = null;
if (fn_arguments[1] == '') {
if (BSSCPopup_IsPopup()) {
targetDoc = parent;
strTarget = "TARGET= _parent";
}
else
targetDoc = window.document;
} else {
targetDoc = _GetFrameByName( parent, fn_arguments[1] );
strTarget = "TARGET='" + fn_arguments[1] + "'";
}
if ((!gbBsIE4 && !gbBsNS4 && !gbBsOpera7 && !gbBsKonqueror3 &&!gbBsSafari) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {
var argLen = fn_arguments.length;
// Create the window that the hyperlinks will go into
var nHeight = argLen * 15;
var nWidth = 400;
var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
strParam += ",height=" + nHeight + ",width=200";
strParam += ",resizable";
var wndTemp=null;
// Create a temporary window first to ensure the real popup comes up on top
if (!gbBsOpera)
wndTemp = window.open("", "temp", strParam);
// Create the real popup window
var wndPopupLinks=null;
if (gbBsOpera&&gbBsMac)
{
wndTemp = window.open(document.location.href, "temp", strParam);
wndPopupLinks= window.open(document.location.href, "popuplinks", strParam);
}
else
wndPopupLinks= window.open("", "popuplinks", strParam);
wndPopupLinks.document.open("text/html");
// Close the temporary
if (wndTemp)
wndTemp.close();
var sHTML="<html><head></head>";
sHTML+="<body onBlur=\'self.focus();\'>";
var strParaLine = "";
for (var i = 0; i < (argLen - 2) / 2; i++) {
strParaLine = "";
strParaLine += "<a href=\"javascript:";
if (gbBsIE) {
strParaLine += "onBlur=null; ";
}
strParaLine += "opener.location=\'";
strParaLine += fn_arguments[2 * i + 3];
strParaLine += "\';close();\"";
strParaLine += strTarget;
strParaLine += ">";
strParaLine += fn_arguments[2 * i + 2];
strParaLine += "</a>";
strParaLine += "<br>";
sHTML+=strParaLine;
}
sHTML+="</body></html>";
wndPopupLinks.document.write(sHTML);
wndPopupLinks.document.close();
window.gbInPopupMenu = true;
if (!gbBsIE) {
wndPopupLinks.focus();
}
return false;
}
if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
// Get the place that we will be putting the topic into
var strURL = "";
if (isNaN(fn_arguments[2]) || (gbPopupMenuTopicList == null)) {
strURL = fn_arguments[3];
}
else {
strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;
}
if (targetDoc != null) {
targetDoc.location.href = strURL;
}
else {
if (fn_arguments[1] != null && typeof(fn_arguments[1]) != "undefined")
window.open(strURL, fn_arguments[1]);
else
window.open(strURL);
}
window.gbInPopupMenu = true;
return false;
}
var strMenu = "";
if (gbBsNS4&&!gbBsNS6) {
strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
} else {
strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
if (gbBsMac) {
strMenu += ' CELLPADDING=4';
} else {
strMenu += ' CELLPADDING=2';
}
strMenu += ' BGCOLOR=#c0c0c0>';
}
// Add each of the items
var i = 2;
while (i <= argLen - 1) {
strMenu += '<TR><TD><NOBR>'
// If the destination is a number then look it up in the topic list
if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
} else {
strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
}
strMenu += ' onclick="PopupMenu_HandleClick(event);"';
strMenu += ' onmouseover="PopupMenu_Over(event);"';
strMenu += ' onmouseout="PopupMenu_Out(event);"';
strMenu += '>';
if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
} else {
strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
}
strMenu += '</A></DIV></NOBR></TD></TR>';
if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
i += 2;
} else {
i += 1;
}
}
strMenu += "</TABLE>";
if (gbBsMac) {
// totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
strMenu +="<TABLE></TABLE>";
}
var layerPopup = null;
var stylePopup = null;
var nEventX = 0;
var nEventY = 0;
var nWindowWidth = 0;
if (gbBsIE4 || gbBsOpera7) {
layerPopup = getElement("PopupMenu");
layerPopup.innerHTML = strMenu;
stylePopup = layerPopup.style;
_BSPSGetClientSize();
// Get the position of the item causing the event (relative to its parent)
nEventX = window.event.clientX;
nEventY = window.event.clientY;
if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
nEventY += document.body.scrollTop + 10;
} else {
nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
}
stylePopup.top = nEventY;
var nPopupWidth = layerPopup.scrollWidth;
if (gbBsMac) {
nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
}
if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
if (gBsClientWidth - nPopupWidth < 5) {
stylePopup.left = 5;
} else {
stylePopup.left = gBsClientWidth - nPopupWidth - 5;
}
} else {
stylePopup.left = nEventX + document.body.scrollLeft + 20;
}
stylePopup.visibility = "visible";
if (!gOlddocumentClick && document.onclick)
gOlddocumentClick = document.onclick;
document.onclick = PopupMenu_HandleClick;
} else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) {
layerPopup = getElement("PopupMenu");
layerPopup.style.visibility = "hidden";
if (gbBsNS6)
{
var e = fn_arguments[0];
nEventX = e.pageX;
nEventY = e.pageY;
}
else
{
nEventX = window.event.clientX;
nEventY = window.event.clientY;
}
_BSPSGetClientSize();
layerPopup.innerHTML = strMenu;
if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {
nEventY += 20;
} else {
nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
}
if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
nEventX = 5;
} else {
nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
}
} else {
nEventX += 20;
}
layerPopup.style.top = nEventY;
layerPopup.style.left = nEventX;
// set again to avoid the stupid frash in netscape 6.
layerPopup.innerHTML = strMenu;
layerPopup.style.visibility = "visible";
//window.captureEvents(Event.MOUSEDOWN);
if (!gOlddocumentClick && document.onclick)
gOlddocumentClick = document.onclick;
window.onclick = PopupMenu_HandleClick;
}
else if (gbBsNS4) {
layerPopup = document.layers.PopupMenu;
layerPopup.visibility = "hide";
stylePopup = layerPopup.document;
stylePopup.write(strMenu);
stylePopup.close();
var e = fn_arguments[0];
nEventX = e.pageX;
nEventY = e.pageY;
_BSPSGetClientSize();
if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
nEventY += 20;
} else {
nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
}
layerPopup.top = nEventY;
if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
nEventX = 5;
} else {
nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
}
} else {
nEventX += 20;
}
layerPopup.left = nEventX;
layerPopup.visibility = "show";
window.captureEvents(Event.MOUSEDOWN);
if (!gOlddocumentClick && document.onmousedown)
gOlddocumentClick = document.onmousedown;
window.onmousedown = PopupMenu_HandleClick;
}
window.gbInPopupMenu = true;
window.gbPopupMenuTimeoutExpired = false;
setTimeout("PopupMenu_Timeout();", 100);
return false;
}
function PopupMenu_Timeout()
{
window.gbPopupMenuTimeoutExpired = true;
}
function PopupMenu_Over(e)
{
if (gbBsIE4||gbBsOpera7)
e.srcElement.className = "PopupOver";
else if (gbBsNS6)
e.target.parentNode.className = "PopupOver";
return;
}
function PopupMenu_Out(e)
{
if (gbBsIE4||gbBsOpera7)
e.srcElement.className = "PopupNotOver";
else if (gbBsNS6)
e.target.parentNode.className = "PopupNotOver";
return;
}
function PopupMenu_HandleClick(e)
{
if (window.gbPopupMenuTimeoutExpired) {
window.gbInPopupMenu = false;
if (gbBsNS4 && !gbBsNS6) {
window.releaseEvents(Event.MOUSEDOWN);
}
var layerPopup = null;
if (gbBsNS4&&!gbBsNS6) {
layerPopup = document.layers.PopupMenu;
layerPopup.visibility = "hide";
} else {
layerPopup = getElement("PopupMenu");
layerPopup.style.visibility = "hidden";
}
if (gOlddocumentClick)
{
if (gbBsNS4 && !gbBsNS6)
document.onmousedown = gOlddocumentClick;
else
document.onclick = gOlddocumentClick;
}
}
return;
}
function BSSCPopup_ClickMac()
{
if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7))
{
var bClickOnAnchor = false;
var el;
if ((window.event != null) &&
(window.event.srcElement != null))
{
el = window.event.srcElement;
while (el != null)
{
if ((el.tagName == "A") || (el.tagName == "AREA")) {
bClickOnAnchor = true;
break;
}
if (el.tagName == "BODY") {
break;
}
el = getParentNode(el);
}
}
if (BSSCPopup_IsPopup())
{
if (!bClickOnAnchor) {
parent.window.gPopupWindow = null;
self.close();
}
}
else
{
bClosePopupWindow = true;
if ((bClickOnAnchor) &&
(el.href) &&
((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
{
bClosePopupWindow = false;
}
if (bClosePopupWindow)
{
if (window.gPopupWindow != null && !window.gPopupWindow.closed )
{
window.gPopupWindow.close();
}
}
}
}
}
function BsPopupOnClick()
{
if (!gbBsIE4 && !gbBsOpera7)
return;
BSSCPopup_ClickMac();
}
function _BSSCOnError(message)
{
if(-1 != message.indexOf("denied")
|| -1 != message.indexOf("Object required"))
return true;
}
//End to support previous relative topics
/// Section End - General and relative topics (JavaScript 1.0)
/// Section Begin - Popup (JavaScript 1.0)
//Begin to support previous popup functions
//variables used to isolate the browser type
var gBsStyVisShow = null;
var gBsStyVisHide = null;
var gBsClientWidth = 640;
var gBsClientHeight = 480;
// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
var gBRateH_W = 0.618; // 1.618 Golden cut.
var gBMaxXOfParent = 0.8;
var gBMaxYOfParent = 0.8;
var gBscrollHeight = 16;
var gBscrollWidth = 16;
var gBpermitXDelta = 3;
var gBpermitYDelta = 3;
var arrayPopupURL = new Array();
var arrayAbsPopupURL = new Array();
var arrayDirty = new Array();
function setAbsPopupURL(nIndex, strURL)
{
arrayAbsPopupURL[nIndex] = strURL;
}
function getAbsPopupURL(nIndex)
{
if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
else
return arrayAbsPopupURL[nIndex];
}
function getPopupURL(nIndex)
{
if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
else
return arrayPopupURL[nIndex];
}
function getPopupID(nIndex)
{
return gstrPopupID + nIndex;
}
function getPopupShadowID(nIndex)
{
return gstrPopupShadowID + nIndex;
}
function getPopupTopicID(nIndex)
{
return gstrPopupTopicID + nIndex;
}
function getPopupIFrameID(nIndex)
{
return gstrPopupIFrameID + nIndex;
}
function getPopupIFrameName(nIndex)
{
return gstrPopupIFrameName + nIndex;
}
function getPopupTopicStyle(nIndex)
{
return getElement(getPopupTopicID(nIndex)).style;
}
function getPopupShadowStyle(nIndex)
{
return getElement(getPopupShadowID(nIndex)).style;
}
function getPopupIFrame(nIndex)
{
if (gbBsNS6)
return eval("window.frames['" + getPopupIFrameName(nIndex) + "']");
else
return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
}
function getPopupDivStyle(nIndex)
{
return getElement(getPopupID(nIndex)).style;
}
function getPopupIFrameStyle(nIndex)
{
return getElement(getPopupIFrameID(nIndex)).style;
}
function findDiv(strURL)
{
for (var i = 0; i < arrayPopupURL.length; i ++ ) {
if (arrayPopupURL[i] == strURL) {
return i;
}
}
return -1;
}
var gnToken = -1;
function takeToken()
{
gnToken ++;
if (gnToken > 10000) gnToken = 0;
return gnToken;
}
function IsValidToken(nToken)
{
return (gnToken == nToken);
}
function addDiv(strURL)
{
for (var i = 0; i < arrayPopupURL.length; i ++) {
if (arrayPopupURL[i] == null) {
arrayPopupURL[i] = strURL;
return i;
}
}
arrayPopupURL[i] = strURL;
arrayDirty[i] = true;
return i;
}
function setDirty()
{
for (var i = 0; i < arrayPopupURL.length; i ++ )
arrayDirty[i] = true;
}
function IsDirty(nIndex)
{
if (nIndex == -1)
return true;
else
if (arrayDirty.length > nIndex)
return arrayDirty[nIndex];
else
return true;
}
function hideAll()
{
for (var i = 0; i < arrayPopupURL.length; i ++ )
{
getPopupDivStyle(i).visibility = gBsStyVisHide;
getPopupIFrameStyle(i).visibility = gBsStyVisHide;
}
}
function getCurrentPopupIFrame()
{
for (var i = 0; i < arrayPopupURL.length; i ++)
if (getPopupDivStyle(i).visibility == gBsStyVisShow)
return getPopupIFrame(i);
return null;
}
function setClear(nIndex)
{
if (nIndex != -1)
arrayDirty[nIndex] = false;
}
function _BSSCCreatePopupDiv(strURL)
{
var nIndex = findDiv(strURL);
if (nIndex == -1 ) {
nIndex = addDiv(strURL);
BsPopup_CreateDiv(nIndex);
}
else {
if (IsDirty(nIndex)) {
if("object" == typeof(getPopupIFrame(nIndex).document))
getPopupIFrame(nIndex).document.location.href = strURL;
}
}
return nIndex;
}
//Here is the browser type
function _BSPSGetBrowserInfo()
{
if (gbBsNS4&&!gbBsNS6)
{
gBsStyVisShow = "show";
gBsStyVisHide = "hide";
}
else
{
gBsStyVisShow = "visible";
gBsStyVisHide = "hidden";
}
}
_BSPSGetBrowserInfo();
//Get client size info
function _BSPSGetClientSize()
{
if (gbBsNS4||gbBsKonqueror3||gbBsSafari)
{
gBsClientWidth = innerWidth;
gBsClientHeight = innerHeight;