home *** CD-ROM | disk | FTP | other *** search
/ ftp.comtrol.com / 2014.07.ftp.comtrol.com.tar / ftp.comtrol.com / beta / io_link_master / portvision_dx / iolm.chm / ehlpdhtm.js < prev    next >
Text File  |  2014-02-26  |  132KB  |  4,567 lines

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