home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 19 / FreelogHS19.iso / MP3 / QCDPlayer / qcd451.exe / QCDHelp.chm / ehlpdhtm.js < prev    next >
Text File  |  2004-04-12  |  121KB  |  4,002 lines

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