home *** CD-ROM | disk | FTP | other *** search
/ 212.85.102.23 / 2014.12.212.85.102.23.tar / 212.85.102.23 / 5d2.rar / SOFTWARE / PR2 / pr.cab / Sp_PhotoRecord.chm / ehlpdhtm.js < prev    next >
Text File  |  2005-01-25  |  123KB  |  4,034 lines

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