home *** CD-ROM | disk | FTP | other *** search
/ Freelog 58 / Freelog058.iso / Internet / emule / eMule0.42g-Installer.exe / eMule.chm / ehlpdhtm.js < prev    next >
Text File  |  2004-05-03  |  123KB  |  4,046 lines

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