home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 400616 / data1.cab / _lohnauskunft-Programm / lak32.chm / ehlpdhtm.js < prev    next >
Text File  |  2003-04-01  |  120KB  |  3,969 lines

  1. // eHelp« Corporation Dynamic HTML JavaScript 
  2. // Copyright⌐ 1998-2000 eHelp« Corporation.All rights reserved.
  3. // Version=4.45
  4. // patch 1
  5.  
  6. // Warning:Do not modify this file.It is generated by RoboHELP« and changes will be overwritten.
  7.  
  8. //// Segment Begin -- (JavaScript 1.0)
  9. /// Section Begin - General (JavaScript 1.0)
  10.  
  11. //{{HH_SYMBOL_SECTION
  12. var HH_ChmFilename = "D:\\LAK\\Hilfe\\LAK2003\\lak32.chm";
  13. var HH_WindowName = "main";
  14. var HH_GlossaryFont = "";
  15. var HH_Glossary = "0";
  16. var HH_Avenue = "0";
  17. var HH_ActiveX = false;
  18. //}}HH_SYMBOL_SECTION
  19.  
  20. //Begin to support previous generic parameters
  21. //Get the information about the browser.
  22. var gstrBsAgent     = navigator.userAgent.toLowerCase();
  23. var gnBsVer               = parseInt(navigator.appVersion);
  24.  
  25. var gbBsIE          = (gstrBsAgent.indexOf('msie') != -1);
  26. var gbBsNS          = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1));
  27. var gbBsOpera        = (gstrBsAgent.indexOf('opera') != -1);
  28.  
  29. var gbBsIE3Before     = ((gbBsIE) && (gnBsVer <= 2));
  30. var gbBsNS3Before     = ((gbBsNS) && (gnBsVer <= 3));
  31.  
  32. var gbBsNS2            = ((gbBsNS) && (gnBsVer <= 2));
  33. var gbBsNS3            = ((gbBsNS) && (gnBsVer == 3));
  34. 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)));
  35. var gbBsIE302        = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));
  36.  
  37. var gbBsNS4            = ((gbBsNS) && (gnBsVer >= 4));
  38. var gbBsNS6            = ((gbBsNS) && (gnBsVer >= 5));
  39.  
  40. var gbBsIE4            = ((gbBsIE) && (gnBsVer >= 4));
  41. var gbBsIE5            = ((gbBsIE) && (gnBsVer >= 5));
  42. var gbBsIE55        = false;
  43.  
  44. gbBsIE = (navigator.appName.indexOf("Microsoft") != -1);
  45. if (parseInt(navigator.appVersion) >= 4) {
  46.  
  47.     gbBsIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  48.  
  49.     if (gbBsIE4) {
  50.         if (gstrBsAgent.indexOf("msie 5.0") != -1) {
  51.             gbBsIE5 = true;
  52.         }
  53.         if (gstrBsAgent.indexOf("msie 5.5") != -1) { // curently IE 5.5 has some buggy stuff. we need do some remedy to our code.
  54.             gbBsIE55 = true;
  55.         }
  56.     }
  57. }
  58.  
  59. var gbBsMac            = (gstrBsAgent.indexOf('mac') != -1);
  60. var gbBsWindows        = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));
  61. var gbBsOp3            = (gstrBsAgent.indexOf('opera') != -1);
  62.  
  63. // Utilities functions.
  64. function BsscHasExtJs()
  65. {
  66.     if( gbBsIE3Before || gbBsNS3Before)
  67.         return false;
  68.     return true;
  69. }
  70.  
  71. // Register event handler
  72. var gBsOnLoads             = new Array();    // An array holds all the onload event handler.
  73. var gBsOnClicks         = new Array();    // An array holds all the onClick event handler.
  74. var gBsOnUnLoads         = new Array();    // An array holds all the OnUnLoad event handler.
  75. var gBsOnMouseOvers     = new Array();    // An array holds all the OnMouseOver event handler.
  76. var gBsOnMouseOuts         = new Array();    // An array holds all the OnMouseOut event handler.
  77.  
  78. var gbOrignalOnMouseDown = null;
  79.  
  80. function BsscRegisterOnLoad(funcHandler)
  81. {
  82.     var nLength = gBsOnLoads.length;
  83.     gBsOnLoads[nLength] = funcHandler;
  84. }
  85.  
  86. function BsscRegisterOnClick(funcHandler)
  87. {
  88.     var nLength = gBsOnClicks.length;
  89.     gBsOnClicks[nLength] = funcHandler;
  90. }
  91.  
  92. function BsscRegisterOnUnLoad(funcHandler)
  93. {
  94.     var nLength = gBsOnUnLoads.length;
  95.     gBsOnUnLoads[nLength] = funcHandler;
  96. }
  97.  
  98. function BsscRegisterOnMouseOver(funcHandler)
  99. {
  100.     var nLength = gBsOnMouseOvers.length;
  101.     gBsOnMouseOvers[nLength] = funcHandler;
  102. }
  103.  
  104. function BsscRegisterOnMouseOut(funcHandler)
  105. {
  106.     var nLength = gBsOnMouseOuts.length;
  107.     gBsOnMouseOuts[nLength] = funcHandler;
  108. }
  109.  
  110.  
  111. function BsGeneralOnLoad()
  112. {
  113.     if (!gbBsIE4 && !gbBsNS4)
  114.         return;
  115.  
  116.     // Make everything visible in navigator
  117.     if (gbBsNS4 && !gbBsNS6) {
  118.         // Make some special effects items visible
  119.         for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  120.             document.layers[iLayer].visibility = "show";
  121.             document.layers[iLayer].left = 0;
  122.         }
  123.     }
  124. }
  125.  
  126. // If resize the netscape browser, need to reload it.
  127. function BsReDo()
  128. {
  129.   if (innerWidth != origWidth || innerHeight != origHeight)
  130.      location.reload();
  131. }
  132. // End of the local functions.
  133.  
  134. // The following functions are used by the html files.
  135. function BSSCOnLoad()
  136. {
  137.     if( !BsscHasExtJs() )
  138.         return;
  139.     for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)
  140.         gBsOnLoads[nElement]();
  141. }
  142.  
  143. function BSSCOnClick()
  144. {
  145.     if (!BsscHasExtJs()) return;
  146.         
  147.     for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)
  148.         gBsOnClicks[nElement]();
  149. }
  150.  
  151. function BSSCOnUnload()
  152. {
  153.     if (!BsscHasExtJs()) return;
  154.     for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)
  155.     {
  156.         gBsOnUnLoads[nElement]();
  157.     }
  158. }
  159.  
  160. function BSSCOnMouseOver()
  161. {
  162.     if (!BsscHasExtJs()) return;
  163.     for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)
  164.     {
  165.         gBsOnMouseOvers[nElement]();
  166.     }
  167. }
  168.  
  169. function BSSCOnMouseOut()
  170. {
  171.     if (!BsscHasExtJs()) return;
  172.     for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)
  173.     {
  174.         gBsOnMouseOuts[nElement]();
  175.     }
  176. }
  177. // End of invocation of the event handle functions.
  178.  
  179.  
  180. // Add the GereralOnLoad to the onload array.
  181. if (typeof(BsscRegisterOnLoad) != "undefined")
  182. {
  183.     BsscRegisterOnLoad(BsGeneralOnLoad);
  184. }
  185. if (gbBsNS4) {
  186.     origWidth = innerWidth;
  187.     origHeight = innerHeight;
  188.     onresize = BsReDo;
  189. }
  190. //End to support previous generic parameters
  191.  
  192. //Begin to support previous HHActiveX invoking
  193. function BsHHActivateComponents()
  194. {
  195.     if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  196.     {
  197.         var objBody = document.all.tags("BODY")[0];
  198.         if( typeof(objBody) == "object" )
  199.         {
  200.             objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  201.             if (HHComponentActivator.object)
  202.                 HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  203.         }
  204.     }
  205. }
  206.  
  207. function BsHHActivXOnLoad()
  208. {    
  209.     if( gbBsIE4 )
  210.         BsHHActivateComponents(); 
  211. }
  212.  
  213. if( typeof(BsscRegisterOnLoad) != "undefined" )
  214. {
  215.     BsscRegisterOnLoad(BsHHActivXOnLoad);
  216. }
  217. //End to support previous HHActiveX invoking
  218.  
  219.  
  220. /// Section End - General (JavaScript 1.0)
  221.  
  222. /// Section Begin  - Popup and Related Topic (JavaScript 1.0)
  223.  
  224. //Begin to support previous popup functions
  225. //////////////////////////////////////////////////////////////////////////////////////////////
  226. //
  227. //    Begin DHTML Popup Functions
  228. //
  229. //////////////////////////////////////////////////////////////////////////////////////////////
  230. //variables used to isolate the browser type
  231. var gBsDoc            = null;            
  232. var gBsSty            = null;
  233. var gBsHtm            = null;
  234. var gBsStyVisShow    = null;
  235. var gBsStyVisHide    = null;
  236. var gBsClientWidth    = 640;
  237. var gBsClientHeight = 480;
  238. var gBsBrowser        = null;
  239.  
  240. // here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
  241. var gBRateH_W        = 0.618; // 1.618 Golden cut.
  242. var gBMaxXOfParent    = 0.8; 
  243. var gBMaxYOfParent    = 0.8;
  244. var gBscrollHeight   = 16;
  245. var gBscrollWidth   =  16;
  246. var gBpermitXDelta    = 3;
  247. var gBpermitYDelta    = 3;
  248.  
  249.  
  250. var arrayPopupURL = new Array();
  251. var arrayAbsPopupURL = new Array();
  252.  
  253. var arrayDirty = new Array();
  254.  
  255. function setAbsPopupURL(nIndex, strURL)
  256. {
  257.     arrayAbsPopupURL[nIndex] = strURL;
  258. }
  259.  
  260. function getAbsPopupURL(nIndex)
  261. {
  262.     if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
  263.     else 
  264.         return arrayAbsPopupURL[nIndex];
  265. }
  266.  
  267. function getPopupURL(nIndex)
  268. {
  269.     if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
  270.     else 
  271.         return arrayPopupURL[nIndex];
  272. }
  273.  
  274. function getPopupID(nIndex)
  275. {
  276.     return gstrPopupID + nIndex;
  277. }
  278.  
  279. function getPopupShadowID(nIndex)
  280. {
  281.     return gstrPopupShadowID + nIndex;
  282. }
  283.  
  284. function getPopupTopicID(nIndex)
  285. {
  286.     return gstrPopupTopicID + nIndex;
  287. }
  288.  
  289. function getPopupIFrameID(nIndex)
  290. {
  291.     return gstrPopupIFrameID + nIndex;
  292. }
  293.  
  294. function getPopupIFrameName(nIndex)
  295. {
  296.     return gstrPopupIFrameName + nIndex;
  297. }
  298.  
  299.  
  300. function getPopupTopicStyle(nIndex)
  301. {
  302.     return eval("document.all['" + getPopupTopicID(nIndex) + "']").style;
  303. }
  304.  
  305. function getPopupShadowStyle(nIndex)
  306. {
  307.     return eval("document.all['" + getPopupShadowID(nIndex) + "']").style;
  308. }
  309.  
  310. function getPopupIFrame(nIndex)
  311. {
  312.  
  313.     return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
  314. }
  315.  
  316. function getPopupDivStyle(nIndex)
  317. {
  318.     return eval("document.all['" + getPopupID(nIndex) + "']").style;
  319. }
  320.  
  321. function getPopupIFrameStyle(nIndex)
  322. {
  323.     return eval("document.all['" + getPopupIFrameName(nIndex) + "'].style");
  324. }
  325.  
  326.  
  327. function findDiv(strURL)
  328. {
  329.     var i = 0;
  330.     for (i = 0; i < arrayPopupURL.length; i ++ ) {
  331.         if (arrayPopupURL[i] == strURL) {
  332.             return i;
  333.         }
  334.     }
  335.     return -1;
  336. }
  337.  
  338. var gnToken = -1;
  339. function takeToken()
  340. {
  341.     gnToken ++;
  342.     if (gnToken > 10000) gnToken = 0;
  343.     return gnToken;
  344. }
  345.  
  346. function IsValidToken(nToken)
  347. {
  348.     return (gnToken == nToken);
  349. }
  350.  
  351. function addDiv(strURL)
  352. {
  353.     var i = 0; 
  354.     for (i = 0; i < arrayPopupURL.length; i ++) {
  355.         if (arrayPopupURL[i] == null) {
  356.             arrayPopupURL[i] = strURL;
  357.             return i;
  358.         }
  359.     }    
  360.     arrayPopupURL[i] = strURL;
  361.     arrayDirty[i] = true;
  362.     return i;
  363. }
  364.  
  365. function setDirty()
  366. {
  367.     var i = 0;
  368.     for (i = 0; i < arrayPopupURL.length; i ++ )
  369.         arrayDirty[i] = true;
  370. }
  371.  
  372. function IsDirty(nIndex)
  373. {
  374.     if (nIndex == -1)
  375.         return true;
  376.     else 
  377.         if (arrayDirty.length > nIndex) 
  378.             return arrayDirty[nIndex];
  379.         else
  380.             return true;
  381. }
  382.  
  383. function hideAll()
  384. {
  385.     var i = 0; 
  386.     for (i = 0; i < arrayPopupURL.length; i ++ )
  387.         getPopupDivStyle(i).visibility = gBsStyVisHide;
  388. }
  389.  
  390. function getCurrentPopupIFrame()
  391. {
  392.     var i = 0;
  393.     for (i = 0; i < arrayPopupURL.length; i ++)
  394.         if (getPopupDivStyle(i).visibility == gBsStyVisShow)
  395.             return getPopupIFrame(i);
  396.     return null;
  397. }
  398.  
  399. function setClear(nIndex)
  400. {
  401.     if (nIndex != -1)
  402.         arrayDirty[nIndex] = false;
  403. }
  404.  
  405. function _BSSCCreatePopupDiv(strURL)
  406. {
  407.     var nIndex = findDiv(strURL);
  408.     if (nIndex == -1 ) {
  409.         nIndex = addDiv(strURL);
  410.         BsPopup_CreateDiv(nIndex);
  411.     }
  412.     else {
  413.         if (IsDirty(nIndex)) {
  414.             if("object" == typeof(getPopupIFrame(nIndex).document))
  415.                 getPopupIFrame(nIndex).document.location.href = strURL;
  416.         }
  417.     }
  418.     return nIndex;
  419.  
  420. }
  421.  
  422. //the browser information itself
  423. function _BSPSBrowserItself()
  424. {
  425.     var agent  = navigator.userAgent.toLowerCase();
  426.     this.major = parseInt(navigator.appVersion);
  427.     this.minor = parseFloat(navigator.appVersion);
  428.     this.ns    = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  429.     this.ns2   = ((this.ns) && (this.major == 2));
  430.     this.ns3   = ((this.ns) && (this.major == 3));
  431.     this.ns4   = ((this.ns) && (this.major >= 4));
  432.     this.ns6   = ((this.ns) && (this.major >= 5));
  433.     this.ie       = (agent.indexOf("msie") != -1);
  434.     this.ie3   = ((this.ie) && (this.major == 2));
  435.     this.ie4   = ((this.ie) && (this.major >= 4));
  436.     this.op3   = (agent.indexOf("opera") != -1);
  437.  
  438.     if (this.ns4)
  439.     {
  440.         gBsDoc        = "document";
  441.         gBsSty        = "";
  442.         gBsHtm        = ".document";
  443.         gBsStyVisShow    = "show";
  444.         gBsStyVisHide    = "hide";
  445.  
  446.     }
  447.     else if (this.ie4)
  448.     {
  449.         gBsDoc         = "document.all";
  450.         gBsSty         = ".style";
  451.         gBsHtm         = "";
  452.         gBsStyVisShow    = "visible";
  453.         gBsStyVisHide    = "hidden";
  454.     }
  455. }
  456.  
  457. //Here is the browser type 
  458. function _BSPSGetBrowserInfo()
  459. {
  460.     gBsBrowser    = new _BSPSBrowserItself();
  461. }
  462.  
  463. //Get client size info
  464. function _BSPSGetClientSize()
  465. {
  466.     if (gBsBrowser.ns4)
  467.     {
  468.         gBsClientWidth    = innerWidth;
  469.         gBsClientHeight = innerHeight;
  470.  
  471.     }
  472.     else if (gBsBrowser.ie4)
  473.     {
  474.         gBsClientWidth    = document.body.clientWidth;
  475.         gBsClientHeight = document.body.clientHeight;
  476.     }
  477. }
  478.  
  479.  
  480. var gstrPopupID = 'BSSCPopup';
  481. var gstrPopupShadowID = 'BSSCPopupShadow';
  482. var gstrPopupTopicID = 'BSSCPopupTopic';
  483. var gstrPopupIFrameID = 'BSSCPopupIFrame';
  484. var gstrPopupIFrameName = 'BSSCPopupIFrameName';
  485.  
  486. var gstrPopupSecondWindowName = 'BSSCPopup';
  487.  
  488. var gPopupWindow = null;
  489. var gnPopupClickX = 0;
  490. var gnPopupClickY = 0;
  491.  
  492. var gnPopupScreenClickX = 0;
  493. var gnPopupScreenClickY = 0;
  494.  
  495. var gbPopupTimeoutExpired = false;
  496.  
  497.  
  498. function DHTMLPopupSupport()
  499. {
  500.     if ((gbBsIE4) && (!gbBsMac)) {
  501.         return true;
  502.     }
  503.     return false;
  504. }
  505.  
  506.  
  507.  
  508. function BSSCPopup_IsPopup()
  509. {
  510.     if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) {
  511.         return true;
  512.     } else if ((gbBsNS4 || gbBsIE4) && (this.name.indexOf(gstrPopupID) != -1)) {
  513.         return true;
  514.     } else {
  515.         return false;
  516.     }
  517. }
  518.  
  519.  
  520. // If there is a hyperlink in a popup window, display the hyperlink in
  521. // the original window.
  522. if (BSSCPopup_IsPopup() && !gbBsIE4) {
  523.     document.write("<base target=\"_parent\">");
  524. }
  525.  
  526. // Local functions.
  527. function BsPopup_CreateDiv(nIndex)
  528. {
  529.     if(!DHTMLPopupSupport())
  530.         return;
  531.     // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone.
  532.     var strPopupDiv = "<DIV ID='" + getPopupID(nIndex) + "' STYLE='position:absolute; top:-100; left:0; z-index:600; visibility:hidden;'>";
  533.     strPopupDiv += "<DIV ID='" + getPopupShadowID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0;  background-color:#C0C0C0;\"></DIV>";
  534.     strPopupDiv += "<DIV ID='" + getPopupTopicID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0;  background-color:#FFFFFF;border:1px #000000 outset;\">";
  535.     strPopupDiv += "<IFRAME ID='" + getPopupIFrameID(nIndex) + "' name='" + getPopupIFrameName(nIndex) + "' src = '" + getPopupURL(nIndex) + "' frameborder=0 scrolling=auto></IFRAME>";
  536.     strPopupDiv += "</DIV></DIV>";
  537.  
  538.     var objBody = document.all.tags("BODY")[0];
  539.     if( typeof(objBody) != "object" )
  540.         return;
  541.  
  542.     objBody.insertAdjacentHTML("beforeEnd", strPopupDiv);
  543. }
  544.  
  545. function BSSCPopup_Timeout(nIndex, nToken)
  546. {
  547.     if (!IsValidToken(nToken)) return;
  548.  
  549.     if ((getPopupIFrame(nIndex).document.readyState == "complete") &&
  550.         (getPopupIFrame(nIndex).document.body != null)) {
  551.         window.getPopupDivStyle(nIndex).visibility = gBsStyVisShow;
  552.         setClear(nIndex);
  553.         window.gbPopupTimeoutExpired = true;
  554.  
  555.         BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document);
  556.         getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked;
  557.  
  558.         if (gbOrignalOnMouseDown == null)
  559.             gbOrignalOnMouseDown = document.onmousedown;
  560.  
  561.         document.onmousedown = BSSCPopupParentClicked;
  562.  
  563.     } else {
  564.         setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100);
  565.     }
  566. }
  567.  
  568.  
  569. // VH 08/10/00 
  570. // do not change target to parent if the href is using javascript
  571. function BSSCPopup_ChangeTargettoParent(tagsObject)
  572. {
  573.     var collA = tagsObject.all.tags("A");
  574.     BSSCPopup_ChangeTargettoParent2(collA);
  575.  
  576.     var collIMG = tagsObject.all.tags("IMG");
  577.     BSSCPopup_ChangeTargettoParent2(collIMG);
  578. }
  579.  
  580. function BSSCPopup_ChangeTargettoParent2(colls)
  581. {
  582.     var j = 0;
  583.     if (colls != null)  {
  584.         for (j = 0; j < colls.length; j ++ )
  585.         {
  586.             var strtemp = colls[j].href;
  587.             strtemp = strtemp.toLowerCase();
  588.             if (strtemp.indexOf("javascript:") == -1)
  589.                 colls[j].target = "_parent";
  590.         }
  591.  
  592.     }
  593. }
  594.  
  595. function BSPSPopupTopicWinHelp(strURL)
  596. {
  597.     _BSSCPopup(strURL);
  598.     return;
  599. }
  600.  
  601. function _BSSCPopup(strURL, width, height)
  602. {
  603.     var cuswidth = 0;
  604.     var cusheight = 0;
  605.     if ("undefined" != typeof(width) && "undefined" != typeof(height)) {
  606.         cuswidth = width;
  607.         cusheight= height;
  608.     }
  609.     
  610.     if (DHTMLPopupSupport()) {
  611.         // If we are already in a popup, replace the contents
  612.     //    if (BSSCPopup_IsPopup()) {
  613.     //        parent._BSSCPopup(strURL, cuswidth, cusheight);
  614.     //    } else {
  615.             var nToken = takeToken(); // take  token first.
  616.             var nIndex = _BSSCCreatePopupDiv(strURL);
  617.             window.gbPopupTimeoutExpired = false;
  618.             var ntWidth = gBsClientWidth;
  619.             var ntHeight = gBsClientHeight;
  620.             _BSPSGetClientSize();
  621.             if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) {
  622.                 setDirty();
  623.             }
  624.  
  625.  
  626.             if (IsDirty(nIndex)) {
  627.                 if (gbBsMac) {
  628.                     setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight  +")", 400);
  629.                 } else {
  630.                     setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100);
  631.                 }
  632.             }
  633.             else {
  634.                 MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight);
  635.             }
  636.     //    }
  637.  
  638.     } else {
  639.         _BSSCPopup2(strURL, cuswidth, cusheight);
  640.     }
  641.     return;
  642. }
  643.  
  644.  
  645. function _BSSCPopup2(strURL, width, height)
  646. {
  647.     if (window.name == gstrPopupSecondWindowName) {
  648.         window.location = strURL;
  649.     } else {
  650.         if (!gbBsMac || !gBsBrowser.ns4) {
  651.             BSSCHidePopupWindow();
  652.         }
  653.         var nX = 0;
  654.         var nY = 0;
  655.         var nHeight = 300;
  656.         var nWidth = 400;
  657.         if (width > 0 && height > 0) {
  658.             nHeight = height;
  659.             nWidth = width;
  660.         }
  661.         _BSPSGetClientSize();
  662.  
  663.         nX = window.gnPopupScreenClickX;
  664.         nY = window.gnPopupScreenClickY;
  665.  
  666.         if (nY + nHeight + 40 > screen.availHeight) {
  667.             nY = screen.availHeight - nHeight - 40;
  668.         }
  669.         if (nX + nWidth + 40 > screen.availWidth) {
  670.             nX = screen.availWidth - nWidth - 40;
  671.         }
  672.         // Launch a separate window
  673.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
  674.         if (gBsBrowser.ns) {
  675.             if (gBsBrowser.ns6) {
  676.                 strParam += ",Height=" + nHeight + ",Width=" + nWidth;
  677.                 strParam += ",screenX=" + nX + ",screenY=" + nY;
  678.             }
  679.             else {
  680.                 strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
  681.                 strParam += ",screenX=" + nX + ",screenY=" + nY;
  682.                 strParam += ",dependent=yes";
  683.             }
  684.         }
  685.         else {
  686.             strParam += ",height=" + nHeight + ",width=" + nWidth;
  687.             strParam += ",left=" + nX + ",top=" + nY;
  688.         }
  689.         window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
  690.  
  691.         if (gBsBrowser.ns4) {
  692.             window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
  693.             window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  694.             window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
  695.         }
  696.         else if (gBsBrowser.ie4)
  697.         {
  698.             setTimeout("setPopupFocus();", 100);
  699.         }
  700.     }
  701.     return;
  702. }
  703.  
  704. function setPopupFocus()
  705. {
  706.     window.gPopupWindow.focus();
  707. }
  708.  
  709. function NonIEPopup_HandleBlur(e)
  710. {
  711.     window.gPopupWindow.focus();
  712. }
  713.  
  714. function NonIEPopup_HandleClick(e)
  715. {
  716.     // Because navigator will give the event to the handler before the hyperlink, let's
  717.     // first route the event to see if we are clicking on a Popup menu in a popup.
  718.     document.routeEvent(e);
  719.  
  720.     // If a popup menu is active then don't do anything with the click
  721.     if (window.gPopupWindow.gbInPopupMenu) {
  722.         window.gPopupWindow.captureEvents(Event.CLICK);
  723.         window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  724.         return false;
  725.     }
  726.  
  727.     // Close the popup window
  728.     if (e.target.href != null) {
  729.         window.location.href = e.target.href;
  730.         if (e.target.href.indexOf("javascript:void(0)") == -1 && e.target.href.indexOf("javascript:null") == -1 && e.target.href.indexOf("BsscPopup") == -1) {
  731.             this.close();
  732.         }
  733.     } else {
  734.         this.close();
  735.     }
  736.     return false;
  737.  
  738. }
  739.  
  740. function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight)
  741. {    
  742.     if (typeof(window.getPopupIFrame(nIndex).document) == "unknown") {
  743.         _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight);
  744.         return;
  745.     }
  746.     if (!IsValidToken(nToken)) return;
  747.  
  748.     if ((window.getPopupIFrame(nIndex).document.readyState == "complete") &&
  749.         (window.getPopupIFrame(nIndex).document.body != null)) {
  750.             if (window.getPopupIFrame(nIndex).document.location.href.indexOf("about:blank") != -1) { // add this check. IE will use about:blank" as the default vaule for Iframe.
  751.                 window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
  752.                 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
  753.             }
  754.             else
  755.                 {
  756.                     setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
  757.                     BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
  758.                 }
  759.     } else {
  760.         setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
  761.     }
  762. }
  763.  
  764.  
  765. function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight)
  766. {
  767.     if (window.gbPopupTimeoutExpired) return;
  768.  
  769.     if (!IsValidToken(nToken)) return;
  770.  
  771.     getPopupDivStyle(nIndex).visibility = gBsStyVisHide;
  772.  
  773.     // Determine the width and height for the window
  774.     //var size = new BSSCSize(0, 0);
  775.     //BSSCGetContentSize(window.getPopupIFrame(nIndex), size);
  776.     //var nWidth = size.x;
  777.     //var nHeight = size.y;
  778.  
  779.     _BSPSGetClientSize();
  780.     
  781.     var size = new BSSCSize(0, 0);
  782.  
  783.     if (cuswidth <= 0 || cusheight <= 0)
  784.         BSSCGetContentSize(window.getPopupIFrame(nIndex), size);
  785.     else {
  786.         size.x = cuswidth;
  787.         size.y = cusheight;
  788.     }
  789.  
  790.     // Determine the width and height for the window
  791.     var nWidth = size.x;
  792.     var nHeight = size.y;
  793.         
  794.     if (nWidth < 40 || nHeight < 40) return;  // there must be something terribly wrong.
  795.  
  796.     window.getPopupDivStyle(nIndex).pixelWidth = nWidth;
  797.     window.getPopupDivStyle(nIndex).pixelHeight = nHeight;
  798.  
  799.     window.getPopupShadowStyle(nIndex).pixelWidth = nWidth;
  800.     window.getPopupShadowStyle(nIndex).pixelHeight = nHeight;
  801.     window.getPopupTopicStyle(nIndex).pixelWidth = nWidth;
  802.     window.getPopupTopicStyle(nIndex).pixelHeight = nHeight;
  803.     if (gbBsIE55)
  804.     {
  805.         window.getPopupShadowStyle(nIndex).pixelWidth = nWidth + 2;
  806.         window.getPopupShadowStyle(nIndex).pixelHeight = nHeight + 2;
  807.         window.getPopupTopicStyle(nIndex).pixelWidth = nWidth + 2;
  808.         window.getPopupTopicStyle(nIndex).pixelHeight = nHeight + 2;
  809.     }
  810.  
  811.     window.getPopupIFrameStyle(nIndex).pixelWidth = nWidth;
  812.     window.getPopupIFrameStyle(nIndex).pixelHeight = nHeight;
  813.     if (gbBsIE55)
  814.     {
  815.         window.getPopupIFrameStyle(nIndex).top = 0;
  816.         window.getPopupIFrameStyle(nIndex).left = 0;
  817.     }
  818.     
  819.     var strURL = getPopupURL(nIndex);
  820.     if (strURL.indexOf("#") != -1)
  821.         getPopupIFrame(nIndex).location.href = strURL;  // reload again, this will fix the bookmark misunderstand in IE5.
  822.         
  823.     MoveDivAndShow(nIndex, nToken, cuswidth, cusheight);
  824. }
  825.  
  826. function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight)
  827. {
  828.     if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again.
  829.             window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
  830.             setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
  831.             return;
  832.     }
  833.  
  834.     // Determine the position of the window
  835.     var nClickX = window.gnPopupClickX;
  836.     var nClickY = window.gnPopupClickY;
  837.     var nTop = 0;
  838.     var nLeft = 0;
  839.  
  840.     var nWidth = window.getPopupDivStyle(nIndex).pixelWidth;
  841.     var nHeight = window.getPopupDivStyle(nIndex).pixelHeight;
  842.  
  843.     if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
  844.         nTop = nClickY + 10;
  845.     } else {
  846.         nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
  847.     }
  848.     if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
  849.         nLeft = nClickX;
  850.     } else {
  851.         nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
  852.     }
  853.     
  854.     if (nTop < document.body.scrollTop ) nTop  = document.body.scrollTop + 1;
  855.     if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;
  856.  
  857.  
  858.     window.getPopupDivStyle(nIndex).left = nLeft;
  859.     window.getPopupDivStyle(nIndex).top = nTop;
  860.  
  861.     // Set the location of the background blocks
  862.     window.getPopupShadowStyle(nIndex).left = 6;
  863.     window.getPopupShadowStyle(nIndex).top = 6;
  864.     if (gbBsIE55)
  865.     {
  866.         window.getPopupShadowStyle(nIndex).left = 4;
  867.         window.getPopupShadowStyle(nIndex).top = 4;
  868.     }
  869.  
  870.     if (gbBsMac) {
  871.         // Total hack on the iMac to get the IFrame to position properly
  872.         window.getPopupIFrameStyle(nIndex).pixelLeft = 100;
  873.         window.getPopupIFrameStyle(nIndex).pixelLeft = 0;
  874.         // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
  875.         window.getPopupIFrame(nIndex).window.BSSCOnLoad();
  876.     }
  877.  
  878.     BSSCPopup_Timeout(nIndex , nToken );
  879.     
  880.     return;
  881. }
  882.  
  883. function    BSSCSize(x, y)
  884. {
  885.     this.x = x;
  886.     this.y = y;
  887. }
  888.  
  889. function BSSCGetContentSize(thisWindow, size)
  890. {
  891.     if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
  892.         return;
  893.  
  894.     if (gbBsMac) {
  895.         size.x = 300;
  896.         size.y = 300;
  897.         return;
  898.     }
  899.  
  900.     // Resize the width until it is wide enough to handle the content
  901.     // The trick is to start wide and determine when the scrollHeight changes
  902.     // because then we know a scrollbar is necessary. We can then go back
  903.     // to the next widest size (for no scrollbar)
  904.  
  905.     var ClientRate = gBsClientHeight / gBsClientWidth;
  906.  
  907.     var GoldenSize = new BSSCSize(0,0);
  908.     GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
  909.     GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
  910.  
  911.     if (ClientRate > gBRateH_W) {
  912.         GoldenSize.y = GoldenSize.x * gBRateH_W;
  913.     }
  914.     else {
  915.         GoldenSize.x = GoldenSize.y / gBRateH_W;
  916.     }
  917.  
  918.     // Try to using parent specified max x.
  919.     var x = 0;
  920.     var maxgoldx = GoldenSize.x;
  921.     var maxx = gBsClientWidth * gBMaxXOfParent;
  922.     
  923.     // This double resize causes the document to re-render (and we need it to)
  924.     thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
  925.     thisWindow.resizeTo(1, 1);
  926.     thisWindow.resizeTo(1, 1);
  927.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  928.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  929.         
  930.     var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
  931.     
  932.     if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can
  933.     {
  934.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  935.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  936.         
  937.         miny =     thisWindow.document.body.scrollHeight + gBscrollHeight;
  938.         maxy = gBsClientHeight * gBMaxYOfParent;
  939.         
  940.         if (miny > maxy) { // the popup must have a scroll, OK let it be.
  941.             miny = maxy;
  942.             size.x = maxx;
  943.             size.y = maxy;
  944.             thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
  945.         }
  946.         else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
  947.             size.y = miny;
  948.             
  949.             //  downsize from maxx , now I try to using binary divide.
  950.             x = maxx;
  951.             deltax = -maxx/2;
  952.             //j = 0;
  953.             while (true) {
  954.                 x = x + deltax;
  955.                 thisWindow.resizeTo(x, miny);
  956.                 thisWindow.resizeTo(x, miny);
  957.                 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
  958.                 if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  959.                     deltax = Math.abs(deltax) /2;
  960.                 else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  961.                     deltax = -Math.abs(deltax) /2;
  962.                 else 
  963.                     // the y is close enough to wanted.
  964.                     break;
  965.                 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  966.                     break;
  967.             }
  968.             size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
  969.             size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;    
  970.             thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  971.             
  972.         // Handle absurd cases just in case IE flakes
  973.     //        if (size.y < 100) {
  974.     //            size.y = 100;
  975.     //        }
  976.         }
  977.     }
  978.     else {
  979.         // VH 08/06/00 . OK there is another case we did not check before.
  980.         if (thisWindow.document.body.scrollWidth > maxgoldx) {
  981.             size.x = maxx; 
  982.             size.y = miny;    
  983.             thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
  984.         }
  985.         else {
  986.             //  downsize from maxgoldx , now I try to using binary divide.
  987.             x = maxgoldx;
  988.             deltax = -maxgoldx/2;
  989.             //i = 0;
  990.             while (true) {
  991.                 x = x + deltax;
  992.                 thisWindow.resizeTo(x, miny);
  993.                 thisWindow.resizeTo(x, miny);
  994.                 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
  995.                 if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  996.                     deltax = Math.abs(deltax) /2;
  997.                 else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  998.                     deltax = -Math.abs(deltax) /2;
  999.                 else 
  1000.                     // the y is close enough to wanted.
  1001.                     break;
  1002.                 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  1003.                     break;
  1004.                 //i ++;
  1005.                 
  1006.             }
  1007.             size.x = thisWindow.document.body.scrollWidth ;//+ gBscrollWidth;
  1008.             size.y = thisWindow.document.body.scrollHeight ;//+ gBscrollHeight;    
  1009.             thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  1010.         }
  1011.     }
  1012.     
  1013.     // no reload no scrollbar.
  1014.     //size.x = size.x + 16;     //reserve a width for scrollbar (IE 4.0 only)
  1015.  
  1016.     thisWindow.resizeTo(size.x, size.y);
  1017.     thisWindow.resizeTo(size.x, size.y);
  1018.     return;
  1019. }
  1020.  
  1021.  
  1022.  
  1023. function BSSCPopupParentClicked()
  1024. {
  1025.     if (!window.gbPopupTimeoutExpired) {
  1026.         return false;
  1027.     }
  1028.     
  1029.     document.onmousedown = gbOrignalOnMouseDown;
  1030.  
  1031.     // Simply hide the popup
  1032.     hideAll();
  1033.  
  1034.     window.gbPopupTimeoutExpired = false;
  1035.  
  1036.     return true;
  1037. }
  1038.  
  1039.  
  1040. function BSSCPopupClicked()
  1041. {
  1042.     if (!window.gbPopupTimeoutExpired) {
  1043.         return false;
  1044.     }
  1045.  
  1046.  
  1047.     var popupIFrame = getCurrentPopupIFrame();
  1048.     if (popupIFrame == null) {
  1049.         return true;
  1050.     }
  1051.  
  1052. /*
  1053.     if ("undefined" != typeof(popupIFrame.gbInPopupMenu) &&
  1054.         popupIFrame.gbInPopupMenu) {
  1055.         return true;
  1056.     }*/
  1057.  
  1058.     if (!((popupIFrame.window.event != null) &&
  1059.         (popupIFrame.window.event.srcElement != null) &&
  1060.         ((popupIFrame.window.event.srcElement.tagName == "A") ||
  1061.         (popupIFrame.window.event.srcElement.tagName == "IMG")))) {
  1062.         document.onmousedown = gbOrignalOnMouseDown;
  1063.  
  1064.     // Simply hide the popup
  1065.         hideAll();
  1066.  
  1067.         window.gbPopupTimeoutExpired = false;
  1068.  
  1069.         return true;
  1070.     }
  1071. }
  1072.  
  1073.  
  1074. //trace the mouse over's position for hotspot
  1075. function  BSPSPopupOnMouseOver(event)
  1076. {
  1077.     if (gBsBrowser.ie4) {
  1078.         window.gnPopupClickX = event.clientX + document.body.scrollLeft;
  1079.         window.gnPopupClickY = event.clientY + document.body.scrollTop;
  1080.         window.gnPopupScreenClickX = event.screenX;
  1081.         window.gnPopupScreenClickY = event.screenY;
  1082.     } else if (gBsBrowser.ns4) {
  1083.         window.gnPopupClickX = event.pageX - window.pageXOffset;
  1084.         window.gnPopupClickY = event.pageY - window.pageYOffset;
  1085.         window.gnPopupScreenClickX = event.screenX - window.pageXOffset;
  1086.         window.gnPopupScreenClickY = event.screenY - window.pageYOffset;
  1087.     }
  1088. }
  1089.  
  1090.  
  1091. function BSSCHidePopupWindow()
  1092. {
  1093.     if (window.gPopupWindow != null) {
  1094.         if (gBsBrowser.ns4) {
  1095.             if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
  1096.                 window.gPopupWindow.close();
  1097.                 window.gPopupWindow = null;
  1098.             }
  1099.         }
  1100.     }
  1101.  
  1102.     return;
  1103. }
  1104.  
  1105. // Add the PopupOnClick to the onclick array.
  1106. if (typeof(BsscRegisterOnClick) != "undefined")
  1107. {
  1108.     BsscRegisterOnClick(BsPopupOnClick);
  1109. }
  1110. //End to support previous popup functions
  1111.  
  1112. //Begin to support previous relative topics
  1113. //If webHelp needs Related Topics DHTMLcode, it's supposed to add it here
  1114. var gbPopupMenuTimeoutExpired = false;
  1115. var gbInPopupMenu = false;
  1116. var gbPopupMenuTopicList = null;
  1117.  
  1118. //////////////////////////////////////////////////////////////////////////////////////////
  1119. //
  1120. // Popup Menu code
  1121. //
  1122. //////////////////////////////////////////////////////////////////////////////////////////
  1123.  
  1124. var g_bIsPopupMenuInit = false;
  1125. function _WritePopupMenuLayer()
  1126. {
  1127.     if (!g_bIsPopupMenuInit)
  1128.         {
  1129.       if (gbBsNS4) {
  1130. //Do not try to write ininle styles for NS!  NS can not handle it and will not stop downloading the html page...
  1131.        if (gbBsNS6)
  1132.         document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1133.        else
  1134.            document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
  1135.       } else{
  1136.       document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1137.       if (gbBsIE4) {
  1138.         document.write("<STYLE TYPE='text/css'>");
  1139.         if (gbBsMac) {
  1140.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; text-decoration:none;}");
  1141.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; text-decoration:none;}");
  1142.         } else {
  1143.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; text-decoration:none;}");
  1144.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; text-decoration:none;}");
  1145.         }
  1146.         document.write("</STYLE>");
  1147.        }
  1148.           }
  1149.       g_bIsPopupMenuInit = true;
  1150.     }
  1151. }
  1152.  
  1153. //Define variable arguments as: strTitle, strUrl
  1154. function MTE() 
  1155. {
  1156.     this.strTitle = MTE.arguments[0];
  1157.     if (MTE.arguments.length > 1)
  1158.         this.strURL = MTE.arguments[1];
  1159.     else
  1160.         this.strURL = this.strTitle;
  1161. }
  1162.  
  1163. // If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
  1164. function PopupMenu_SetTopicList(aPopupTopicArray)
  1165. {
  1166.     gbPopupMenuTopicList = aPopupTopicArray;
  1167. }
  1168.  
  1169. //Seek for the bsscright frame 
  1170. function _SeekFrameByName( cRoot, strName )
  1171. {
  1172.     if( cRoot == null )    return null;
  1173.     if( cRoot.frames == null )    return null;
  1174.     if( cRoot.frames[strName] != null )    return cRoot.frames[strName];
  1175.     for (var i=0; i<cRoot.frames.length; i++)
  1176.     {
  1177.         var cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
  1178.         if( cObj != null )        return cObj;
  1179.     };
  1180.     return null;
  1181. }
  1182. function _GetFrameByName( cRoot, strName )
  1183. {
  1184.     if( cRoot == null )    return null;
  1185.     var cRet = _SeekFrameByName(cRoot, strName);
  1186.     if( cRet != null )    return cRet;
  1187.     if (cRoot.parent != cRoot)
  1188.         return _GetFrameByName( cRoot.parent, strName );
  1189.     else
  1190.         return null;
  1191. }
  1192.  
  1193. //var gbOriPopupMenuClick = null;
  1194.  
  1195. function _PopupMenu_Invoke(fn_arguments)
  1196. {
  1197.     // Make sure we have reasonable arguments
  1198.     var argLen = fn_arguments.length;
  1199.     if (argLen < 3) {
  1200.         return false;
  1201.     }
  1202.  
  1203.     // Check to see if we only have one target
  1204.     var strTarget = "";
  1205.     var targetDoc = null;
  1206.     if (fn_arguments[1] == '') {
  1207.         if (BSSCPopup_IsPopup()) {
  1208.             targetDoc = parent;
  1209.             strTarget = "TARGET= _parent";
  1210.         }
  1211.         else
  1212.             targetDoc = window.document;
  1213.     } else {
  1214.         targetDoc = _GetFrameByName( parent, fn_arguments[1] );
  1215.  
  1216.         strTarget = "TARGET='" + fn_arguments[1] + "'";
  1217.     }
  1218.  
  1219.     if ((!gbBsIE4 && !gbBsNS4) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {
  1220.     
  1221.         var argLen     = fn_arguments.length;
  1222.  
  1223.         // Create the window that the hyperlinks will go into
  1224.         var nHeight = argLen * 15;
  1225.         var nWidth = 400;
  1226.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1227.         strParam += ",height=" + nHeight + ",width=200";
  1228.         strParam += ",resizable";
  1229.  
  1230.         // Create a temporary window first to ensure the real popup comes up on top
  1231.         var wndTemp = window.open("", "temp", strParam);
  1232.  
  1233.         // Create the real popup window
  1234.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1235.  
  1236.         // Close the temporary
  1237.         wndTemp.close();
  1238.  
  1239.         wndPopupLinks.document.open("text/html");
  1240.         wndPopupLinks.document.write("<html><head></head>");
  1241.         wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");
  1242.         var strParaLine = "";
  1243.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1244.             strParaLine = "";
  1245.             strParaLine += "<a href=\"javascript:";
  1246.             if (gbBsIE) {
  1247.                 strParaLine += "onBlur=null; ";
  1248.             }
  1249.             strParaLine += "opener.location=\'";
  1250.             strParaLine += fn_arguments[2 * i + 3];
  1251.             strParaLine += "\';close();\"";
  1252.             strParaLine += strTarget;
  1253.  
  1254.             strParaLine += ">";
  1255.             strParaLine += fn_arguments[2 * i + 2];
  1256.             strParaLine += "</a>";
  1257.             strParaLine += "<br>";
  1258.             wndPopupLinks.document.write(strParaLine);
  1259.         }
  1260.         wndPopupLinks.document.write("</body></html>");
  1261.         wndPopupLinks.document.close();
  1262.         window.gbInPopupMenu = true;
  1263.         if (!gbBsIE) {
  1264.             wndPopupLinks.focus();
  1265.         }
  1266.  
  1267.         return false;
  1268.     }
  1269.  
  1270.  
  1271.     if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
  1272.         ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
  1273.         // Get the place that we will be putting the topic into
  1274.         var strURL = "";
  1275.         if (isNaN(fn_arguments[2]) ||  (gbPopupMenuTopicList == null)) {
  1276.             strURL = fn_arguments[3];
  1277.         }
  1278.         else     {
  1279.             strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;
  1280.         }
  1281.  
  1282.         if (targetDoc != null) {
  1283.             targetDoc.location.href = strURL;
  1284.         }
  1285.         else {
  1286.             window.open(strURL);
  1287.         }        
  1288.         window.gbInPopupMenu = true;
  1289.         return false;
  1290.     }
  1291.     
  1292.     var strMenu = "";
  1293.     if (gbBsNS4) {
  1294.         strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
  1295.     } else {
  1296.         strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
  1297.         if (gbBsMac) {
  1298.             strMenu += ' CELLPADDING=4';
  1299.         } else {
  1300.             strMenu += ' CELLPADDING=2';
  1301.         }    
  1302.         strMenu += ' BGCOLOR=#c0c0c0>';
  1303.     }
  1304.     // Add each of the items
  1305.     var i = 2;
  1306.     while (i <= argLen - 1) {
  1307.         strMenu += '<TR><TD><NOBR>'
  1308.         // If the destination is a number then look it up in the topic list
  1309.         if (isNaN(fn_arguments[i]) ||  (gbPopupMenuTopicList == null)) {
  1310.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
  1311.         } else {
  1312.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
  1313.         }
  1314.         strMenu += ' onclick="PopupMenu_HandleClick(event);"';
  1315.         strMenu += ' onmouseover="PopupMenu_Over(event);"';
  1316.         strMenu += ' onmouseout="PopupMenu_Out(event);"';
  1317.         strMenu += '>';
  1318.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1319.             strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
  1320.         } else {
  1321.             strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
  1322.         }
  1323.         strMenu += '</A></DIV></NOBR></TD></TR>';
  1324.  
  1325.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1326.             i += 2;
  1327.         } else {
  1328.             i += 1;
  1329.         }
  1330.     }
  1331.     strMenu += "</TABLE>";
  1332.  
  1333.     if (gbBsMac) {
  1334.     // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
  1335.         strMenu +="<TABLE></TABLE>";
  1336.     }
  1337.  
  1338.     var layerPopup = null;
  1339.     var stylePopup = null;
  1340.     var nEventX = 0;
  1341.     var nEventY = 0;
  1342.     var nWindowWidth = 0;
  1343.     if (gbBsIE4) {
  1344.  
  1345.         layerPopup = document.all["PopupMenu"];
  1346.         layerPopup.innerHTML = strMenu;
  1347.         stylePopup = layerPopup.style;
  1348.  
  1349.         _BSPSGetClientSize();
  1350.  
  1351.         // Get the position of the item causing the event (relative to its parent)
  1352.         nEventX = window.event.clientX;
  1353.         nEventY = window.event.clientY;
  1354.  
  1355.         if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
  1356.             nEventY += document.body.scrollTop + 10;
  1357.         } else {
  1358.             nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
  1359.         }
  1360.         stylePopup.top = nEventY;
  1361.         
  1362.         var nPopupWidth = layerPopup.scrollWidth;
  1363.         if (gbBsMac) {
  1364.             nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
  1365.         }
  1366.         if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
  1367.             if (gBsClientWidth - nPopupWidth < 5) {
  1368.                 stylePopup.left = 5;
  1369.             } else {
  1370.                 stylePopup.left = gBsClientWidth - nPopupWidth - 5;
  1371.             }
  1372.         } else {
  1373.             stylePopup.left = nEventX + document.body.scrollLeft + 20;
  1374.         }
  1375.  
  1376.         stylePopup.visibility = "visible";
  1377.         document.onclick = PopupMenu_HandleClick;
  1378.  
  1379.     } else if (gbBsNS6) {
  1380.         layerPopup = document.getElementById("PopupMenu");
  1381.         layerPopup.style.visibility = "hidden";
  1382.     
  1383.         var e = fn_arguments[0];
  1384.         nEventX = e.pageX;
  1385.         nEventY = e.pageY;
  1386.         _BSPSGetClientSize();
  1387.         layerPopup.innerHTML = strMenu;
  1388.  
  1389.         if (nEventY + layerPopup.offsetHeight + 20  <  window.pageYOffset + gBsClientHeight) {
  1390.             nEventY += 20;
  1391.         } else {
  1392.             nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
  1393.         }
  1394.  
  1395.         if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
  1396.             if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
  1397.                 nEventX = 5;
  1398.             } else {
  1399.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
  1400.             }
  1401.         } else {
  1402.             nEventX += 20;
  1403.         }
  1404.         layerPopup.style.top = nEventY;
  1405.         layerPopup.style.left = nEventX;
  1406.         // set again to avoid the stupid frash in netscape 6.
  1407.         layerPopup.innerHTML = strMenu;
  1408.         layerPopup.style.visibility = "visible";
  1409.         //window.captureEvents(Event.MOUSEDOWN);
  1410.         window.onclick = PopupMenu_HandleClick;
  1411.     }
  1412.     else if (gbBsNS4) {
  1413.         layerPopup = document.layers.PopupMenu;
  1414.         layerPopup.visibility = "hide";
  1415.         stylePopup = layerPopup.document;
  1416.         stylePopup.write(strMenu);
  1417.         stylePopup.close();
  1418.         var e = fn_arguments[0];
  1419.         nEventX = e.pageX;
  1420.         nEventY = e.pageY;
  1421.         _BSPSGetClientSize();
  1422.         if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
  1423.             nEventY += 20;
  1424.         } else {
  1425.             nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
  1426.         }
  1427.         layerPopup.top = nEventY;
  1428.  
  1429.         if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
  1430.             if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
  1431.                 nEventX = 5;
  1432.             } else {
  1433.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
  1434.             }
  1435.         } else {
  1436.             nEventX += 20;
  1437.         }
  1438.  
  1439.         layerPopup.left = nEventX;
  1440.  
  1441.         layerPopup.visibility = "show";
  1442.  
  1443. //        window.captureEvents(Event.CLICK | Event.MOUSEDOWN);
  1444.         window.captureEvents(Event.MOUSEDOWN);
  1445. //        window.onclick = PopupMenu_HandleClick;
  1446.         window.onmousedown = PopupMenu_HandleClick;
  1447.     }
  1448.  
  1449.     window.gbInPopupMenu = true;
  1450.     window.gbPopupMenuTimeoutExpired = false;
  1451.     setTimeout("PopupMenu_Timeout();", 100);
  1452.     return false;
  1453. }
  1454.  
  1455.  
  1456. function PopupMenu_Timeout()
  1457. {
  1458.     window.gbPopupMenuTimeoutExpired = true;
  1459. }
  1460.  
  1461. function PopupMenu_Over(e)
  1462. {
  1463.     if (gbBsIE4) {
  1464.         e.srcElement.className = "PopupOver";
  1465.     } else if (gbBsNS4) {
  1466. //        this.bgColor = "red";
  1467. //        e.target.document.className = "PopupOver";
  1468.     }
  1469.     return;
  1470. }
  1471.  
  1472. function PopupMenu_Out(e)
  1473. {
  1474.     if (gbBsIE4) {
  1475.         e.srcElement.className = "PopupNotOver";
  1476.     } else if (gbBsNS4) {
  1477.         this.bgColor = "#f0f0f0";
  1478.     }
  1479.     return;
  1480. }
  1481.  
  1482.  
  1483. function PopupMenu_HandleClick(e)
  1484. {
  1485.     if (!window.gbPopupMenuTimeoutExpired) {
  1486.         return;
  1487.     }
  1488.  
  1489.     window.gbInPopupMenu = false;
  1490.  
  1491.     if (gbBsNS4 && !gbBsNS6) {
  1492. //        window.releaseEvents(Event.CLICK);
  1493.         window.releaseEvents(Event.MOUSEDOWN);
  1494.     }
  1495.  
  1496.     var layerPopup = null;
  1497.     var stylePopup = null;
  1498.     if (gbBsIE4) {
  1499.         layerPopup = document.all["PopupMenu"];
  1500.         stylePopup = layerPopup.style;
  1501.         stylePopup.visibility = "hidden";
  1502.     } else if (gbBsNS6) {
  1503.         layerPopup = document.getElementById("PopupMenu");
  1504.         layerPopup.style.visibility = "hidden";
  1505.     } else if (gbBsNS4) {
  1506.         layerPopup = document.layers.PopupMenu;
  1507.         layerPopup.visibility = "hide";
  1508.     }
  1509.  
  1510. //    if (gbOriPopupMenuClick!= null)
  1511. //        document.onclick = gbOriPopupMenuClick;
  1512.  
  1513.     return;
  1514. }
  1515.  
  1516. // This function should be deleted when all old projects are cleaned up
  1517. function BSPSWritePopupFrameForIE4()
  1518. {
  1519.     return false;
  1520. }
  1521.  
  1522. /////////////////////////////////////////////////////////////////////
  1523. function BSSCPopup_ClickMac()
  1524. {
  1525.     if ((!DHTMLPopupSupport()) && (gbBsIE4))
  1526.     {    
  1527.         var bClickOnAnchor = false;
  1528.         var el;
  1529.         if ((window.event != null) &&
  1530.             (window.event.srcElement != null))
  1531.         {
  1532.             el = window.event.srcElement;
  1533.             while (el != null)
  1534.             {
  1535.                 if ((el.tagName == "A") || (el.tagName == "AREA"))     {
  1536.                     bClickOnAnchor = true;
  1537.                     break;
  1538.                 }
  1539.                 if (el.tagName == "BODY") {
  1540.                     break;
  1541.                 }
  1542.                 el = el.parentElement;
  1543.             }
  1544.         }
  1545.         if (BSSCPopup_IsPopup())
  1546.         {
  1547.             if (!bClickOnAnchor) {
  1548.                 parent.window.gPopupWindow = null;
  1549.                 self.close();
  1550.             }
  1551.         }
  1552.         else
  1553.         {
  1554.             bClosePopupWindow = true;
  1555.             if ((bClickOnAnchor) &&
  1556.                 (el.href) &&
  1557.                 ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
  1558.             {
  1559.                 bClosePopupWindow = false;
  1560.             }
  1561.             if (bClosePopupWindow)
  1562.             {
  1563.                 if (window.gPopupWindow != null && !window.gPopupWindow.closed )
  1564.                 {
  1565.                     window.gPopupWindow.close();
  1566.                 }
  1567.             }
  1568.         }
  1569.     }
  1570.  }
  1571.  
  1572. //////////////////////////////////////////////////////////////////////
  1573.  
  1574. _BSPSGetBrowserInfo();
  1575.  
  1576.  
  1577. function BsPopupOnClick()
  1578. {
  1579.     if (!gbBsIE4)
  1580.         return;
  1581.  
  1582.     BSSCPopup_ClickMac();
  1583. }
  1584.  
  1585. function _BSSCOnError(message)
  1586. {
  1587.     if(-1 != message.indexOf("denied") 
  1588.         || -1 != message.indexOf("Object required"))
  1589.      return true;
  1590. }
  1591.  
  1592. //End to support previous relative topics
  1593.  
  1594. /// Section End  - Popup and Related Topic (JavaScript 1.0)
  1595.  
  1596. /// Section Begin - Embedded Stub (JavaScript 1.0)
  1597.  
  1598. var s_strAgent = navigator.userAgent.toLowerCase();
  1599. var s_nVer       = parseInt(navigator.appVersion);
  1600.  
  1601. var s_bIE  = (s_strAgent.indexOf('msie') != -1);
  1602. var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
  1603. var s_bOpera    = (s_strAgent.indexOf('opera') != -1);
  1604.  
  1605. var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
  1606. var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));
  1607.  
  1608. var s_bNS2        = ((s_bNS) && (s_nVer <= 2));
  1609. var s_bNS3        = ((s_bNS) && (s_nVer == 3));
  1610. var s_bIE300301    = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
  1611. var s_bIE302    = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));
  1612.  
  1613.  
  1614. function HasExtJs()
  1615. {
  1616.     if (s_bIE3Before) { return false;}
  1617.     if (s_bNS3Before) {    return false;}
  1618.     if (typeof (BsGeneralOnLoad) == "undefined"){ return false; }
  1619.     return true;
  1620. }
  1621.  
  1622.  
  1623. function BSSCCreatePopupDiv()
  1624. {
  1625.     return;
  1626. }
  1627.  
  1628.  
  1629. function WritePopupMenuLayer()
  1630. {
  1631.     if (HasExtJs()) {_WritePopupMenuLayer();}
  1632. }
  1633.  
  1634. function BSSCPopup(strURL, width, height)
  1635. {
  1636.     if (HasExtJs())    { 
  1637.         _BSSCPopup(strURL, width, height);
  1638.     }else{
  1639.         //Create a temporary window first to ensure the real popup comes up on top
  1640.         var wndTemp = null;
  1641.         if (!s_bNS3) {
  1642.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1643.         }
  1644.         // Create the real popup window
  1645.         var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
  1646.         // Close the temporary
  1647.         if (!s_bNS3) {
  1648.             wndTemp.close();
  1649.         } else {
  1650.             wndPopup.focus();
  1651.         }
  1652.     }
  1653. }
  1654.  
  1655. var gbWndTemp = null, gbWndPopupLinks = null;
  1656. var gbstrParaTotal = "";
  1657.  
  1658. function PopupMenu_Invoke()
  1659. {
  1660.     if (HasExtJs()) {
  1661.         return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
  1662.     }
  1663.     if (s_bNS3Before || s_bIE3Before )    {
  1664.         var argLen     = PopupMenu_Invoke.arguments.length;
  1665.         if (argLen < 5) {
  1666.             window.document.location.href = PopupMenu_Invoke.arguments[3];
  1667.             return false;
  1668.         }
  1669.         gbWndTemp = null;
  1670.         gbWndPopupLinks = null;
  1671.         gbstrParaTotal = "";
  1672.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1673.             var strParaLine = "";
  1674.             if (s_bNS2 || s_bOpera){
  1675.                 strParaLine += "<a href=\"";
  1676.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1677.                 strParaLine += "\">"
  1678.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  1679.                 strParaLine += "</a>";
  1680.             } else {
  1681.                 strParaLine += "<a href=\"javascript:";
  1682.                 strParaLine += "gotoUrl(\'";
  1683.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1684.                 strParaLine += "\');\"";
  1685.                 if (PopupMenu_Invoke.arguments[1] != '') {
  1686.                     strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
  1687.                 }
  1688.                 strParaLine += ">";
  1689.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  1690.                 strParaLine += "</a>";
  1691.             }
  1692.             strParaLine += "<br>";
  1693.             gbstrParaTotal += strParaLine;
  1694.         }
  1695.         var nHeight = argLen * 15;
  1696.         var nWidth = 400;
  1697.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1698.         strParam += ",height=" + nHeight + ",width=200,resizable";
  1699.         
  1700.         //Create a temporary window first to ensure the real popup comes up on top
  1701.         //var wndTemp = null;
  1702.         if (!s_bNS3) {
  1703.             gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1704.         } 
  1705.         gbWndPopupLinks = window.open("", "popuplinks", strParam);
  1706.  
  1707.         setTimeout("Wait_PopupMenuReady()", 100);
  1708.     }
  1709.     return true;
  1710. }
  1711.  
  1712. function Wait_PopupMenuReady() 
  1713. {
  1714.     if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
  1715.         PopupMenu_InvokeReady();
  1716.     }
  1717.     else 
  1718.         setTimeout("Wait_PopupMenuReady()", 100);
  1719. }
  1720.  
  1721.  
  1722. function PopupMenu_InvokeReady()
  1723. {
  1724.     if (gbWndPopupLinks != null) {
  1725.         gbWndPopupLinks.document.open("text/html");
  1726.         gbWndPopupLinks.document.write("<html><head>");
  1727.         if (s_bNS2 || s_bOpera) {
  1728.             gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
  1729.         } else {
  1730.             //YJ: IE301,302 and NS3.x works fine
  1731.             gbWndPopupLinks.document.write("<");
  1732.             gbWndPopupLinks.document.write("script>");
  1733.             gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
  1734.             gbWndPopupLinks.document.write("<");
  1735.             gbWndPopupLinks.document.write("/script>");
  1736.         }
  1737.         gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
  1738.         gbWndPopupLinks.document.write(gbstrParaTotal);
  1739.         gbWndPopupLinks.document.write("</body></html>");
  1740.         gbWndPopupLinks.document.close();
  1741.  
  1742.         // Close the temporary
  1743.         if (!s_bNS3 && gbWndTemp != null) {
  1744.             gbWndTemp.close();
  1745.         }else {
  1746.             gbWndPopupLinks.focus();
  1747.         }
  1748.  
  1749.         return true;
  1750.     }
  1751.     return false;
  1752. }
  1753.  
  1754. /// Section End - Embedded Stub (JavaScript 1.0)
  1755.  
  1756. //// Segment End -- (JavaScript 1.0)
  1757.  
  1758. //// Segment Begin -- (JavaScript 1.2)
  1759. /// Section Begin  - kadov DHTM (JavaScript 1.2)
  1760.  
  1761. //Begin to support extended and dropdown text effects.
  1762. function kadovIsParagraph(el)
  1763. {
  1764.     return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
  1765. }
  1766.  
  1767. function kadovInitEachChild(el)
  1768. {    
  1769.     for(var i=0; i<el.children.length; i++)
  1770.     {
  1771.         var child = el.children[i];
  1772.         if( child.tagName == "SCRIPT" || child.tagName == "!" )
  1773.             continue;
  1774.  
  1775.         if( child.id != "" )
  1776.         {
  1777.             // to wipe out the onload effects
  1778.             var onLoadEffect = child.style.getAttribute( "x-on-pageload" );
  1779.             if( (onLoadEffect != null) && (onLoadEffect > "") )
  1780.                 child.style.setAttribute( "x-on-pageload", "" );
  1781.             
  1782.             var href = child.getAttribute("href")
  1783.             if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )
  1784.                 kadovFilePopupInit(child.id); // Init for Popup
  1785.             else if( child.className == "dropspot" || child.className == "expandspot" || 
  1786.                      child.className == "glossterm" )
  1787.                 kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text
  1788.             else if( child.className == "trigger")
  1789.                 kadovInitTrigger(child.id);// Init for Trigger
  1790.             else
  1791.             {
  1792.                 kadovInitEffects(child.id);// Init for DHTML effects
  1793.                 CEngine.SetOneTargetInitialState( child.id );
  1794.             }
  1795.         }
  1796.         
  1797.         if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )
  1798.             child.start = "mouseover";// to start a AVI file. fileopen doesn't work
  1799.  
  1800.         kadovInitEachChild(child);
  1801.     }
  1802. }
  1803.  
  1804. function kadovRetrieveTextInner(el)
  1805. {    
  1806.     var x = "";
  1807.     if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))
  1808.         return x;
  1809.  
  1810.     if( kadovIsParagraph(el) )
  1811.     {
  1812.         var strNewID = " ";
  1813.         if( el.id != "" )
  1814.             strNewID += "id=" + el.id + "_NewSpan ";
  1815.         x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";
  1816.     }
  1817.     else
  1818.     {
  1819.         for(var i=0; i<el.children.length; i++)
  1820.             x += kadovRetrieveTextInner( el.children[i] );
  1821.     }
  1822.     return x;
  1823. }
  1824.  
  1825. function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )
  1826. {    
  1827.     var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );
  1828.     if( nTagOpen < 0 )
  1829.         return strRawHTML;
  1830.  
  1831.     var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);
  1832.     if( nTagClose < nTagOpen )
  1833.         return strRawHTML;
  1834.         
  1835.     if( typeof(nDistance) == "number" && nDistance > 0 )
  1836.         if( (nTagClose - nTagOpen) != nDistance )
  1837.             return strRawHTML;
  1838.         
  1839.     var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;
  1840.     return     kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );
  1841. }
  1842.  
  1843. function kadovAdjustObjectTag(strRawHTML, nStartPos)
  1844. {// adjust object tag for related topics HTML control, because innerHTML misses out the item settings
  1845.     
  1846.     //Is there any DTC?
  1847.     var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';
  1848.     var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';
  1849.     var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );
  1850.     if( nDTCTagOpen < 0 )
  1851.         return strRawHTML;
  1852.     var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );
  1853.     if( nDTCTagClose < nDTCTagOpen)
  1854.         return strRawHTML; // no Design Time Controls;
  1855.         
  1856.     //Is the DTC HTML Help Control?
  1857.     var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';
  1858.     var strRTObjTagClose = '</OBJECT>';
  1859.     var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );
  1860.     if( nRTObjTagOpen < nDTCTagOpen )
  1861.         return strRawHTML;
  1862.     var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );
  1863.     if( nRTObjTagClose < nRTObjTagOpen )
  1864.         return strRawHTML; // is not a HTML help control
  1865.         
  1866.     // Is it a related Topics html help control?
  1867.     var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';
  1868.     if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )
  1869.         return strRawHTML;
  1870.     
  1871.     // does the commented object tag contain a items parameters        
  1872.     var strRTItemsOpen = '<param name=Items value="';
  1873.     var strRTItemsClose = '$$**$$" >';
  1874.     var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);
  1875.     if( nRTItemsOpen < nDTCTagOpen )
  1876.         return strRawHTML;
  1877.     var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);
  1878.     if( nRTItemsClose < nRTItemsOpen )
  1879.         return strRawHTML;
  1880.         
  1881.     // found a items string
  1882.     var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);
  1883.     if( strItems.length < 1 )
  1884.         return strRawHTML;
  1885.     
  1886.     // to reconstruct the item(s) param tag(s)
  1887.     var strItemsArray = strItems.split('$$**$$');
  1888.     if( strItemsArray.length < 1 )
  1889.         return strRawHTML;
  1890.     var strRunTimeItemParam = "";
  1891.     for( var i = 0; i < strItemsArray.length; i++ )
  1892.     {
  1893.         strRunTimeItemParam += '<PARAM  NAME="Item' + (i+1);
  1894.         strRunTimeItemParam += '"' + '  VALUE="';
  1895.         strRunTimeItemParam += strItemsArray[i];
  1896.         strRunTimeItemParam += '">';
  1897.     }
  1898.     
  1899.     // to insert the reconstructed item params into runtime object tag
  1900.     var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);
  1901.     return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);
  1902. }
  1903.  
  1904. function kadovTextPopupOnLoad( el )
  1905. {
  1906.     if( !CCSSP.bIsWinOS )
  1907.         return;
  1908.  
  1909.     if( typeof(el) == "string" )
  1910.         el = document.all.item(el);
  1911.  
  1912.     var src = el.getAttribute( "x-use-popup" );
  1913.     if(!src)
  1914.         return;
  1915.  
  1916.     var name = src;
  1917.     if( src.substr(0,1) == "#" ) 
  1918.         name = src.substr(1, src.length-1);
  1919.     var srcDiv = document.all.item(name);
  1920.     if( !srcDiv )
  1921.         return 1;
  1922.  
  1923.     var type = el.getAttribute( "x-popup-type" );
  1924.     var setup = el.getAttribute( "x-tmp-setup" );
  1925.     var newId = name;
  1926.     if( newId.indexOf( "_tmp") <= 0 )
  1927.         newId += "_tmp";
  1928.  
  1929.     if( !setup )
  1930.     {
  1931.         el.setAttribute( "x-tmp-setup", 1 );
  1932.     
  1933.         if( type == "pulldown"  )
  1934.         {
  1935.             var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);
  1936.             var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
  1937.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
  1938.  
  1939.             //work around the bug in HH.exe that highlight the phrases when use Search tab
  1940.             //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime
  1941.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);
  1942.             
  1943.             var strStyle = " style='display:none; position:relative;";
  1944.             var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";
  1945.  
  1946.             srcDiv.outerHTML = ""; // empty the original DIV tag
  1947.             var elParentPra = kadovFindParentParagraph(el);
  1948.             if( elParentPra )
  1949.                 elParentPra.insertAdjacentHTML( "AfterEnd", newDiv );
  1950.         }
  1951.         else if( type == "expanding"  )
  1952.         {
  1953.             var inner = kadovRetrieveTextInner(srcDiv);
  1954.             if( inner == "" )
  1955.                 inner = srcDiv.innerHTML;
  1956.             var strAdjust = kadovAdjustObjectTag(inner,0);
  1957.             var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
  1958.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
  1959.             var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";
  1960.             var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";
  1961.             srcDiv.outerHTML = ""; // empty the original DIV tag
  1962.             el.insertAdjacentHTML( "AfterEnd", newSpan );
  1963.         }
  1964.     }
  1965. }
  1966.  
  1967. function kadovTextPopup( el )
  1968. {
  1969.     if( (!CCSSP.bIsWinOS) || (window.event == null) )
  1970.         return;
  1971.     window.event.cancelBubble = true;
  1972.  
  1973.     if( typeof(el) == "string" )
  1974.         el = document.all.item(el);
  1975.  
  1976.     var src = el.getAttribute( "x-use-popup" );
  1977.     if(!src)
  1978.         return 1;
  1979.  
  1980.     var name = src;
  1981.     if( src.substr(0,1) == "#" ) 
  1982.         name = src.substr(1, src.length-1) + "_tmp";
  1983.     var srcDiv = document.all.item(name);
  1984.     if( !srcDiv )
  1985.         return 1;
  1986.  
  1987.     var type = el.getAttribute( "x-popup-type" );
  1988.     var setup = el.getAttribute( "x-tmp-setup" );
  1989.     if( srcDiv )
  1990.     {
  1991.         if( srcDiv.style.display == "" )
  1992.             srcDiv.style.display = "none";
  1993.         else
  1994.         {
  1995.             srcDiv.style.display = "";
  1996.             if( typeof(srcDiv.bInitialized) == "undefined" )
  1997.             {
  1998.                 srcDiv.bInitialized = true;
  1999.                 kadovInitEffects(name);
  2000.                 kadovInitEachChild(srcDiv);
  2001.             }
  2002.         }
  2003.     }
  2004. }
  2005.  
  2006. function kadovFindParentParagraph( el )
  2007. {
  2008.     if( typeof(el) == "string" )
  2009.         el = document.all.item(el);
  2010.     if( (!el) || el.tagName == "BODY" )
  2011.         return null;
  2012.     if( kadovIsParagraph(el.parentElement) )
  2013.         return el.parentElement;
  2014.     else
  2015.         return kadovFindParentParagraph( el.parentElement );
  2016. }
  2017.  
  2018. //Begin HTML code invoked function
  2019. function kadovRegisterEventHandler( obj, strEvent, strEventHandler )
  2020. {
  2021.     if( !gbBsIE4 )
  2022.         return;
  2023.     CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );
  2024. }
  2025.  
  2026. function kadovTextPopupInit( el )
  2027. {
  2028.     if( (!gbBsIE4) || (!CCSSP.bIsWinOS) )
  2029.         return;
  2030.         
  2031.     if( typeof(el) == "string" )
  2032.         el = document.all.item(el);
  2033.     if( el != null )
  2034.     {
  2035.         CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(" + el.id +");" );
  2036.         CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(" + el.id +");" );
  2037.     }
  2038. }
  2039. //End HTML code invoked function
  2040.  
  2041. //End to support extended and dropdown text effects.
  2042.  
  2043. //Begin to convert iWrite format to RoboEditor Format for DHTML effects
  2044. function kadovInitTriggersInHead( )
  2045. {
  2046.   if( Object.xDelayedInitElements )
  2047.   {
  2048.      var x = Object.xDelayedInitElements;
  2049.      for(i=0; i<x.length; i++)
  2050.          kadovInitTrigger( x[i] );
  2051.   }
  2052. }
  2053.  
  2054. //Begin HTML code invoked function
  2055. function kadovFilePopupInit( el )
  2056. {
  2057.     if( !gbBsIE4 )
  2058.         return;
  2059.     if( typeof(el) == "string" )
  2060.         el = document.all.item(el);
  2061.  
  2062.     if( el != null )
  2063.         CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );
  2064. }
  2065.  
  2066. function kadovInitTrigger( element )
  2067. {
  2068.     if( !gbBsIE4 )
  2069.         return;
  2070.     var srcElement = element;
  2071.     if( typeof(srcElement) == "string" )
  2072.     {
  2073.         srcElement = document.all.item(element,0);
  2074.         if(srcElement == null)
  2075.             return;
  2076.     }
  2077.     
  2078.     if( !kadovIsParentVisible(srcElement) )
  2079.         return;
  2080.  
  2081.     var targets = srcElement.getAttribute( "x-targets" );
  2082.     var arrOneTarget = targets.split( "," );
  2083.     for( var i = 0; i < arrOneTarget.length; i ++ )
  2084.         bsscFXInit( element, arrOneTarget[i], null, null, null, null );
  2085. }
  2086.  
  2087. function kadovIsParentVisible( el )
  2088. {
  2089.     if( typeof(el) == "string" )
  2090.         el = document.all.item(el);
  2091.     if( (!el) || el.tagName == "BODY" )
  2092.         return true;
  2093.     if( el.style.display == 'none' ) //el.visibility == 'hidden' || 
  2094.         return false;
  2095.     else
  2096.         return kadovIsParentVisible( el.parentElement );
  2097. }
  2098.  
  2099. function kadovInitEffects( element )
  2100. {
  2101.     if( !gbBsIE4 )
  2102.         return;
  2103.     var srcElement = element;
  2104.     if( typeof(srcElement) == "string" )
  2105.     {
  2106.         srcElement = document.all.item(element,0);
  2107.         if(srcElement == null)
  2108.             return;
  2109.     }
  2110.     
  2111.     if( !kadovIsParentVisible(srcElement) )
  2112.         return;
  2113.     
  2114.     kadovInitEffect( srcElement, "x-on-hover" );
  2115.     kadovInitEffect( srcElement, "x-on-pageclick" );
  2116.     kadovInitEffect( srcElement, "x-on-pageload" );
  2117.     kadovInitEffect( srcElement, "x-on-trigger-1" );
  2118.     kadovInitEffect( srcElement, "x-on-trigger-2" );
  2119. }
  2120. //End HTML code invoked function
  2121.  
  2122. function kadovInitEffect( element, prop )
  2123. {
  2124.     var values = null;
  2125.     if( element.getAttribute( "currentStyle" ) )
  2126.         values = element.currentStyle.getAttribute( prop );
  2127.     else 
  2128.         values = element.style.getAttribute( prop );
  2129.     if( !values )
  2130.         return;
  2131.  
  2132.     var functions = new Array();
  2133.     var nIdx = 0, nStart = 0;
  2134.     var nNext = values.indexOf( "\)", 0);
  2135.     while( nNext >= 0 && nNext < values.length )
  2136.     {
  2137.         functions[nIdx] = values.substr( nStart, nNext-nStart+1);
  2138.         nStart = nNext + 1;
  2139.         nIdx++;
  2140.         nNext = values.indexOf( "\)", nStart);
  2141.     }
  2142.         
  2143.     for( var i=0; i<functions.length; i++)
  2144.     {
  2145.         var id = element.getAttribute( "id" );
  2146.         var translatedProp = kadovTranslateProp(prop);
  2147.  
  2148.         var lp = functions[i].indexOf( "(" );
  2149.         var fnname = functions[i].substring(0, lp);
  2150.         var srcargs = functions[i].substring(lp+1, functions[i].length-1);
  2151.         
  2152.         var nClickTimes = 1;
  2153.         var arrForClickCount = srcargs.split( "," );
  2154.         for( var j = 0; j < arrForClickCount.length; j++ )
  2155.         {// to locate and get the "clicks=99" settings
  2156.             var nPageClick = arrForClickCount[j].indexOf("clicks");
  2157.             if( nPageClick >= 0 )
  2158.             {
  2159.                 nPageClick = arrForClickCount[j].indexOf("=");
  2160.                 if( nPageClick > 0 )
  2161.                 {
  2162.                     nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;
  2163.                     break;
  2164.                 }
  2165.             }
  2166.         }
  2167.         var args = srcargs;
  2168.         if( j < arrForClickCount.length )
  2169.         {// to strip out the "clicks=99" from the arguments string
  2170.             args = "";
  2171.             for( var k = 0; k < arrForClickCount.length; k ++ )
  2172.             {
  2173.                 if( k != j )
  2174.                 {
  2175.                     args += arrForClickCount[k];
  2176.                     if( k < arrForClickCount.length - 1 )
  2177.                         args += ",";
  2178.                 }
  2179.             }
  2180.         }
  2181.         bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );
  2182.     }
  2183. }
  2184.  
  2185. function kadovTranslateProp( prop )
  2186. {
  2187.     switch( prop )
  2188.     {
  2189.     case "x-on-hover" :     return "bsschover";
  2190.     case "x-on-pageclick" : return "bsscpageclick";
  2191.     case "x-on-pageload" :  return "bsscpageload";
  2192.     case "x-on-trigger-1" : return "bssctrigger1";
  2193.     case "x-on-trigger-2" : return "bssctrigger2";
  2194.     }
  2195.     return null;
  2196. }
  2197. //End to convert iWrite format to RoboEditor Format for DHTML effects
  2198.  
  2199. //Begin the definition of one entry to DHTML effects
  2200. function bsscFXInit( trigger_ID, target_ID, event_type, 
  2201.     action_type, action_setting, event_addional )
  2202. {
  2203.     if( !CCSSP.bIsWinOS || typeof(target_ID) != "string" )//MUST have a target_ID
  2204.         return; // we don't support Navigator yet
  2205.     
  2206.     if( typeof(event_type) == "string" )
  2207.         event_type = event_type.toLowerCase();
  2208.     if( typeof(action_type) == "string" )
  2209.         action_type = action_type.toLowerCase();
  2210.     if( typeof(action_setting) == "string" )
  2211.          action_setting = action_setting.toLowerCase();
  2212.     
  2213.     // to get the target element then add it to the target list
  2214.     var eleTarget = CCSSP.GetObject( target_ID );
  2215.     if( (eleTarget != null) && (event_type != null) && (action_type != null) )
  2216.     {
  2217.         CEngine.AddOneTarget( target_ID, eleTarget );
  2218.         CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);
  2219.     }
  2220.     
  2221.     // to validate the trigger_ID parameter
  2222.     if( typeof(trigger_ID) == "string" && trigger_ID != "" )
  2223.         CEngine.BuildTriggerObject( trigger_ID, target_ID );
  2224. }    
  2225. //End the definition of one entry to DHTML effects
  2226.  
  2227.  
  2228. /// Section End  - kadov DHTM (JavaScript 1.2)
  2229.  
  2230.  
  2231. /// Section Begin  - CCSSP DHTM (JavaScript 1.2)
  2232.  
  2233. //Begin JavaScript libary for cross-platform positioning object.
  2234. function CCSSP(){} // constructor of CCSSP class
  2235.  
  2236. CCSSP.strAgent = navigator.userAgent.toLowerCase(); 
  2237. CCSSP.nAppVersion = parseInt(navigator.appVersion);
  2238.  
  2239. CCSSP.bIsWinOS = ((CCSSP.strAgent.indexOf("win") >= 0) || (CCSSP.strAgent.indexOf("16bit") >= 0));
  2240. CCSSP.bIsMacOS = (CCSSP.strAgent.indexOf("mac") >= 0);
  2241.  
  2242. CCSSP.bIsIE = (navigator.appName.indexOf("Microsoft") >= 0);
  2243. CCSSP.bIsIE4 = (CCSSP.bIsIE && (CCSSP.nAppVersion >= 4));
  2244. CCSSP.bIsIE5 = (CCSSP.bIsIE4 && (CCSSP.strAgent.indexOf("msie 5") != -1) )
  2245.  
  2246. CCSSP.bIsNav = (navigator.appName.indexOf("Netscape") >= 0);
  2247. CCSSP.bIsNav4 = (CCSSP.bIsNav && (CCSSP.nAppVersion >= 4));
  2248. CCSSP.bIsNav6 = (CCSSP.bIsNav && (CCSSP.nAppVersion >= 5));
  2249.  
  2250. CCSSP.GetObject = function( obj )
  2251. {//convert object name string or reference into a valid object reference
  2252.     if( typeof(obj) == "object" )
  2253.         return obj;
  2254.     else if( typeof(obj) == "string" && obj != "")
  2255.     {
  2256.         if( CCSSP.bIsNav4 )
  2257.             return eval("document." + obj);
  2258.         else
  2259.             return eval("document.all." + obj);
  2260.     }
  2261.     else
  2262.         return null;
  2263. }
  2264.  
  2265. CCSSP.MoveObjectTo = function(obj, x, y)
  2266. {//positioning an object at a specific pixel coordinate
  2267.     if( CCSSP.bIsNav4 )
  2268.         obj.moveTo(x,y);
  2269.     else
  2270.     {
  2271.         obj.style.pixelLeft = x;
  2272.         obj.style.pixelTop = y;
  2273.     }
  2274. }
  2275.  
  2276. CCSSP.MoveObjectBy = function(obj, dx, dy)
  2277. {//moveing a object by x and/or y pixel
  2278.     if( CCSSP.bIsNav4 )
  2279.         obj.moveBy(dx,dy);
  2280.     else
  2281.     {
  2282.         obj.style.pixelLeft += dx;
  2283.         obj.style.pixelTop += dy;
  2284.     }
  2285. }
  2286.  
  2287. CCSSP.SetObjectBGColor = function(obj, color)
  2288. {//set the background color of an object
  2289.     if( CCSSP.bIsNav4 )
  2290.         obj.bgColor = color;
  2291.     else
  2292.         obj.style.backgroundColor = color;
  2293. }
  2294.  
  2295. CCSSP.ShowObject = function(obj, bShow)
  2296. {// set the object to be visible or invisible
  2297.     if( CCSSP.bIsNav4 )
  2298.         obj.visibility = (bShow == true) ? 'show' : 'hide';
  2299.     else
  2300.         obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
  2301. }
  2302.  
  2303. CCSSP.GetObjectLeft = function(obj)
  2304. {// retrieve the x coordinate of a posionable object
  2305.     if( CCSSP.bIsNav4 )
  2306.         return obj.left;
  2307.     else
  2308.         return obj.style.pixelLeft;
  2309. }
  2310.  
  2311. CCSSP.GetObjectTop = function(obj)
  2312. {// retrieve the y coordinate of a posionable object
  2313.     if( CCSSP.bIsNav4 )
  2314.         return obj.top;
  2315.     else
  2316.         return obj.style.pixelTop;
  2317. }
  2318.  
  2319. CCSSP.GetObjectContainLeft = function(obj)
  2320. {// retrieve the x coordinate of a posionable object relative to it's parent element
  2321.     if( CCSSP.bIsNav4 )
  2322.         return obj.pageX;
  2323.     else
  2324.     {
  2325.         if( obj == document.body )
  2326.             return obj.clientLeft;
  2327.         else
  2328.             return obj.offsetLeft;
  2329.     }
  2330. }
  2331.  
  2332. CCSSP.GetObjectWindowLeft = function(obj)
  2333. {// retrieve the x coordinate of a posionable object relative to browser window
  2334.     if( CCSSP.bIsNav4 )
  2335.         return obj.pageX;
  2336.     else
  2337.     {
  2338.         var nOffsetWindowLeft = 0;
  2339.         for(var element = obj; element; element = element.offsetParent)
  2340.             nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
  2341.         return nOffsetWindowLeft;
  2342.     }
  2343. }
  2344.  
  2345. CCSSP.GetObjectContainTop = function(obj)
  2346. {// retrieve the y coordinate of a posionable object relative to it's parent element
  2347.     if( CCSSP.bIsNav4 )
  2348.         return obj.pageY;
  2349.     else
  2350.     {
  2351.         if( obj == document.body )
  2352.             return obj.clientTop;
  2353.         else
  2354.             return obj.offsetTop;
  2355.     }
  2356. }
  2357.  
  2358. CCSSP.GetObjectWindowTop = function(obj)
  2359. {// retrieve the y coordinate of a posionable object relative to browser window
  2360.     if( CCSSP.bIsNav4 )
  2361.         return obj.pageY;
  2362.     else
  2363.     {
  2364.         var nOffsetWindowTop = 0;
  2365.         for(var element = obj; element; element = element.offsetParent)
  2366.             nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
  2367.         return nOffsetWindowTop;
  2368.     }
  2369. }
  2370.  
  2371. CCSSP.GetObjectHeight = function(obj)
  2372. {// retrieve the height of a posionable object
  2373.     if( CCSSP.bIsNav4 )
  2374.         return obj.clip.height;
  2375.     else
  2376.         return obj.offsetHeight;
  2377. }
  2378.  
  2379. CCSSP.GetObjectWidth = function(obj)
  2380. {// retrieve the width of a posionable object
  2381.     if( CCSSP.bIsNav4 )
  2382.         return obj.clip.width;
  2383.     else
  2384.         return obj.offsetWidth;
  2385. }
  2386.  
  2387. CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
  2388. { // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
  2389.     if (CCSSP.bIsNav4 && !CCSSP.bIsNav6)
  2390.         return ;
  2391.     var oldHandler = "";
  2392.     var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
  2393.     if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")
  2394.     {
  2395.         var functionDefinition = oldInlineHandler.toString();
  2396.         var bodyStart = functionDefinition.indexOf( "{" );
  2397.         var bodyEnd = functionDefinition.lastIndexOf( "}" );
  2398.         if( bodyStart > 0 || bodyEnd > bodyStart )
  2399.             oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
  2400.     }
  2401.     else if( CCSSP.bIsIE4 )
  2402.     { //search for <SCRIPT> tag which define the event handler
  2403.         for( var i = 0; i < document.scripts.length; i++ ) 
  2404.         {
  2405.             var script = document.scripts[i];
  2406.             if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
  2407.             {
  2408.                 oldHandler = script.innerHTML;
  2409.                 break;
  2410.             }
  2411.         }
  2412.     }
  2413.     
  2414.     if( oldHandler.indexOf(funcHandler) >= 0 )
  2415.         return;// to prevent register the funtion twice.
  2416.  
  2417.     if( CCSSP.bIsNav4 ) // only "onload, onresize, onfocus" apply to window
  2418.     {// other raw events will apply to layer
  2419.         var noOn = rawEventName.substring(2, rawEventName.length);
  2420.         if( typeof(noOn) == "string" && noOn.length > 3 ) {
  2421.             srcObj.captureEvents( Event[noOn.toUpperCase()] );
  2422.         }
  2423.     }
  2424.  
  2425.     var newHandler = oldHandler;
  2426.     if( newHandler.length == 0 )
  2427.         newHandler = funcHandler;
  2428.     else
  2429.         newHandler += "; " + funcHandler;
  2430.     srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
  2431. }
  2432.  
  2433. CCSSP.GetWindowHeight = function()
  2434. {// retrieve the height of available content in browser window
  2435.     if( CCSSP.bIsNav4 )
  2436.         return window.innerHeight;
  2437.     else
  2438.         return document.body.clientHeight;
  2439. }
  2440.  
  2441. CCSSP.GetWindowBottom = function()
  2442. {// retrieve the bottom postion of browser window
  2443.     if( CCSSP.bIsNav4 )
  2444.         return window.outerHeight + window.pageYOffset;
  2445.     else
  2446.         return document.body.clientHeight + document.body.scrollTop;
  2447. }
  2448.  
  2449. CCSSP.GetWindowWidth = function()
  2450. {// retrieve the width of available content in browser window
  2451.     if( CCSSP.bIsNav4 )
  2452.         return window.innerWidth;
  2453.     else
  2454.         return document.body.clientWidth;
  2455. }
  2456.  
  2457. CCSSP.GetWindowRight = function()
  2458. {// retrieve the right postion of browser window
  2459.     if( CCSSP.bIsNav4 )
  2460.         return window.outerWidth + window.pageXOffset;
  2461.     else
  2462.         return document.body.clientWidth + document.body.scrollLeft;
  2463. }
  2464.  
  2465. CCSSP.TrimString = function( objString, subtrim )
  2466. {// to trim the "subtrim" in the beginning and ending of a string object
  2467.     if( typeof(subtrim) != "string" || subtrim == null )
  2468.         return objString;
  2469.     var strHead = objString.substring(0, 1);
  2470.     var strRear = objString.substring(objString.length-1, objString.length);
  2471.     if( strHead != subtrim && strRear != subtrim )
  2472.         return objString;
  2473.     
  2474.     var spacePos = objString.indexOf(subtrim);
  2475.     if( spacePos < 0 )
  2476.         return objString;
  2477.     else if( spacePos == objString.length - 1 )
  2478.         return objString.substring(0, spacePos);
  2479.     else
  2480.     {
  2481.         var newString = objString.substring( spacePos + 1, objString.length);
  2482.         return CCSSP.TrimString( newString, subtrim );
  2483.     }
  2484. }
  2485.  
  2486. CCSSP.TrimSpace = function( objString )
  2487. {
  2488.     var Trim1 = CCSSP.TrimString( objString, " ");
  2489.     return CCSSP.TrimString( Trim1, "\'");
  2490. }
  2491.  
  2492. CCSSP.GetEventElement = function( navEventObject )
  2493. {// to get the element who fired the current event
  2494.     if(CCSSP.bIsNav4 ) 
  2495.         if (CCSSP.bIsNav6)
  2496.             return null;
  2497.         else
  2498.              navEventObject.target;
  2499.     else
  2500.         return event.srcElement;
  2501. }
  2502.  
  2503. CCSSP.PrepareFilter = function( Obj )
  2504. {//to prepare for making the filter work
  2505.     Obj.style.filter = "";
  2506.     if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
  2507.         return;
  2508.     Obj.style.height = CCSSP.GetObjectHeight(Obj);
  2509. }
  2510.  
  2511. CCSSP.IsDescendant = function( progenitor, progeny )
  2512. {
  2513.     if( typeof(progeny) == "undefined" || progeny == null )
  2514.         return false;
  2515.     else if( progeny == progenitor )
  2516.         return true; 
  2517.     else if( progeny.id == progenitor.id ) 
  2518.         return true; 
  2519.     else if( progeny.parentElement == progenitor.parentElement )
  2520.         return false;
  2521.     else
  2522.         return CCSSP.IsDescendant( progenitor, progeny.parentElement );
  2523. }
  2524.  
  2525. CCSSP.IsTextTag = function( Obj )
  2526. {
  2527.     if( typeof( Obj.tagName ) == "undefined" )
  2528.         return false;
  2529.     return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" || 
  2530.             Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
  2531. }
  2532.  
  2533. //End JavaScript libary for cross-platform positioning object.
  2534.  
  2535. /// Section End  - CCSSP DHTM (JavaScript 1.2)
  2536.  
  2537. /// Section Begin  - CCSSP DHTM 1 (JavaScript 1.2)
  2538.  
  2539. //Begin the definition of class CTrigger
  2540. function CTrigger( TriggerElement )
  2541. {
  2542.     // object : the trigger element. Never be null. 
  2543.     this.eleTrigger = TriggerElement;
  2544.     
  2545.     // number : the click counter number: only 3 values: 0,1,2;
  2546.     this.nCounter = 0; 
  2547.     
  2548.     //object as associative array of string:
  2549.     // the associate target ID strings; one element at least.            
  2550.     this.objStrTarget = new Object();
  2551.     this.eleTrigger.style.cursor = "hand";
  2552.     if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )
  2553.         this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map
  2554. }
  2555.  
  2556. CTrigger.prototype.AddTargetID = function( strTargetID )
  2557. {// add one target ID string to the objStrTarget
  2558.     if( typeof(strTargetID) != "string" )
  2559.         return ;
  2560.     if( typeof(this.objStrTarget[strTargetID]) != "string" )
  2561.         this.objStrTarget[strTargetID] = strTargetID;
  2562. }
  2563.  
  2564. CTrigger.prototype.OnTriggerClick = function()
  2565. {// to activate all asociated target
  2566.     var strEventType = ( (this.nCounter++)% 2 == 0 ) ? 
  2567.         "bssctrigger1" : "bssctrigger2";
  2568.         
  2569.     // to enumerate associative target element's ID string
  2570.     for( var strTargetID in this.objStrTarget ) 
  2571.         CEngine.SendEventToOneTarget( strTargetID, strEventType );
  2572. }
  2573. //End the definition of class CTrigger
  2574.  
  2575. //Begin the definition of class CTarget
  2576. function CTarget( TargetElement )
  2577. {
  2578.     // object : the target element. Never be null.
  2579.     this.eleTarget = TargetElement;
  2580.     this.objManager = new Object(); // object: the event manager
  2581.  
  2582. CTarget.nPageClickCounter = 0;// static class property.
  2583.  
  2584. CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )
  2585. {// return the action agency ( effect )object's refernece 
  2586.     switch( str_action_type )
  2587.     {
  2588.     case "show":return new CAgencyShow( this.eleTarget, true ) ;
  2589.     case "hide":return new CAgencyShow( this.eleTarget, false ) ;
  2590.  
  2591.     case "flyin" : 
  2592.         return new CAgencyFly(this.eleTarget, action_setting, true);
  2593.     case "flyout" : 
  2594.         return new CAgencyFly(this.eleTarget, action_setting, false);
  2595.     case "spiralin" : 
  2596.         return new CAgencySpiral(this.eleTarget, action_setting, true);
  2597.     case "spiralout" : 
  2598.         return new CAgencySpiral(this.eleTarget, action_setting, false);
  2599.     case "zoomin" :
  2600.         return new CAgencyZoom(this.eleTarget, action_setting, true);
  2601.     case "zoomout" : 
  2602.         return new CAgencyZoom(this.eleTarget, action_setting, false);
  2603.     case "elastic" : 
  2604.         return new CAgencyElastic(this.eleTarget, action_setting);
  2605.         
  2606.     case "fadein" : 
  2607.         return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;
  2608.     case "fadeout" :
  2609.         return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;
  2610.     case "rockrollstatic" :
  2611.     case "rockroll" :
  2612.         return (CCSSP.bIsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;
  2613.  
  2614.     case "glow":
  2615.         return (CCSSP.bIsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;
  2616.     case "dropshadow":
  2617.         return (CCSSP.bIsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;
  2618.     case "transition" :
  2619.         return (CCSSP.bIsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;
  2620.     case "blur" :
  2621.         return (CCSSP.bIsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;
  2622.  
  2623.     case "fliph" : // all these 4 do NOT need any parameters
  2624.     case "flipv" :
  2625.     case "invert":
  2626.     case "gray" :
  2627.         return (CCSSP.bIsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;
  2628.     
  2629.     case "fontchange": // the effects below change the style on the fly, so won't work in Navigator
  2630.         return (CCSSP.bIsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;
  2631.     case "boderchange": 
  2632.     case "stylechange":
  2633.         return (CCSSP.bIsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;
  2634.  
  2635.     default: return null;
  2636.     }
  2637. }
  2638.  
  2639. CTarget.prototype.SetEventManager = function( 
  2640.     one_event_type,str_action_type,action_setting,event_additional)
  2641. {// to set the event manager with specified action 
  2642.     if( typeof( one_event_type ) != "string" ||    
  2643.         typeof( str_action_type ) != "string"||
  2644.         typeof( action_setting ) != "string" )
  2645.         return false;
  2646.     if( typeof(this.objManager[one_event_type]) == "undefined" )
  2647.     {
  2648.         this.objManager[one_event_type] = new Object();
  2649.         this.objManager[one_event_type].length = 0;
  2650.     }
  2651.     
  2652.     var eventAgency = this.GetAgencyObject(str_action_type,action_setting);
  2653.     if( eventAgency != null )
  2654.     {
  2655.         var ct = this.objManager[one_event_type].length ++;
  2656.         this.objManager[one_event_type][ct] = eventAgency;
  2657.         
  2658.         if( one_event_type == "bsscpageclick" )
  2659.         {// to deal with the "number of pageclick" stuff
  2660.             if( typeof(event_additional) == "number" )
  2661.                 this.objManager[one_event_type][ct].nPageClick = event_additional;
  2662.             else // set the default number 
  2663.                 this.objManager[one_event_type][ct].nPageClick = 1;
  2664.             
  2665.             if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||
  2666.                 (this.objManager[one_event_type][ct].nPageClick < 
  2667.                     this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )
  2668.                 this.objManager.nMinPageClickIndex = ct;
  2669.         }
  2670.         
  2671.         //hide the object blindly,SetState function will take care of the final correct state
  2672.         if( ((one_event_type == "bsscpageclick") && 
  2673.              (this.objManager[one_event_type][ct].nPageClick == 1)) ||
  2674.             one_event_type == "bsscpageload" ||
  2675.             one_event_type == "bssctrigger1" )
  2676.             CCSSP.ShowObject( this.eleTarget, false );
  2677.         
  2678.         if( one_event_type == "bssctrigger1" || one_event_type == "bssctrigger2" )
  2679.             if( typeof( this.strTriggerEvent ) == "undefined" )
  2680.                 this.strTriggerEvent = ( one_event_type == "bssctrigger1" ) ? "bssctrigger2" : "bssctrigger1";
  2681.             
  2682.         return true;
  2683.     }
  2684.     return false;
  2685. }
  2686.  
  2687. CTarget.prototype.OnEvent = function( strBsscEvent )
  2688. {// response to the event ( bssc format )
  2689.     if( typeof(this.objManager[strBsscEvent]) == "object" )
  2690.     { // to get the event agency from the event manager
  2691.         var eventAgency = this.objManager[strBsscEvent];
  2692.         for( var i = 0; i < eventAgency.length; i++ )
  2693.         {
  2694.             if( strBsscEvent == "bsscpageclick" && 
  2695.                  eventAgency[i].nPageClick != CTarget.nPageClickCounter )
  2696.                  continue;
  2697.             else if( strBsscEvent == "bsschover" && event.type == "mouseout" )
  2698.                 eventAgency[i].EndEffect();
  2699.             else // to invoke the unified function in effect object    
  2700.                 eventAgency[i].UpdateEffect(); 
  2701.         }
  2702.     }
  2703. }
  2704.  
  2705. CTarget.prototype.SetState = function( strBsscEvent )
  2706. {
  2707.     if( typeof(this.objManager[strBsscEvent]) != "object" )
  2708.         return false;
  2709.  
  2710.     // to get the event agency from the event manager
  2711.     var eventAgency = this.objManager[strBsscEvent];
  2712.     
  2713.     if( strBsscEvent == "bsscpageclick" )
  2714.     {// we only set the initial state for the minium number of pageclick 
  2715.         eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();
  2716.         return true;
  2717.     }
  2718.     else
  2719.     {
  2720.         for( var i = 0; i < eventAgency.length; i++ )
  2721.             eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object     
  2722.         if( i > 0 )
  2723.             return true;
  2724.         else
  2725.             return false;
  2726.     }
  2727. }
  2728. //End the definition of class CTarget
  2729.  
  2730. //Begin the definition of CEngine class
  2731. function CEngine(){}// all properities are going be "class" properities
  2732.  
  2733. // object : as associative array of trigger objects
  2734. CEngine.objTrigger = new Object();
  2735. // object : as associative array of target objects 
  2736. CEngine.objTarget = new Object(); 
  2737.  
  2738. // Array : each element is a CAgencyXXX animation object
  2739. CEngine.arrAnimation = new Array();
  2740. CEngine.PerformAnimation = function( nIndex )
  2741. {// animation : update effects function
  2742.     CEngine.arrAnimation[nIndex].UpdateEffect();
  2743. }
  2744.  
  2745. CEngine.AddOneTrigger = function(TriggerID,TriggerElement)
  2746. {// add one Trigger object into the trigger array
  2747.     if( typeof(TriggerID) != "string" || TriggerElement == null ||
  2748.         typeof(TriggerElement) != "object" )
  2749.         return;
  2750.     if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )
  2751.         CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);
  2752. }
  2753.     
  2754. CEngine.AddOneTarget = function(TargetID, TargetElement)
  2755. {// add one Target object into the target array
  2756.     if( typeof(TargetID) != "string" || TargetElement == null ||
  2757.         typeof(TargetElement) != "object" )
  2758.         return;
  2759.     if( typeof(CEngine.objTarget[TargetID]) != "object" )
  2760.         CEngine.objTarget[TargetID] = new CTarget( TargetElement );
  2761. }
  2762.  
  2763. CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )
  2764. {// to activate one target object
  2765.     if( typeof(CEngine.objTarget[strTargetID]) == "object" ) 
  2766.     {
  2767.         if( strBsscEvent == "bssctrigger1" || strBsscEvent == "bssctrigger2" )
  2768.         {//now, the "bssctrigger1" and "bssctrigger2" work like a toggle
  2769.             if( strBsscEvent == CEngine.objTarget[strTargetID].strTriggerEvent )
  2770.                 strBsscEvent = (strBsscEvent == "bssctrigger1") ? "bssctrigger2" : "bssctrigger1";
  2771.             CEngine.objTarget[strTargetID].strTriggerEvent = strBsscEvent;
  2772.         }
  2773.         CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );
  2774.     }
  2775. }
  2776.  
  2777. CEngine.SendEventToAllTarget = function( strBsscEvent )
  2778. { //to activate all target associative to the BSSC event
  2779.     for( var strTargetID in CEngine.objTarget ) //to enumerate all target
  2780.         CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );
  2781. }
  2782.  
  2783. CEngine.SetOneTargetInitialState = function( strTargetID )
  2784. {// only invoked after ALL effects for the target have been set
  2785.     if( typeof(CEngine.objTarget[strTargetID]) == "object" ) 
  2786.     {// to get target object
  2787.         var objTarget = CEngine.objTarget[strTargetID];
  2788.         if( objTarget.SetState( "bsscpageload" ) == false )
  2789.         {
  2790.             objTarget.SetState( "bsscpageclick" );
  2791.             objTarget.SetState( "bssctrigger1" );
  2792.         }
  2793.     }
  2794. }
  2795.  
  2796. CEngine.AdjustPageClickCounter = function()
  2797. {
  2798.     var nAdjustedClickCounter = CTarget.nPageClickCounter;
  2799.     var bAdjusted = false;
  2800.     for( var strTargetID in CEngine.objTarget ) //to enumerate all target
  2801.     {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter
  2802.         var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;
  2803.         if( objEventPageClick != null )
  2804.         {
  2805.             for( var i = 0; i < objEventPageClick.length; i++ )
  2806.             {
  2807.                 var nOtherPageClick = objEventPageClick[i].nPageClick;
  2808.                 if( nOtherPageClick == CTarget.nPageClickCounter )
  2809.                     return;
  2810.                 if( nOtherPageClick > CTarget.nPageClickCounter )
  2811.                 {
  2812.                     if( !bAdjusted )
  2813.                     {
  2814.                         nAdjustedClickCounter = nOtherPageClick;
  2815.                         bAdjusted = true;
  2816.                     }
  2817.                     else if( nOtherPageClick < nAdjustedClickCounter )
  2818.                         nAdjustedClickCounter = nOtherPageClick;
  2819.                 }
  2820.             }
  2821.         }
  2822.     }
  2823.     CTarget.nPageClickCounter = nAdjustedClickCounter;
  2824. }
  2825.  
  2826. CEngine.OnPageLoad = function()
  2827. {     
  2828.     // first, to set all target's initial state
  2829.     for( var strTargetID in CEngine.objTarget )
  2830.         CEngine.SetOneTargetInitialState( strTargetID );
  2831.     
  2832.     // to invoke all target's onpageload handler
  2833.     CEngine.SendEventToAllTarget( "bsscpageload" );
  2834. }
  2835.  
  2836. CEngine.OnPageClick = function()
  2837. { // to invoke all target's onpageclick handler
  2838.     var src = CCSSP.GetEventElement( arguments[0] );
  2839.     if( src == null )
  2840.         return;
  2841.         
  2842.     var objClickedTrigger = null;
  2843.     for( var strTriggerID in CEngine.objTrigger )
  2844.     { // to detect which trigger is clicked
  2845.         if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )
  2846.         {
  2847.             objClickedTrigger = CEngine.objTrigger[strTriggerID];
  2848.             break;
  2849.         }
  2850.     }
  2851.     
  2852.     if( objClickedTrigger != null) // the clicked trigger found
  2853.         objClickedTrigger.OnTriggerClick();
  2854.     else // no trigger is clicked
  2855.     { // to send PageClick event to all target
  2856.         CTarget.nPageClickCounter++;
  2857.         CEngine.AdjustPageClickCounter();
  2858.         CEngine.SendEventToAllTarget( "bsscpageclick" );
  2859.     }
  2860. }    
  2861.  
  2862. CEngine.OnMouseOver = function()
  2863. { // to invoke all target's onpageload handler
  2864.     var src = CCSSP.GetEventElement( arguments[0] );
  2865.     if( src == null )
  2866.         return;
  2867.         
  2868.     var strHoveredTargetID = null;
  2869.     for( var strTargetID in CEngine.objTarget )
  2870.     { // to detect which Target is hovering on
  2871.         if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )
  2872.         {
  2873.             strHoveredTargetID = strTargetID;
  2874.             break;
  2875.         }
  2876.     }
  2877.     
  2878.     if( strHoveredTargetID != null ) // the hovered target found
  2879.         CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );
  2880. }
  2881.  
  2882. CEngine.BuildTargetObject = function(target_ID,event_type,action_type,
  2883.             action_setting, event_additional)
  2884. {// to build target object 
  2885.     // to get the target object
  2886.     if( typeof( CEngine.objTarget[target_ID] ) != "object" )
  2887.         return false;// the engine's AddOneTarget function might have failed.
  2888.     var TargetObject = CEngine.objTarget[target_ID];
  2889.     
  2890.     // to prepare the parameters for the event manager
  2891.     var arrEvent = event_type.split("|"); // to split the combined event_type string
  2892.     var arrAction = action_type.split("|");//to split the combined action_type string
  2893.     for( var trim = 0; trim < arrEvent.length; trim++ )
  2894.         arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);
  2895.     
  2896.     for( trim = 0; trim < arrAction.length; trim++ )
  2897.         arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);
  2898.     
  2899.     var arrSetting = new Array(); 
  2900.     if( typeof(action_setting) == "string" )
  2901.         arrSetting = action_setting.split("|");// to split the combined action_setting string
  2902.     // to calibrate the arrays
  2903.     for( var i = arrSetting.length; i < arrAction.length; i++ )
  2904.     {
  2905.         if( typeof(arrSetting[i]) != "string" )
  2906.              arrSetting[i] = "";
  2907.     }                 
  2908.  
  2909.     // to prepare for dealing with the absolute posioning element
  2910.     TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );
  2911.     TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );
  2912.  
  2913.     if( arrEvent.length > 1 )
  2914.     {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"
  2915.         if( arrAction.length != 2 )
  2916.             return false; // if event is combined, there must be 2 actions
  2917.         for( i = 0 ; i < 2; i++ )
  2918.         {
  2919.             if( TargetObject.SetEventManager(arrEvent[i], arrAction[i], 
  2920.                 arrSetting[i], event_additional) == false )
  2921.                 return false; // the event manager has not been set up
  2922.         }
  2923.     }
  2924.     else // the event_type string is not combined
  2925.     {
  2926.         for( i = 0 ; i < arrAction.length; i++ )
  2927.         {
  2928.             TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);
  2929.             // to validate the event manager
  2930.             if( typeof(TargetObject.objManager[event_type]) != "object" ||
  2931.                     typeof(TargetObject.objManager[event_type][i]) != "object" )
  2932.                 return false; // the event manager has not been set up
  2933.         }
  2934.     }
  2935.     return true;
  2936. }
  2937.  
  2938. CEngine.BuildTriggerObject = function(trigger_ID, target_ID)
  2939. {// to build the trigger object
  2940.     var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string
  2941.     for( var i = 0; i < arrTrigger.length; i ++ )
  2942.     {// to get the trigger element then add it to the trigger list
  2943.         arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );
  2944.         var eleTrigger = CCSSP.GetObject( arrTrigger[i] );
  2945.         if( eleTrigger == null )
  2946.             continue; // the trigger_ID string in the HTML code maybe wrong
  2947.         CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );
  2948.  
  2949.         // to get the target object
  2950.         if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )
  2951.             continue;// the engine's AddOneTarget function might have failed.
  2952.         CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );
  2953.     }
  2954. }
  2955. //End the definition of CEngine class
  2956.  
  2957. /// Section End  - CCSSP DHTM 1 (JavaScript 1.2)
  2958.  
  2959. /// Section Begin  - CCSSP DHTM 2 (JavaScript 1.2)
  2960.  
  2961. //Begin the definition of CAgencyXXXX classes
  2962.  
  2963. //Begin of the CAgencyShow definition
  2964. function CAgencyShow( element, bIsShow )
  2965. {
  2966.     this.ele = element;
  2967.     this.bIsShow = bIsShow;
  2968. }
  2969.  
  2970. CAgencyShow.prototype.PrepareEffect = function()
  2971. {
  2972.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  2973. }
  2974.  
  2975. CAgencyShow.prototype.UpdateEffect = function()
  2976. {
  2977.     CCSSP.ShowObject( this.ele, this.bIsShow );
  2978. }
  2979.  
  2980. CAgencyShow.prototype.EndEffect = function()
  2981. {
  2982.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  2983. }
  2984. // End of the CAgencyShow definition
  2985.  
  2986. // Begin of CAgencyFly definition
  2987. function CAgencyFly( element, settings, bIsIn )
  2988. {
  2989.     this.ele = element;
  2990.     this.bIsIn = bIsIn;
  2991.     this.duration = 1000; // default
  2992.     this.direction = "right";
  2993.  
  2994.     var arrAllSet = settings.split(",");
  2995.     for( var i = 0; i < arrAllSet.length; i ++ )
  2996.     {// to retrieve the setting
  2997.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  2998.         var arrOneSet = arrAllSet[i].split("=");
  2999.         for( var j = 0; j < arrOneSet.length; j++ )
  3000.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3001.         switch( arrOneSet[0] )
  3002.         {
  3003.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  3004.         case "direction" : this.direction = arrOneSet[1]; break;
  3005.         }
  3006.     }
  3007.         
  3008.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  3009.         this.ele.style.position = "relative";
  3010.     this.timer = null;
  3011.     this.aniIndex = CEngine.arrAnimation.length;
  3012.     CEngine.arrAnimation[this.aniIndex] = this;
  3013. }
  3014.  
  3015. CAgencyFly.prototype.PrepareEffect = function()
  3016. {
  3017.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  3018. }
  3019.  
  3020. CAgencyFly.prototype.UpdateEffect = function()
  3021. {
  3022.     if( this.timer == null )
  3023.         this.ResetParameters();
  3024.  
  3025.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3026.     if( percent >= 1.0 )
  3027.         this.EndEffect();
  3028.     else
  3029.     {
  3030.         var newX = this.startX*(1.0-percent) +  this.finalX*percent;
  3031.         var newY = this.startY*(1.0-percent) +  this.finalY*percent;
  3032.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  3033.         if( this.timer == null )
  3034.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  3035.     }
  3036. }
  3037.  
  3038. CAgencyFly.prototype.EndEffect = function()
  3039. {
  3040.     clearInterval( this.timer );
  3041.     this.timer = null;
  3042.  
  3043.     if( this.bIsIn ) // FlyIn
  3044.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  3045.     else // FlyOut
  3046.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  3047.     CCSSP.ShowObject(this.ele, this.bIsIn );
  3048. }
  3049.  
  3050. CAgencyFly.prototype.ResetParameters = function()
  3051. {
  3052.     this.PrepareEffect();
  3053.     CCSSP.ShowObject(this.ele, true );
  3054.  
  3055.     this.startX = 0;
  3056.     this.startY = 0;
  3057.     this.finalX = 0;
  3058.     this.finalY = 0; 
  3059.     
  3060.     var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
  3061.     var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
  3062.     var offsetRight = CCSSP.GetWindowRight();
  3063.     var offsetBottom = CCSSP.GetWindowBottom();
  3064.  
  3065.     if( this.bIsIn )
  3066.     { // FlyIn
  3067.         this.finalX = this.ele.ABSX;
  3068.         this.finalY = this.ele.ABSY;
  3069.  
  3070.         switch( this.direction )
  3071.         {
  3072.         case "right": this.startX = offsetRight; this.startY = this.finalY; break;
  3073.         case "left": this.startX = -offsetLeft;  this.startY = this.finalY; break;
  3074.         case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
  3075.         case "up":  this.startY = -offsetTop;    this.startX = this.finalX; break;
  3076.         case "downright":
  3077.               this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  3078.             this.startY = this.startX;        break;
  3079.         case "upright":
  3080.               this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  3081.             this.startY = -this.startX;        break;
  3082.         case "upleft":
  3083.             this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  3084.             this.startY = this.startX;        break;
  3085.         case "downleft":
  3086.             this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  3087.             this.startY = -this.startX;     break;
  3088.         }
  3089.     }
  3090.     else
  3091.     { // FlyOut
  3092.         this.startX = this.ele.ABSX;
  3093.         this.startY = this.ele.ABSY;
  3094.  
  3095.         switch( this.direction )
  3096.         {
  3097.         case "right": this.finalX = offsetRight;  this.finalY = this.startY; break;
  3098.         case "left": this.finalX = -offsetLeft;   this.finalY = this.startY;  break;
  3099.         case "down": this.finalY = offsetBottom;  this.finalX = this.startX; break;
  3100.         case "up":  this.finalY = -offsetTop;     this.finalX = this.startX; break;
  3101.         case "downright":
  3102.               this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  3103.             this.finalY = this.finalX;        break;
  3104.         case "upright":
  3105.               this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  3106.             this.finalY = -this.finalX;        break;
  3107.         case "upleft":
  3108.             this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  3109.             this.finalY = this.finalX;        break;
  3110.         case "downleft":
  3111.             this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  3112.             this.finalY = -this.finalX;     break;
  3113.         }
  3114.     }
  3115.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  3116.     this.startTime = (new Date()).getTime();
  3117. }
  3118. // End of the CAgencyFly definition
  3119.  
  3120. // Begin of CAgencySpiral
  3121. function CAgencySpiral( element, settings, bIsIn )
  3122. {
  3123.     this.ele = element;
  3124.     this.bIsIn = bIsIn;
  3125.     this.duration = 1000; // default
  3126.  
  3127.     var arrAllSet = settings.split(",");
  3128.     for( var i = 0; i < arrAllSet.length; i ++ )
  3129.     {// to retrieve the setting
  3130.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3131.         var arrOneSet = arrAllSet[i].split("=");
  3132.         for( var j = 0; j < arrOneSet.length; j++ )
  3133.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3134.         switch( arrOneSet[0] )
  3135.         {
  3136.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  3137.         }
  3138.     }
  3139.  
  3140.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  3141.         this.ele.style.position = "relative";
  3142.     this.timer = null;
  3143.     this.aniIndex = CEngine.arrAnimation.length;
  3144.     CEngine.arrAnimation[this.aniIndex] = this;
  3145. }
  3146.  
  3147. CAgencySpiral.prototype.PrepareEffect = function()
  3148. {
  3149.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  3150. }
  3151.  
  3152. CAgencySpiral.prototype.UpdateEffect = function()
  3153. {
  3154.     if( this.timer == null )
  3155.         this.ResetParameters();
  3156.  
  3157.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3158.     if( percent >= 1.0 )
  3159.         this.EndEffect();
  3160.     else
  3161.     {
  3162.         var rf = (this.bIsIn)? (1.0 - percent) : percent; 
  3163.         var t = (1.0-rf) * 4.0 * Math.PI
  3164.         var rxP = (this.bIsIn)? this.startX : this.finalX; 
  3165.         var ryP = (this.bIsIn)? this.startY : this.finalY; 
  3166.         var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
  3167.         var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
  3168.  
  3169.         var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
  3170.         var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
  3171.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  3172.         if( this.timer == null )
  3173.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  3174.     }
  3175. }
  3176.  
  3177. CAgencySpiral.prototype.EndEffect = function()
  3178. {
  3179.     clearInterval( this.timer );
  3180.     this.timer = null;
  3181.     
  3182.     if( this.bIsIn ) // In
  3183.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  3184.     else // Out
  3185.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  3186.     CCSSP.ShowObject(this.ele, this.bIsIn );
  3187. }
  3188.  
  3189. CAgencySpiral.prototype.ResetParameters = function()
  3190. {
  3191.     this.PrepareEffect();
  3192.     CCSSP.ShowObject(this.ele, true );
  3193.     this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
  3194.     this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
  3195.     this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
  3196.     this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom(); 
  3197.     
  3198.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  3199.     this.startTime = (new Date()).getTime();
  3200. }
  3201. // End of CAgencySpiral
  3202.  
  3203. // Begin of CAgencyElastic
  3204. function CAgencyElastic( element, settings)
  3205. {
  3206.     this.ele = element;
  3207.     this.duration = 1000; // default
  3208.     this.direction = "right";
  3209.  
  3210.     var arrAllSet = settings.split(",");
  3211.     for( var i = 0; i < arrAllSet.length; i ++ )
  3212.     {// to retrieve the setting
  3213.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3214.         var arrOneSet = arrAllSet[i].split("=");
  3215.         for( var j = 0; j < arrOneSet.length; j++ )
  3216.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3217.         switch( arrOneSet[0] )
  3218.         {
  3219.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  3220.         case "direction" : this.direction = arrOneSet[1]; break;
  3221.         }
  3222.     }
  3223.         
  3224.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  3225.         this.ele.style.position = "relative";
  3226.     this.timer = null;
  3227.     this.aniIndex = CEngine.arrAnimation.length;
  3228.     CEngine.arrAnimation[this.aniIndex] = this;
  3229. }
  3230.  
  3231. CAgencyElastic.prototype.PrepareEffect = function()
  3232. {
  3233.     CCSSP.ShowObject(this.ele, false );
  3234. }
  3235.  
  3236. CAgencyElastic.prototype.UpdateEffect = function()
  3237. {
  3238.     if( this.timer == null )
  3239.         this.ResetParameters();
  3240.  
  3241.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3242.     if( percent >= 1.0 )
  3243.         this.EndEffect();
  3244.     else
  3245.     {
  3246.         var newX = this.startX;
  3247.         var newY = this.startY;
  3248.         var rf = Math.exp(-percent*3);
  3249.         var t = percent * 1.5 * Math.PI
  3250.         var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
  3251.         switch (this.direction )
  3252.         {
  3253.         case "left":   
  3254.         case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  3255.         case "up":       
  3256.         case "down" :  newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  3257.         }
  3258.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  3259.         if( this.timer == null )
  3260.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  3261.     }
  3262. }
  3263.  
  3264. CAgencyElastic.prototype.EndEffect = function()
  3265. {
  3266.     CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  3267.     clearInterval( this.timer );
  3268.     this.timer = null;
  3269. }
  3270.  
  3271. CAgencyElastic.prototype.ResetParameters = function()
  3272. {
  3273.     CCSSP.ShowObject(this.ele, true );
  3274.     this.startX = this.ele.ABSX;
  3275.     this.finalX = this.ele.ABSX;
  3276.     this.startY = this.ele.ABSY;
  3277.     this.finalY = this.ele.ABSY;
  3278.     
  3279.     switch (this.direction)
  3280.     { 
  3281.     case "left":  this.startX = -this.ele.offsetWidth; break;
  3282.     case "right": this.startX = this.ele.offsetWidth;  break;
  3283.     case "up":    this.startY = -this.ele.offsetHeight;break;
  3284.     case "down":  this.startY = this.ele.offsetHeight; break;
  3285.     }
  3286.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  3287.     this.startTime = (new Date()).getTime();
  3288. }
  3289. // End of CAgencyElastic
  3290.  
  3291. // Begin of CAgencyZoom
  3292. function CAgencyZoom( element, settings, bIsIn)
  3293. {
  3294.     this.ele = element;
  3295.     this.duration = 1000; // default
  3296.     
  3297.     var arrAllSet = settings.split(",");
  3298.     for( var i = 0; i < arrAllSet.length; i ++ )
  3299.     {// to retrieve the setting
  3300.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3301.         var arrOneSet = arrAllSet[i].split("=");
  3302.         for( var j = 0; j < arrOneSet.length; j++ )
  3303.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3304.         switch( arrOneSet[0] )
  3305.         {
  3306.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  3307.         }
  3308.     }
  3309.  
  3310.     this.bIsIn = bIsIn;
  3311.     this.timer = null;
  3312.     this.aniIndex = CEngine.arrAnimation.length;
  3313.     CEngine.arrAnimation[this.aniIndex] = this;
  3314. }
  3315.  
  3316. CAgencyZoom.prototype.PrepareEffect = function()
  3317. {
  3318.     CCSSP.ShowObject(this.ele, false);
  3319. }
  3320.  
  3321. CAgencyZoom.prototype.UpdateEffect = function()
  3322. {
  3323.     if( this.timer == null )
  3324.         this.ResetParameters();
  3325.  
  3326.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3327.     if( percent >= 1.0 )
  3328.         this.EndEffect();
  3329.     else
  3330.     {
  3331.         var nFactorIn = Math.ceil(50+50*percent);
  3332.         var nFactorOut = Math.ceil(100+200*(1-percent));
  3333.         var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
  3334.         var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
  3335.         
  3336.         this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
  3337.         for(var index = 0; index < this.ele.all.length; index++)
  3338.             this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
  3339.             
  3340.         if( this.timer == null )
  3341.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  3342.     }
  3343. }
  3344.  
  3345. CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
  3346. {
  3347.     if( CCSSP.IsTextTag(child) )
  3348.         child.style.fontSize = FontSize;
  3349.     else
  3350.     {
  3351.         if( typeof(child.orgWidth) == "number" )
  3352.             child.style.width = Factor * child.orgWidth;
  3353.         if( typeof(child.orgHeight) == "number" )
  3354.             child.style.height = Factor * child.orgHeight;
  3355.     }
  3356. }
  3357.  
  3358. CAgencyZoom.prototype.EndEffect = function()
  3359. {
  3360.     this.EndEffectAllChildren(this.ele);
  3361.     for(var index = 0; index < this.ele.all.length; index++)
  3362.         this.EndEffectAllChildren(this.ele.all[index]);
  3363.     
  3364.     clearInterval( this.timer );
  3365.     this.timer = null;
  3366. }
  3367.  
  3368. CAgencyZoom.prototype.EndEffectAllChildren = function( child )
  3369. {    
  3370.     if( CCSSP.IsTextTag(child) )
  3371.         child.style.fontSize = child.orgFontSize;
  3372.     else
  3373.     {
  3374.         if( typeof(child.intactWidth) != "undefined" )
  3375.         {
  3376.             child.width = child.intactWidth;
  3377.             child.height = child.intactHeight;
  3378.         }
  3379.         else if( typeof(child.style.intactPixelWidth) != "undefined" )
  3380.         {
  3381.             child.style.pixelWidth = child.style.intactPixelWidth;
  3382.             child.style.pixelHeight = child.style.intactPixelHeight;
  3383.         }
  3384.     }
  3385. }
  3386.  
  3387. CAgencyZoom.prototype.ResetParameters = function()
  3388. {
  3389.     this.PrepareEffect();
  3390.     this.ResetParametersAllChildren( this.ele );
  3391.     for(var index = 0; index < this.ele.all.length; index++)
  3392.         this.ResetParametersAllChildren(this.ele.all[index]);
  3393.         
  3394.     this.startTime = (new Date()).getTime();
  3395. }
  3396.  
  3397. CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
  3398. {
  3399.     CCSSP.ShowObject(child, true );
  3400.     if( (child.tagName == "DIV") && (child.parentElement.tagName == "TD") )
  3401.         child.width = "100%";// if the div is inside a cell of table, we need the this hack
  3402.     
  3403.     if( CCSSP.IsTextTag(child) )
  3404.         child.orgFontSize = child.style.fontSize;
  3405.     else
  3406.     {
  3407.         if( child.width > "" || child.height > "" )
  3408.         {
  3409.             child.orgWidth = child.intactWidth = child.width;
  3410.             child.orgHeight = child.intactHeight = child.height;
  3411.         }
  3412.         else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
  3413.         {
  3414.             child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
  3415.             child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
  3416.         }
  3417.     }
  3418. }
  3419. // End of CAgencyZoom
  3420.  
  3421. //// the following effects will use IE's exclusive "filter" function ////
  3422. // Begin of CAgencyAlpha definition
  3423. function CAgencyAlpha( element, settings, bIsIn )
  3424. {// because of "visual filter" style, this won't work in Navigator
  3425.     this.ele = element;
  3426.     this.bIsIn = bIsIn;
  3427.  
  3428.     // to set the default value
  3429.     this.startOpacity = (this.bIsIn) ? 0 : 100;
  3430.     this.endOpacity = (this.bIsIn) ? 100 : 0;
  3431.     
  3432.     this.duration = 1000; // default
  3433.     
  3434.     var arrAllSet = settings.split(",");
  3435.     for( var i = 0; i < arrAllSet.length; i ++ )
  3436.     {// to retrieve the setting
  3437.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3438.         var arrOneSet = arrAllSet[i].split("=");
  3439.         for( var j = 0; j < arrOneSet.length; j++ )
  3440.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3441.         switch( arrOneSet[0] )
  3442.         {
  3443.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  3444.         }
  3445.     }
  3446.     
  3447.     this.timer = null;
  3448.     this.aniIndex = CEngine.arrAnimation.length;
  3449.     CEngine.arrAnimation[this.aniIndex] = this;
  3450. }
  3451.  
  3452. CAgencyAlpha.prototype.PrepareEffect = function()
  3453. {// to set the visual filter function
  3454.     // the visual filter ONLY work when set by "Width and Height" or
  3455.     // absolute position for DIV, SPAN and normal tag ( such as p )
  3456.     // but, "absolute" cause the following elements overlap, so:
  3457.     CCSSP.PrepareFilter( this.ele );
  3458.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  3459. }
  3460.  
  3461. CAgencyAlpha.prototype.UpdateEffect = function()
  3462. {// to set the visual filter function
  3463.     if( this.timer == null )
  3464.         this.ResetParameters();
  3465.     if( typeof(this.ele.filters.alpha) != "object" )
  3466.     {
  3467.         this.EndEffect();
  3468.         return;
  3469.     }
  3470.  
  3471.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3472.     if( percent >= 1.0 )
  3473.         this.EndEffect();
  3474.     else if( typeof(this.ele.filters.alpha) == "object" )
  3475.     {
  3476.         this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
  3477.         if( this.timer == null )
  3478.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  3479.     }
  3480. }
  3481.  
  3482. CAgencyAlpha.prototype.EndEffect = function()
  3483. {// to remove the visual filter function
  3484.     clearInterval( this.timer );
  3485.     this.timer = null;
  3486.     this.ele.style.filter = "";
  3487.     CCSSP.ShowObject(this.ele, this.bIsIn );
  3488. }
  3489.  
  3490. CAgencyAlpha.prototype.ResetParameters = function()
  3491. {
  3492.     this.PrepareEffect();
  3493.     CCSSP.ShowObject(this.ele, true );
  3494.     this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
  3495.     this.startTime = (new Date()).getTime();
  3496. }
  3497. // End of the CAgencyAlpha definition
  3498.  
  3499. // Begin of CAgencyWave definition
  3500. function CAgencyWave( element, settings )
  3501. {// because of "visual filter" style, this won't work in Navigator
  3502.     this.ele = element;
  3503.  
  3504.     this.duration = 0; // default
  3505.     this.strength = 10;
  3506.     this.freq = 1;
  3507.     this.lightstrength = 1;
  3508.     
  3509.     var arrAllSet = settings.split(",");
  3510.     for( var i = 0; i < arrAllSet.length; i ++ )
  3511.     {// to retrieve the setting
  3512.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3513.         var arrOneSet = arrAllSet[i].split("=");
  3514.         for( var j = 0; j < arrOneSet.length; j++ )
  3515.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3516.         switch( arrOneSet[0] )
  3517.         {
  3518.         case "duration" : this.duration = 100000/arrOneSet[1]; break;
  3519.         case "strength" : this.strength = arrOneSet[1]; break;
  3520.         case "freq" : this.freq = arrOneSet[1]; break;
  3521.         case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
  3522.         }
  3523.     }
  3524.  
  3525.     this.timer = null;
  3526.     this.aniIndex = CEngine.arrAnimation.length;
  3527.     CEngine.arrAnimation[this.aniIndex] = this;
  3528. }
  3529.  
  3530. CAgencyWave.prototype.PrepareEffect = function()
  3531. {// to set the visual filter function
  3532.     CCSSP.PrepareFilter(this.ele);
  3533.  
  3534.     CCSSP.ShowObject(this.ele, true );
  3535. }
  3536.  
  3537. CAgencyWave.prototype.UpdateEffect = function()
  3538. {// to set the visual filter function
  3539.     if( this.timer == null )
  3540.         this.ResetParameters();
  3541.     if( typeof(this.ele.filters.wave) != "object" )
  3542.     {
  3543.         this.EndEffect();
  3544.         return;
  3545.     }
  3546.  
  3547.     if( this.duration > 0 )
  3548.     {
  3549.         var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  3550.         if( percent >= 1.0 )
  3551.         {
  3552.             this.EndEffect();
  3553.             return;
  3554.         }
  3555.     }
  3556.     
  3557.     this.ele.filters.wave.phase += 5;
  3558.     this.ele.filters.wave.phase %= 100;
  3559.     if( this.timer == null )
  3560.         this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
  3561. }
  3562.  
  3563. CAgencyWave.prototype.EndEffect = function()
  3564. {// to remove the visual filter function
  3565.     this.ele.style.filter = "";
  3566.     clearInterval( this.timer );
  3567.     this.timer = null;
  3568. }
  3569.  
  3570. CAgencyWave.prototype.ResetParameters = function()
  3571. {
  3572.     this.PrepareEffect();
  3573.     this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" + 
  3574.      this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
  3575.     this.startTime = (new Date()).getTime();
  3576. }
  3577. // End of the CAgencyWave definition
  3578.  
  3579. // Begin of CAgencyGlow definition
  3580. function CAgencyGlow( element, settings )
  3581. {// because of "visual filter" style, this won't work in Navigator
  3582.     this.ele = element;
  3583.  
  3584.     // to set the default value
  3585.     this.glowColor = "green";
  3586.     this.glowStrength = "3";
  3587.     
  3588.     var arrAllSet = settings.split(",");
  3589.     for( var i = 0; i < arrAllSet.length; i ++ )
  3590.     {
  3591.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3592.         var arrOneSet = arrAllSet[i].split("=");
  3593.         for( var j = 0; j < arrOneSet.length; j++ )
  3594.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3595.         switch( arrOneSet[0] )
  3596.         {
  3597.         case "color" : this.glowColor = arrOneSet[1]; break;
  3598.         case "strength" : this.glowStrength = arrOneSet[1]; break;
  3599.         }
  3600.     }
  3601. }
  3602.  
  3603. CAgencyGlow.prototype.PrepareEffect = function()
  3604. {
  3605.     CCSSP.PrepareFilter(this.ele);
  3606.     CCSSP.ShowObject(this.ele, true );
  3607.     if( this.ele.style.backgroundColor != "" )
  3608.     {//style.backgroundColor somehow stop the visual filter
  3609.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  3610.         this.ele.style.backgroundColor = "";
  3611.     }
  3612. }
  3613.  
  3614. CAgencyGlow.prototype.UpdateEffect = function()
  3615. {// to set the visual filter function
  3616.     this.PrepareEffect();
  3617.     this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" + 
  3618.         this.glowStrength + ", enabled=true" +")";
  3619. }
  3620.  
  3621. CAgencyGlow.prototype.EndEffect = function()
  3622. {// to remove the visual filter function
  3623.     this.ele.style.filter = "";
  3624.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  3625.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  3626. }
  3627. // End of the CAgencyGlow definition
  3628.  
  3629. // Begin of CAgencyDropShadow definition
  3630. function CAgencyDropShadow( element, settings )
  3631. {// because of "visual filter" style, this won't work in Navigator
  3632.     this.ele = element;
  3633.  
  3634.     // to set the default value
  3635.     this.shadowColor = "black"; 
  3636.     this.shadowOffx = "1";
  3637.     this.shadowOffy = "1";
  3638.     
  3639.     var arrAllSet = settings.split(",");
  3640.     for( var i = 0; i < arrAllSet.length; i ++ )
  3641.     {
  3642.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3643.         var arrOneSet = arrAllSet[i].split("=");
  3644.         for( var j = 0; j < arrOneSet.length; j++ )
  3645.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3646.         switch( arrOneSet[0] )
  3647.         {
  3648.         case "color" : this.shadowColor = arrOneSet[1]; break;
  3649.         case "offx" : this.shadowOffx = arrOneSet[1]; break;
  3650.         case "offy" : this.shadowOffy = arrOneSet[1]; break;
  3651.         }
  3652.     }
  3653. }
  3654.  
  3655. CAgencyDropShadow.prototype.PrepareEffect = function()
  3656. {
  3657.     CCSSP.PrepareFilter(this.ele);
  3658.     CCSSP.ShowObject(this.ele, true );
  3659.     
  3660.     if( this.ele.style.backgroundColor != "" )
  3661.     {//style.backgroundColor somehow stop the visual filter
  3662.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  3663.         this.ele.style.backgroundColor = "";
  3664.     }
  3665. }
  3666.  
  3667. CAgencyDropShadow.prototype.UpdateEffect = function()
  3668. {// to set the visual filter function
  3669.     this.PrepareEffect();
  3670.     this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" + 
  3671.         this.shadowOffx + ", offy=" + this.shadowOffy + ")";
  3672. }
  3673.  
  3674. CAgencyDropShadow.prototype.EndEffect = function()
  3675. {// to remove the visual filter function
  3676.     this.ele.style.filter = "";
  3677.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  3678.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  3679. }
  3680. // End of the CAgencyDropShadow definition
  3681.  
  3682. // Begin of CAgencyRevealTrans definition
  3683. function CAgencyRevealTrans( element, settings )
  3684. {// because of "visual filter" style, this won't work in Navigator
  3685.     this.ele = element;
  3686.  
  3687.     // to set the default value
  3688.     this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
  3689.     this.transition = 0;
  3690.     
  3691.     var arrAllSet = settings.split(",");
  3692.     for( var i = 0; i < arrAllSet.length; i ++ )
  3693.     {
  3694.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3695.         var arrOneSet = arrAllSet[i].split("=");
  3696.         for( var j = 0; j < arrOneSet.length; j++ )
  3697.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3698.         switch( arrOneSet[0] )
  3699.         {
  3700.         case "type" : this.transition = arrOneSet[1]; break;
  3701.         case "duration" : this.duration = 100/arrOneSet[1];    break;
  3702.         }
  3703.     }
  3704. }
  3705.  
  3706. CAgencyRevealTrans.prototype.PrepareEffect = function()
  3707. {
  3708.     CCSSP.PrepareFilter(this.ele);
  3709.     CCSSP.ShowObject( this.ele, false);
  3710. }
  3711.  
  3712. CAgencyRevealTrans.prototype.UpdateEffect = function()
  3713. {// to set the visual filter function
  3714.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  3715.     {
  3716.         if( this.ele.filters.RevealTrans.status == 2 )
  3717.             this.ele.filters.RevealTrans.stop();  
  3718.     }
  3719.  
  3720.     this.PrepareEffect();
  3721.     
  3722.     this.ele.style.filter = "RevealTrans(duration=" + this.duration + 
  3723.         ", transition=" + this.transition + ")";
  3724.     
  3725.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  3726.     {
  3727.         this.ele.filters.RevealTrans.apply();
  3728.         CCSSP.ShowObject( this.ele, true);
  3729.         this.ele.filters.RevealTrans.play();  
  3730.     }
  3731.     else
  3732.         CCSSP.ShowObject( this.ele, true);
  3733. }
  3734.  
  3735. CAgencyRevealTrans.prototype.EndEffect = function()
  3736. {
  3737.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  3738.         this.ele.filters.RevealTrans.stop();  
  3739.     this.ele.style.filter = "";
  3740. }
  3741. // End of the CAgencyRevealTrans definition
  3742.  
  3743. // Begin of CAgencyBlur definition
  3744. function CAgencyBlur( element, settings )
  3745. {// because of "visual filter" style, this won't work in Navigator
  3746.     this.ele = element;
  3747.  
  3748.     // to set the default value
  3749.     this.strength = "5";
  3750.     this.direction = "90";
  3751.     
  3752.     var arrAllSet = settings.split(",");
  3753.     for( var i = 0; i < arrAllSet.length; i ++ )
  3754.     {
  3755.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3756.         var arrOneSet = arrAllSet[i].split("=");
  3757.         for( var j = 0; j < arrOneSet.length; j++ )
  3758.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3759.         switch( arrOneSet[0] )
  3760.         {
  3761.         case "strength" : this.strength = arrOneSet[1]; break;
  3762.         case "direction" : this.direction = arrOneSet[1]; break;
  3763.         }
  3764.     }
  3765. }
  3766.  
  3767. CAgencyBlur.prototype.PrepareEffect = function()
  3768. {
  3769.     CCSSP.PrepareFilter(this.ele);
  3770.     CCSSP.ShowObject(this.ele, true );
  3771. }
  3772.  
  3773. CAgencyBlur.prototype.UpdateEffect = function()
  3774. {// to set the visual filter function
  3775.     CCSSP.PrepareFilter(this.ele);
  3776.     this.ele.style.filter = "blur(strength=" + this.strength + 
  3777.         ", direction=" + this.direction + ")";
  3778. }
  3779.  
  3780. CAgencyBlur.prototype.EndEffect = function()
  3781. {// to remove the visual filter function
  3782.     this.ele.style.filter = "";
  3783. }
  3784. // End of the CAgencyBlur definition
  3785.  
  3786. // Begin of CAgencyChangeFilter definition
  3787. function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
  3788. {// because of "visual filter" style, this won't work in Navigator
  3789.     this.ele = element;
  3790.  
  3791.     // to set the default value
  3792.     this.filterFunction = settings;
  3793. }
  3794.  
  3795. CAgencyChangeFilter.prototype.PrepareEffect = function()
  3796. {
  3797.     CCSSP.PrepareFilter(this.ele);
  3798.     CCSSP.ShowObject(this.ele, true );
  3799. }
  3800.  
  3801. CAgencyChangeFilter.prototype.UpdateEffect = function()
  3802. {// to set the visual filter function
  3803.     CCSSP.PrepareFilter(this.ele);
  3804.     this.ele.style.filter = this.filterFunction;
  3805. }
  3806.  
  3807. CAgencyChangeFilter.prototype.EndEffect = function()
  3808. {// to remove the visual filter function
  3809.     this.ele.style.filter = "";
  3810. }
  3811. // End of the CAgencyChangeFilter definition
  3812.  
  3813. // The effects below change the style on the fly, so they won't work in Navigator
  3814.  
  3815. // Begin of CAgencyFontChange definition, 
  3816. function CAgencyFontChange( element, settings )
  3817. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  3818.     this.ele = element;
  3819.     
  3820.     // to retrieve the original font style
  3821.     this.RetrieveOldFont( this.ele );
  3822.     
  3823.     // to set the default font to change
  3824.     this.newfontFamily = this.ele.oldFontFamily;
  3825.     this.newfColor = this.ele.oldColor;
  3826.     this.newtextDecoration = this.ele.oldTextDecoration;
  3827.     this.newfontWeight = this.ele.oldFontWeight;
  3828.     this.newfontStyle = this.ele.oldFontStyle;
  3829.     this.newfontSize = this.ele.oldFontSize;
  3830.     this.newBackgroundColor = this.ele.oldBackgroundColor;
  3831.     
  3832.     var arrAllSet = settings.split(",");
  3833.     for( var i = 0; i < arrAllSet.length; i ++ )
  3834.     {// to retrieve the setting
  3835.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  3836.         var arrOneSet = arrAllSet[i].split("=");
  3837.         for( var j = 0; j < arrOneSet.length; j++ )
  3838.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  3839.         switch( arrOneSet[0] )
  3840.         {
  3841.         case "font-family" : this.newfontFamily = arrOneSet[1]; break;
  3842.         case "color" : this.newfColor = arrOneSet[1]; break;
  3843.         case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
  3844.         case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
  3845.         case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
  3846.         case "size" : this.newfontSize = arrOneSet[1]; break;
  3847.         case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
  3848.         }
  3849.     }
  3850. }
  3851.  
  3852. CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
  3853. {
  3854.     if( typeof(objChild.oldFontFamily) == "undefined" )
  3855.         objChild.oldFontFamily = objChild.style.fontFamily;
  3856.     if( typeof(objChild.oldColor) == "undefined" )
  3857.         objChild.oldColor = objChild.style.color;
  3858.     if( typeof(objChild.oldTextDecoration) == "undefined" )
  3859.         objChild.oldTextDecoration = objChild.style.textDecoration;
  3860.     if( typeof(objChild.oldFontWeight) == "undefined" )
  3861.         objChild.oldFontWeight = objChild.style.fontWeight;
  3862.     if( typeof(objChild.oldFontStyle) == "undefined" )
  3863.         objChild.oldFontStyle = objChild.style.fontStyle;
  3864.     if( typeof(objChild.oldFontSize) == "undefined" )
  3865.         objChild.oldFontSize = objChild.style.fontSize;
  3866.     if( typeof(objChild.oldBackgroundColor) == "undefined" )
  3867.         objChild.oldBackgroundColor = objChild.style.backgroundColor;
  3868. }
  3869.  
  3870. CAgencyFontChange.prototype.PrepareEffect = function()
  3871. {
  3872.     // as for expanding text, the child is created after the constructor called
  3873.     for(var index = 0; index < this.ele.all.length; index++)
  3874.         this.RetrieveOldFont(this.ele.all[index]);
  3875.     CCSSP.ShowObject(this.ele, true );
  3876. }
  3877.  
  3878. CAgencyFontChange.prototype.UpdateEffect = function()
  3879. {// to change the font
  3880.     this.PrepareEffect();
  3881.     this.UpdateEffectAllChildren( this.ele );
  3882.     for( var index = 0; index < this.ele.all.length; index++)
  3883.         this.UpdateEffectAllChildren(this.ele.all[index]);
  3884. }
  3885.  
  3886. CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
  3887. {
  3888.     objChild.style.fontFamily = this.newfontFamily;
  3889.     objChild.style.color = this.newfColor;
  3890.     objChild.style.textDecoration = this.newtextDecoration;
  3891.     objChild.style.fontWeight = this.newfontWeight;
  3892.     objChild.style.fontStyle = this.newfontStyle;
  3893.     objChild.style.fontSize = this.newfontSize;
  3894.     objChild.style.backgroundColor = this.newBackgroundColor;
  3895. }
  3896.  
  3897. CAgencyFontChange.prototype.EndEffect = function()
  3898. {// to reinstate the original font style
  3899.     this.EndEffectAllChildren( this.ele );
  3900.     for( var index = 0; index < this.ele.all.length; index++)
  3901.         this.EndEffectAllChildren(this.ele.all[index]);
  3902. }
  3903.  
  3904. CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
  3905. {
  3906.     if( typeof(objChild.oldFontFamily) != "undefined" )
  3907.         objChild.style.fontFamily = objChild.oldFontFamily;
  3908.     if( typeof(objChild.oldColor) != "undefined" )
  3909.         objChild.style.color = objChild.oldColor;
  3910.     if( typeof(objChild.oldFontWeight) != "undefined" )
  3911.         objChild.style.fontWeight = objChild.oldFontWeight;
  3912.     if( typeof(objChild.oldFontStyle) != "undefined" )
  3913.         objChild.style.fontStyle = objChild.oldFontStyle;
  3914.     if( typeof(objChild.oldFontSize) != "undefined" )
  3915.         objChild.style.fontSize = objChild.oldFontSize;
  3916.     if( typeof(objChild.oldTextDecoration) != "undefined" )
  3917.         objChild.style.textDecoration = objChild.oldTextDecoration;
  3918.     if( typeof(objChild.oldBackgroundColor) != "undefined" )
  3919.         objChild.style.backgroundColor = objChild.oldBackgroundColor;
  3920. }
  3921. // End of the CAgencyFontChange definition
  3922.  
  3923. // Begin of the CAgencyChangeStyle definition
  3924. function CAgencyChangeStyle( element, settings )
  3925. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  3926.     this.ele = element;
  3927.     
  3928.     // to retrieve the original style
  3929.     this.oldstyle = this.ele.style.cssText;
  3930.     
  3931.     // to set the default style
  3932.     this.newStyle = this.oldstyle;
  3933.     
  3934.     if( typeof(settings) == "string" && settings.length > 1 )
  3935.         this.newStyle = this.oldstyle + " " + settings;
  3936. }
  3937.  
  3938. CAgencyChangeStyle.prototype.PrepareEffect = function()
  3939. {
  3940.     CCSSP.ShowObject(this.ele, true );
  3941. }
  3942.  
  3943. CAgencyChangeStyle.prototype.UpdateEffect = function()
  3944. {// to change the style
  3945.     this.ele.style.cssText = this.newStyle;
  3946. }
  3947.  
  3948. CAgencyChangeStyle.prototype.EndEffect = function()
  3949. {// to reinstate the original style
  3950.     this.ele.style.cssText = this.oldStyle;
  3951. }
  3952. // End of the CAgencyChangeStyle definition
  3953.  
  3954. //End the definition of CAgencyXXXX classes
  3955.  
  3956. //Begin to collaborate with other event handler settings 
  3957. CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
  3958. CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
  3959. CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
  3960. CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
  3961. CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
  3962. //End to collaborate with other event handler settings
  3963.  
  3964.  
  3965. /// Section End  - CCSSP DHTM 2 (JavaScript 1.2)
  3966.  
  3967. //// Segment End -- (JavaScript 1.2)
  3968.