home *** CD-ROM | disk | FTP | other *** search
/ ftp.rsa.com / 2014.05.ftp.rsa.com.tar / ftp.rsa.com / pub / agents / RSASecurIDTokenAuto412x64.msi / Data1.cab / _C7287A7D249225909769C7261B56F42C < prev    next >
Text File  |  2014-03-12  |  12KB  |  601 lines

  1. <html>
  2. <script language="javascript1.2" src="whver.js"></script>
  3. <script language="javascript1.2" src="whmozemu.js"></script>
  4. <script language="javascript1.2" src="whutils.js"></script>
  5. <script language="javascript1.2">
  6. <!--
  7. if(gbIE4||gbNav61)
  8. {
  9.     document.write("<body></body>");
  10. }
  11. else
  12. {
  13.     document.write("<frameset rows=\"100%,*\"><frame name=\"data_frm\" src=\"about:blank\"><frame name=\"dumb_frm\" src=\"about:blank\"></frameset>");
  14. }
  15. var gCSHFileName="whcshdata.htm";
  16.  
  17. var gHomePage="index.htm";
  18. var gaProj=new Array();
  19. gaProj[0]=new Object();
  20. gaProj[0].sProjPath=_replaceSlash(_getPath(document.location.href));
  21. gaProj[0].nLoadState=0;
  22. var gCurrent=0;
  23.  
  24. var gsTopicURL="";
  25. var gnCurProj=0;
  26. var gnCommand=-1;
  27. var CMD_SHOWTOC=1;
  28. var CMD_SHOWINDEX=2;
  29. var CMD_SHOWSEARCH=3;
  30. var CMD_SHOWGLOSSARY=4;
  31. var CMD_SHOWNONE=0;
  32.  
  33. var RHWO_LOCATION=0x01;        /*need location bar?*/
  34. var RHWO_MENUBAR=0x02;        /*need menubar?*/        
  35. var RHWO_RESIZABLE=0x04;    /*resizable window?*/
  36. var RHWO_TOOLBAR=0x08;        /*need toolbar?*/
  37. var RHWO_STATUS=0x10;        /*need statusbar?*/
  38. var RHWO_SCROLLBARS=0x20;    /*need scrollbars?*/
  39.  
  40. var gsStr="";
  41. var gnId=-1;
  42. var gsWindow="";
  43. var gsJava="false";
  44. var gbUseStr=false;
  45. var gbURLReady=false;
  46. var goWnd=new Object();
  47. goWnd.sName="whCshDefault";
  48. goWnd.nBOptions=RHWO_RESIZABLE|RHWO_SCROLLBARS;
  49. goWnd.sBLeft="49%";
  50. goWnd.sBTop="0";
  51. goWnd.sBWidth="49%";
  52. goWnd.sBHeight="49%";
  53. goWnd.nPanes=1;
  54. var goFullWnd=new Object();
  55. goFullWnd.sName="whDefault";
  56. goFullWnd.nBOptions=RHWO_RESIZABLE|RHWO_SCROLLBARS;
  57. goFullWnd.sBLeft="20%";
  58. goFullWnd.sBTop="0";
  59. goFullWnd.sBWidth="79%";
  60. goFullWnd.sBHeight="79%";
  61. goFullWnd.nPanes=2;
  62.  
  63. var goNewWnd=null;
  64. var gbLoadWnd=false;
  65. var gsURL="";
  66.  
  67. function showCSH(sParam)
  68. {
  69.     //id=
  70.     //str=
  71.     //url=
  72.     //cmd=
  73.     //with the format #<a=xxx>>b=xxx>>c=xxx...
  74.     parseParam(sParam);
  75.     SwitchURL();
  76. }
  77.  
  78. function IsWndReady()
  79. {
  80.     if(gaProj[0].nLoadState==0)
  81.     {
  82.         var sCshFile=_getFullPath(gaProj[0].sProjPath,gCSHFileName);
  83.         gaProj[0].nLoadState=1;
  84.         setTimeout("loadFail("+0+");",3000);
  85.         loadDataCsh(sCshFile);
  86.         gbLoadWnd=true;
  87.         return false;
  88.     }
  89.     else
  90.         return true;
  91. }
  92.  
  93. function SwitchURL()
  94. {
  95.     if(gbURLReady)
  96.     {
  97.         var sURL="";
  98.         var oWnd=null;
  99.         if(gsTopicURL)
  100.         {
  101.             sURL=_getPath(document.location.href)+gHomePage+"#"+gsTopicURL;
  102.             oWnd=goWnd;
  103.         }
  104.         else
  105.         {
  106.             if(gnCommand!=-1)
  107.                 sURL=_getPath(document.location.href)+gHomePage+"#>>cmd="+gnCommand;
  108.             else
  109.                 sURL=_getPath(document.location.href)+gHomePage;
  110.             oWnd=goFullWnd;
  111.         }
  112.         if(gsWindow)
  113.         {
  114.             if(!IsWndReady())
  115.                 return false;
  116.             if(gaProj[gnCurProj].aWnd)
  117.             {
  118.                 var aWnd=gaProj[gnCurProj].aWnd;
  119.                 var bFound=false;
  120.                 for(var i=0;i<aWnd.length;i++)
  121.                 {
  122.                     if(aWnd[i].sName.toLowerCase()==gsWindow.toLowerCase())
  123.                     {
  124.                         oWnd=aWnd[i];
  125.                         bFound=true;
  126.                         break;
  127.                     }
  128.                 }
  129.                 if(!bFound&&gnCurProj!=0)
  130.                 {
  131.                     var aWnd=gaProj[0].aWnd;
  132.                     for(var j=0;j<aWnd.length;j++)
  133.                     {
  134.                         if(aWnd[j].sName.toLowerCase()==gsWindow.toLowerCase())
  135.                         {
  136.                             oWnd=aWnd[j];
  137.                             break;
  138.                         }
  139.                     }
  140.                 }
  141.             }
  142.         }
  143.  
  144.         if(sURL&&oWnd)
  145.         {
  146.             strURLOpt="";
  147.             if(oWnd.sCaption)
  148.                 strURLOpt+=">>cap="+oWnd.sCaption;
  149.             if(oWnd.nPanes==1)
  150.                 strURLOpt+=">>pan="+oWnd.nPanes;
  151.             else if(oWnd.nPanes==2)
  152.             {
  153.                 strURLOpt+=">>pan="+oWnd.nPanes;
  154.                 if(oWnd.nPOptions)
  155.                     strURLOpt+=">>pot="+oWnd.nPOptions;
  156.                 if(oWnd.sPButtons)
  157.                     strURLOpt+=">>pbs="+oWnd.sPButtons;
  158.                 if(oWnd.sPDefBtn)
  159.                     strURLOpt+=">>pdb="+oWnd.sPDefBtn;
  160.             }
  161.             if(strURLOpt)
  162.             {
  163.                 if(sURL.indexOf("#")==-1)
  164.                     sURL+="#";
  165.                 sURL+=strURLOpt;
  166.             }
  167.             if(gsJava=="false")
  168.             {
  169.                 var strOpt=getBrowserOptionString(oWnd);
  170.                 var sNewName=convertWindowName(oWnd.sName);
  171.                 if(gbNav4)
  172.                 {
  173.                     if (gbNav6)
  174.                     {
  175.                         gsURL = sURL;
  176.                         goNewWnd=window.open("about:blank",sNewName,strOpt);
  177.                         setTimeout("postWindowNSOpen();",100);
  178.                     }
  179.                     else
  180.                     {
  181.                         window.open("about:blank",sNewName,strOpt);
  182.                         var oNewWnd=window.open(sURL,sNewName);
  183.                         window.close();
  184.                         oNewWnd.focus();
  185.                     }
  186.                 }
  187.                 else
  188.                 {
  189.                     if(gbIE5)
  190.                     {
  191.                         window.open("about:blank",sNewName,strOpt);
  192.                         goNewWnd=window.open(sURL,sNewName);
  193.                     }
  194.                     else
  195.                     {
  196.                         gsURL = sURL; // IE4 had hard time to handle bookmark.
  197.                         goNewWnd=window.open("about:blank",sNewName,strOpt);
  198.                     }
  199.                     setTimeout("postWindowOpen();",100);
  200.                 }
  201.             }
  202.             else
  203.                 document.location=sURL;
  204.         }
  205.     }
  206. }
  207.  
  208. function convertWindowName(strName)
  209. {
  210.     var strNewName = strName;
  211.     var strResultName = "";
  212.     var re=new RegExp("_","g");
  213.     strNewName = strName.replace(re,"__");
  214.     for (var i=0;i<strNewName.length;i++)
  215.         if (!(strNewName[i] == '_' ||
  216.             (strNewName[i] <= '9' && strNewName[i] >= '0') ||
  217.             (strNewName[i] <= 'z' && strNewName[i] >= 'a') ||
  218.             (strNewName[i] <= 'Z' && strNewName[i] >= 'A')))
  219.         {
  220.             strResultName += "_" + strNewName.charCodeAt(i);
  221.         }
  222.         else
  223.             strResultName += strNewName[i];
  224.     return strResultName;
  225. }
  226.  
  227. function postWindowNSOpen()
  228. {
  229.     if(goNewWnd)
  230.     {
  231.         if (gsURL)
  232.             goNewWnd.document.location.href=gsURL;
  233.         window.close();
  234.         goNewWnd.focus();
  235.     }
  236. }
  237.  
  238. function postWindowOpen()
  239. {
  240.     if(goNewWnd)
  241.     {
  242.         if (gsURL&&!gbIE5&&gbIE4)
  243.             goNewWnd.document.location.href=gsURL;
  244.         goNewWnd.focus();
  245.     }
  246. }
  247.  
  248. function parseParam(sParam)
  249. {
  250.     if(sParam)
  251.     {
  252.         var nBPos=0;
  253.         do
  254.         {
  255.             var nPos=sParam.indexOf(">>",nBPos);
  256.             if(nPos!=-1)
  257.             {
  258.                 if(nPos>0)
  259.                 {
  260.                     var sPart=sParam.substring(nBPos,nPos);
  261.                     parsePart(sPart);
  262.                 }
  263.                 nBPos=nPos+2;
  264.             }
  265.             else
  266.             {
  267.                 var sPart=sParam.substring(nBPos);
  268.                 parsePart(sPart);
  269.                 break;
  270.             }
  271.         }while(nBPos<sParam.length);
  272.     }
  273. }
  274.  
  275. function parsePart(sPart)
  276. {
  277.     if(sPart.toLowerCase().indexOf("id=")==0)
  278.     {
  279.         fetchURLById(sPart.substring(3));
  280.         gbURLReady=false;
  281.     }
  282.     else if(sPart.toLowerCase().indexOf("str=")==0)
  283.     {
  284.         fetchURLByStr(sPart.substring(4));
  285.         gbURLReady=false;
  286.     }
  287.     else if(sPart.toLowerCase().indexOf("url=")==0)
  288.     {
  289.         if(IsInternal(sPart.substring(4)))
  290.             gsTopicURL=_textToHtml(sPart.substring(4));
  291.         gbURLReady=true;
  292.     }
  293.     else if(sPart.toLowerCase().indexOf("cmd=")==0)
  294.     {
  295.         var sCmd=sPart.substring(4);
  296.         if(sCmd.toLowerCase()=="toc")
  297.         {
  298.             gnCommand=CMD_SHOWTOC;
  299.         }
  300.         else if(sCmd.toLowerCase()=="idx")
  301.         {
  302.             gnCommand=CMD_SHOWINDEX;
  303.         }
  304.         else if(sCmd.toLowerCase()=="fts")
  305.         {
  306.             gnCommand=CMD_SHOWSEARCH;
  307.         }
  308.         else if(sCmd.toLowerCase()=="glo")
  309.         {
  310.             gnCommand=CMD_SHOWGLOSSARY;
  311.         }
  312.         else if(sCmd.toLowerCase()=="none")
  313.         {
  314.             gnCommand=CMD_SHOWNONE;
  315.         }
  316.         gbURLReady=true;
  317.     }
  318.     else if(sPart.toLowerCase().indexOf("wnd=")==0)
  319.     {
  320.         gsWindow=_browserStringToText(sPart.substring(4));
  321.     }
  322.     else if(sPart.toLowerCase().indexOf("java=")==0)
  323.     {
  324.         gsJava=sPart.substring(5);
  325.     }
  326. }
  327.  
  328. function fetchURLById(sId)
  329. {
  330.     var nId=parseInt(sId);
  331.     gsTopicURL="";
  332.     fetchURL("",nId,false);
  333. }
  334.  
  335. function fetchURLByStr(sStr)
  336. {
  337.     gsTopicURL="";
  338.     fetchURL(sStr,0,true);
  339. }
  340.  
  341. function fetchURL(sStr,nId,bUseStr)
  342. {
  343.     var bNeedLoad=false;
  344.     var bFound=false;
  345.     for(var i=0;i<gaProj.length;i++)
  346.     {
  347.         if(gaProj[i].nLoadState==3)
  348.         {
  349.             if(gaProj[i].aCsh)
  350.             {
  351.                 for(var j=0;j<gaProj[i].aCsh.length;j++)
  352.                 {
  353.                     var sTopicURL="";
  354.                     if(bUseStr)
  355.                     {
  356.                         if(gaProj[i].aCsh[j].strAliasId.toLowerCase()==sStr.toLowerCase())
  357.                             sTopicURL=gaProj[i].aCsh[j].strUrl;
  358.                     }
  359.                     else
  360.                     {
  361.                         if(gaProj[i].aCsh[j].nTopicNum==nId)
  362.                             sTopicURL=gaProj[i].aCsh[j].strUrl;
  363.                     }
  364.                     if(sTopicURL)
  365.                     {
  366.                         if(i!=0)
  367.                         {
  368.                             gnCurProj=i;
  369.                             if(gaProj[i].sProjPath.indexOf(gaProj[0].sProjPath)==0)
  370.                             {
  371.                                 var sRelPath=gaProj[i].sProjPath.substring(gaProj[0].sProjPath.length);
  372.                                 gsTopicURL=sRelPath+sTopicURL;
  373.                             }
  374.                             else
  375.                                 gsTopicURL=gaProj[i].sProjPath+sTopicURL;
  376.                         }
  377.                         else
  378.                             gsTopicURL=sTopicURL;
  379.                         bFound=true;
  380.                         break;
  381.                     }
  382.                 }
  383.             }
  384.             
  385.         }
  386.         else if(gaProj[i].nLoadState==0)
  387.         {
  388.             gsStr=sStr;
  389.             gnId=nId;
  390.             gbUseStr=bUseStr;
  391.             var sCshFile=_getFullPath(gaProj[i].sProjPath,gCSHFileName);
  392.             gaProj[i].nLoadState=1;
  393.             setTimeout("loadFail("+i+");",3000);
  394.             loadDataCsh(sCshFile);
  395.             bNeedLoad=true;
  396.         }
  397.         if(bFound||bNeedLoad)
  398.             break;
  399.     }
  400.     if(!bNeedLoad)
  401.     {
  402.         gbURLReady=true;
  403.         SwitchURL();
  404.     }
  405. }
  406.  
  407. function loadDataCsh(sFile)
  408. {
  409.     if(gbIE4||gbNav61)
  410.         loadData(sFile);
  411.     else
  412.     {
  413.         window.frames[0].location=sFile;
  414.     }
  415. }
  416.  
  417. function loadFail(nProj)
  418. {
  419.     if(gaProj[nProj].nLoadState==1)
  420.     {
  421.         gaProj[nProj].nLoadState=2;
  422.         if(!gbLoadWnd)
  423.             fetchURL(gsStr,gnId,gbUseStr);
  424.         else
  425.             SwitchURL();
  426.     }
  427. }
  428.  
  429. function putCshData(strProj,aCsh,aWnd,aRmtProj)
  430. {
  431.     if(strProj)
  432.     {
  433.         strProj=_replaceSlash(strProj);
  434.         if(strProj.lastIndexOf("/")!=strProj.length-1)
  435.             strProj+="/";
  436.         for(var i=0;i<gaProj.length;i++)
  437.         {
  438.             if(gaProj[i].sProjPath)
  439.             {
  440.                 if(isSamePath(gaProj[i].sProjPath,strProj))
  441.                 {
  442.                     gaProj[i].nLoadState=3;
  443.                     gaProj[i].aCsh=aCsh;
  444.                     gaProj[i].aWnd=aWnd;
  445.                     break;
  446.                 }
  447.             }
  448.         }
  449.         if(aRmtProj&&aRmtProj.length)
  450.         {
  451.             for(var j=0;j<aRmtProj.length;j++)
  452.             {
  453.                 var strRPath=_getFullPath(strProj,aRmtProj[j]);
  454.                 var bFound=false;
  455.                 for (var k=0;k<gaProj.length;k++)
  456.                 {
  457.                     if(gaProj[k].sProjPath)
  458.                     {
  459.                         if(isSamePath(gaProj[k].sProjPath,strRPath))
  460.                         {
  461.                             bFound=true;
  462.                             break;
  463.                         }
  464.                     }
  465.                 }
  466.                 if(!bFound)
  467.                 {
  468.                     var len=gaProj.length;
  469.                     gaProj[len]=new Object();
  470.                     gaProj[len].sProjPath=strRPath;
  471.                     gaProj[len].nLoadState=0;
  472.                 }
  473.             }
  474.         }
  475.         if(!gbLoadWnd)
  476.             fetchURL(gsStr,gnId,gbUseStr);
  477.         else
  478.             SwitchURL();
  479.             
  480.     }
  481. }
  482.  
  483. function isSamePath(strPath1,strPath2)
  484. {
  485.     return strPath1.toLowerCase()==strPath2.toLowerCase();
  486. }
  487.  
  488. function getRelHomePage(strLocation)
  489. {
  490.     var strCurPPath=_getPath(strLocation);
  491.     var strOriPPath=_getPath(getHomePage());
  492.     var strRelPath=_getRelativeFileName(strOriPPath,strCurPPath);
  493.     var strURL=getHomePage()+"#"+strRelPath;
  494.     return strURL;
  495. }
  496.  
  497. function getHomePage()
  498. {
  499.     var strHomePage;
  500.     var strTmp=location.toString();
  501.     var nPos=strTmp.indexOf("#");
  502.     if(nPos!=-1)
  503.     {
  504.         strHomePage=strTmp.substring(0,nPos);
  505.     }
  506.     else
  507.     {
  508.         strHomePage=strTmp;
  509.     }
  510.     return strHomePage;
  511. }
  512.  
  513. function getBrowserOptionString(oWnd)
  514. {
  515.     var strOpts="";
  516.     if(oWnd.bUseDefault)
  517.         return strOpts;
  518.     if(oWnd.nBOptions&RHWO_LOCATION)
  519.         strOpts+="location=yes";
  520.     else
  521.         strOpts+="location=no";
  522.     if(oWnd.nBOptions&RHWO_TOOLBAR)
  523.         strOpts+=",toolbar=yes";        
  524.     else
  525.         strOpts+=",toolbar=no";        
  526.     if(oWnd.nBOptions&RHWO_MENUBAR)
  527.         strOpts+=",menubar=yes";        
  528.     else
  529.         strOpts+=",menubar=no";
  530.     if(oWnd.nBOptions&RHWO_STATUS)
  531.         strOpts+=",status=yes";        
  532.     else
  533.         strOpts+=",status=no";        
  534.     if(oWnd.nBOptions&RHWO_SCROLLBARS)
  535.         strOpts+=",scrollbars=yes";
  536.     else
  537.         strOpts+=",scrollbars=no";    
  538.     if(oWnd.nBOptions&RHWO_RESIZABLE)
  539.         strOpts+=",resizable=yes";
  540.     else
  541.         strOpts+=",resizable=no";
  542.     if(oWnd.sBTop)
  543.     {
  544.         var nTop=getSValue(oWnd.sBTop,screen.height);
  545.         strOpts+=",top="+nTop;
  546.         strOpts+=",screenY="+nTop;
  547.     }
  548.     if(oWnd.sBLeft)
  549.     {
  550.         var nLeft=getSValue(oWnd.sBLeft,screen.width);
  551.         strOpts+=",left="+nLeft;
  552.         strOpts+=",screenX="+nLeft;
  553.     }
  554.     if(oWnd.sBWidth)
  555.     {
  556.         var nWidth=getSValue(oWnd.sBWidth,screen.width);
  557.         strOpts+=",width="+nWidth;
  558.         strOpts+=",outerWidth="+nWidth;
  559.     }
  560.     if(oWnd.sBHeight)
  561.     {
  562.         var nHeight=getSValue(oWnd.sBHeight,screen.height);
  563.         strOpts+=",height="+nHeight;
  564.         strOpts+=",outerHeight="+nHeight;
  565.     }
  566.     return strOpts;
  567. }
  568.  
  569. function getSValue(sValue,nLength)
  570. {
  571.     var nValue=0;
  572.     var nPos=sValue.indexOf("%");
  573.     if(nPos!=-1)
  574.     {
  575.         if(nPos>0)
  576.         {
  577.             var nPart=parseInt(sValue.substring(0,nPos));
  578.             nValue=nLength*nPart/100;
  579.         }
  580.     }
  581.     else
  582.         nValue=parseInt(sValue);
  583.     return nValue;
  584. }
  585.  
  586.  
  587. window.onload=window_OnLoad;
  588.  
  589. function window_OnLoad()
  590. {
  591.     if(document.location.hash.length>0)
  592.     {
  593.         showCSH(document.location.hash.substring(1));
  594.     }
  595.  
  596.     if(gsJava=="false")
  597.         window.moveTo(screen.width,screen.height);
  598. }
  599. //-->
  600. </script>
  601. </html>