home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 39 / Issue 39.iso / pc / PCSoftware / RoboHelp / DISK1 / DATA.1 / publish.chm / ehlpdhtm.js < prev    next >
Encoding:
JavaScript  |  2000-06-27  |  108.4 KB  |  3,622 lines

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