home *** CD-ROM | disk | FTP | other *** search
/ PC User 2004 November / PCU1104CD1.iso / software / online / files / GetGo.exe / GetGoHelp.chm / ehlpdhtm.js < prev    next >
Encoding:
JavaScript  |  2004-08-18  |  118.3 KB  |  3,995 lines

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