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 / _388E09F19BD171DE4FF20243C45EEBF8 < prev    next >
Text File  |  2014-03-12  |  14KB  |  617 lines

  1. ∩╗┐//    WebHelp 5.10.005
  2. var gaProj=new Array();
  3. var gnChecked=0;
  4. var gsProjName="";
  5. var gbReady=false;
  6. var goMan=null;
  7. var gbXML=false;
  8. var gsFirstPane="";
  9. var gServerEnabled=false;
  10. var gsPath="";
  11. var gbWhPHost=false;
  12. var goDiv = null;
  13. var gsHTML = "";
  14.  
  15. if (navigator.currentNavPen)
  16.     gsFirstPane = navigator.currentNavPen;
  17.  
  18.  
  19. function delayLoad()
  20. {
  21.     if (goDiv&&gsHTML)
  22.     {
  23.         goDiv.innerHTML=gsHTML;
  24.         goDiv=null;
  25.         gsHTML="";
  26.     }
  27. }
  28.  
  29. function whCom(sName,sComFile)
  30. {
  31.     this.msName=sName;
  32.     this.msDivId=sName+"Div";
  33.     this.msIFrameId=sName+"IFrame";
  34.     this.msComFile=sComFile;
  35.     this.mbloaded=false;
  36.     this.mbShow=false;
  37.     this.show=function(bShow)
  38.     {
  39.         if(this.mbShow!=bShow)
  40.         {
  41.             if(bShow&&!this.mbloaded)
  42.             {
  43.                 this.load();
  44.             }
  45.  
  46.             var oDiv=getElement(this.msDivId);
  47.             if(oDiv)
  48.             {
  49.                 if(gbIE55||(gbIE5&&gbMac))
  50.                 {
  51.                     var oIframe=getElement(this.msIFrameId);
  52.                     if(oIframe)
  53.                     {
  54.                         if(bShow)
  55.                         {
  56.                             oDiv.style.zIndex=3;
  57.                             if(oIframe!=null)
  58.                             {
  59.                                 oIframe.style.zIndex=3;
  60.                                 if (!gbIE55)
  61.                                     oIframe.style.visibility="visible";
  62.                             }
  63.                         }
  64.                         else
  65.                         {
  66.                             oDiv.style.zIndex=2;
  67.                             if(oIframe!=null)
  68.                             {
  69.                                 oIframe.style.zIndex=2;
  70.                                 if (!gbIE55)
  71.                                     oIframe.style.visibility="hidden";
  72.                             }
  73.                         }
  74.                     }
  75.                 }
  76.                 if (!gbIE55)
  77.                     oDiv.style.visibility=(bShow==true)?'visible':'hidden';
  78.                 this.mbShow=bShow;
  79.             }
  80.  
  81.         }
  82.     }
  83.     this.load=function()
  84.     {
  85.         if(!this.mbloaded)
  86.         {
  87.             if(this.msComFile.length>0){
  88.                 var strFile= _getFullPath(getPath(), this.msComFile);
  89.                 var oDiv=getElement(this.msDivId);
  90.                 if(oDiv){
  91.                     if(gbIE4||gbOpera7){
  92.                         var nIFrameHeight=oDiv.style.pixelHeight;
  93.                         var nIFrameWidth=oDiv.style.pixelWidth;
  94.                         var sHTML="<IFRAME ID="+this.msIFrameId+" title=\"" + this.msName + "\" SRC=\""+strFile+"\" BORDER=0 FRAMEBORDER=no STYLE=\"width:";
  95.                         if(gbMac){
  96.                             sHTML+=nIFrameWidth+"px;height:"+nIFrameHeight+"px;\"></IFRAME>";
  97.                         }else{
  98.                             sHTML+="100%; height:100%;\"></IFRAME>";
  99.                         }
  100.                         oDiv.innerHTML=sHTML;
  101.                     }else if(gbNav6 || gbSafari){
  102.                         gsHTML="<IFRAME ID="+this.msIFrameId+" title=\"" + this.msName + "\" SRC=\""+strFile+"\" BORDER=0 FRAMEBORDER=no STYLE=\"width:100%;border:0;height:100%;\"></IFRAME>";
  103.                         goDiv = oDiv;
  104.                         setTimeout("delayLoad()", 100);
  105.                     }
  106.                     this.mbloaded=true;
  107.                 }
  108.             }
  109.         }
  110.     }
  111.     this.unload=function()
  112.     {
  113.         var oDiv=getElement(this.msDivId);
  114.         if(oDiv)
  115.             oDiv.innerHTML="";
  116.     }
  117.     this.getDivHTML=function()
  118.     {
  119.         var sHTML="";
  120.         if(gbMac&&gbIE4)
  121.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;margin:0;padding:0;border:0;\">";
  122.         else if(gbIE5)
  123.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;\">";
  124.         else if(gbIE4||gbWindows)
  125.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;visibility:hidden\">";
  126.         else if(gbMac&&gbNav6)
  127.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;visibility:hidden\">";
  128.         else if(gbUnixOS)
  129.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;visibility:hidden\">";
  130.         else
  131.             sHTML+="<DIV ID="+this.msDivId+" ALIGN=left STYLE=\"position:absolute;z-index:1;left:0;top:0;width:100%;height:"+parent.height+";visibility:hidden\">";
  132.         sHTML+="</DIV>";
  133.         return sHTML;
  134.     }
  135. }  
  136.  
  137. function whComMan()
  138. {
  139.     this.sName="";
  140.     this.maCom=new Array();
  141.     this.addCom=function(sName,sComFile)
  142.     {
  143.         var owhCom=new whCom(sName,sComFile);
  144.         this.maCom[this.maCom.length]=owhCom;
  145.     }
  146.     this.init=function()
  147.     {
  148.         var sHTML="";
  149.         for(var i=0;i<this.maCom.length;i++)
  150.         {
  151.             sHTML+=this.maCom[i].getDivHTML();
  152.         }
  153.         if(gbSafari&&!gbSafari3)
  154.         {
  155.             var range = document.createRange();
  156.               range.setStartBefore(document.body.lastChild);
  157.               var docFrag = range.createContextualFragment(sHTML);
  158.                document.body.appendChild(docFrag)        
  159.        }
  160.         else
  161.             document.body.insertAdjacentHTML("beforeEnd",sHTML);
  162.  
  163.     }
  164.     this.showById=function(nId)
  165.     {
  166.         for(var s=0;s<this.maCom.length;s++)
  167.         {
  168.             if(s!==nId)
  169.                 this.maCom[s].show(false);
  170.         }
  171.         this.maCom[nId].show(true);
  172.     }
  173.     this.show=function(sName)
  174.     {
  175.         navigator.currentNavPen = sName;
  176.         var bFound=false;
  177.         for(var i=0;i<this.maCom.length;i++)
  178.         {
  179.             if(sName==this.maCom[i].msName)
  180.             {
  181.                 bFound=true;
  182.                 break;
  183.             }
  184.         }
  185.         if(bFound)
  186.         {
  187.             this.showById(i);
  188.             this.sName=sName;
  189.         }
  190.     }
  191.     this.unload=function()
  192.     {
  193.         for(var i=0;i<this.maCom.length;i++)
  194.         {
  195.             this.maCom[i].unload();
  196.         }        
  197.     }
  198.     this.getCurrent=function()
  199.     {
  200.         return this.sName;
  201.     }
  202. }
  203.  
  204. function getPath()
  205. {
  206.     if(gsPath=="")
  207.     {
  208.         gsPath=location.href;
  209.         gsPath=_replaceSlash(gsPath);
  210.         var nPosFile=gsPath.lastIndexOf("/");
  211.         gsPath=gsPath.substring(0,nPosFile+1);
  212.     }
  213.     return gsPath;
  214. }
  215.  
  216. goMan=new whComMan();
  217. function addPane(sName,sFileName)
  218. {
  219.     var oParam=new Object();
  220.     oParam.sName=sName;
  221.     var oMsg=new whMessage(WH_MSG_GETPANE, this, 1, oParam);
  222.     if (SendMessage(oMsg))
  223.     {
  224.         if (oMsg.oParam.bEnable)
  225.             goMan.addCom(sName,sFileName);
  226.     }
  227.     else
  228.         goMan.addCom(sName,sFileName);    
  229. }
  230.  
  231. function setShowPane(sName, bForce)
  232. {
  233.     if ((gsFirstPane == "") || bForce)
  234.     {
  235.         var oMsg=new whMessage(WH_MSG_GETDEFPANE, this, 1, null);
  236.         if (SendMessage(oMsg))
  237.         {
  238.             if (oMsg.oParam)
  239.                 gsFirstPane = oMsg.oParam;
  240.             else
  241.                 gsFirstPane=sName;
  242.         }
  243.         else
  244.             gsFirstPane=sName;
  245.     }
  246. }
  247.  
  248. function window_OnLoad()
  249. {
  250.     var oMsg=new whMessage(WH_MSG_GETCMD,this,1,null);
  251.     var bHidePane=false;
  252.     if (SendMessage(oMsg))
  253.     {
  254.         if(oMsg.oParam>0)
  255.         {
  256.             if(oMsg.oParam==1)
  257.                 gsFirstPane="toc";
  258.             else if(oMsg.oParam==2)
  259.                 gsFirstPane="idx";
  260.             else if(oMsg.oParam==3)
  261.                 gsFirstPane="fts";
  262.             else if(oMsg.oParam==4)
  263.                 gsFirstPane="glo";
  264.         }
  265.         else if(oMsg.oParam==0)
  266.         {
  267.             bHidePane=true;
  268.         }
  269.     }
  270.     goMan.init();
  271.     if(gsProjName!="")            
  272.         loadData2(gsProjName);    
  273.     if (bHidePane)
  274.     {
  275.         gsFirstPane="";
  276.         var oMsg1=new whMessage(WH_MSG_HIDEPANE, this, 1, null)
  277.         SendMessage(oMsg1);
  278.     }
  279.     else
  280.     {
  281.         if(gsFirstPane!="")
  282.             goMan.show(gsFirstPane);
  283.         else
  284.             goMan.showById(0);
  285.     }
  286. }
  287.  
  288. function setServerEnabled()
  289. {
  290.     gServerEnabled = true;
  291. }
  292.  
  293. function loadData2(strFile)
  294. {
  295.     if(gbXML)
  296.         loadDataXML(strFile);
  297.     else
  298.         loadData(strFile);
  299. }
  300.  
  301. function addProject(bPreferXML,sXMLName,sHTMLName)
  302. {
  303.     var bLoadXML=bPreferXML;
  304.     if(!gbIE4&&!gbNav6&&!gbOpera7&&!gbSafari3)
  305.         return;
  306.     if(gbIE4&&!gbIE5)
  307.         bLoadXML=false;
  308.     if (gbIE5&&!gbMac)
  309.         bLoadXML=true;
  310.     if(gbIE55||gbNav6||gbSafari3)
  311.         bLoadXML=true;
  312.     if(gbOpera7)
  313.         bLoadXML=false;        
  314.     if(bLoadXML)
  315.         addProjectXML(sXMLName);
  316.     else
  317.         addProjectHTML(sHTMLName);
  318. }
  319.  
  320. function addProjectHTML(sName)
  321. {
  322.     gbXML=false;
  323.     gsProjName=sName;
  324. }
  325.  
  326. function addProjectXML(sName)
  327. {
  328.     gbXML=true;
  329.     gsProjName=sName;
  330. }
  331.  
  332. function window_MyBunload()
  333. {
  334.     goMan.unload();
  335.     window_BUnload();
  336. }
  337.  
  338. function putDataXML(xmlDoc,sdocPath)
  339. {
  340.     if(xmlDoc!=null)
  341.     {
  342.         var projectNode=xmlDoc.getElementsByTagName("project")[0];
  343.         if(projectNode)
  344.         {
  345.             var aRProj=new Array();
  346.             aRProj[0]=new Object();
  347.             aRProj[0].sPPath=_getPath(sdocPath);
  348.             var sLangId=projectNode.getAttribute("langid");
  349.             if(sLangId)
  350.             {
  351.                 aRProj[0].sLangId=sLangId;
  352.             }
  353.             var sDPath=projectNode.getAttribute("datapath");
  354.             if(sDPath)
  355.             {
  356.                 if(sDPath.lastIndexOf("/")!=sDPath.length-1)
  357.                     sDPath+="/";
  358.                 aRProj[0].sDPath=sDPath;
  359.             }
  360.             else
  361.                 aRProj[0].sDPath="";
  362.             aRProj[0].sToc=projectNode.getAttribute("toc");
  363.             aRProj[0].sIdx=projectNode.getAttribute("index");
  364.             aRProj[0].sFts=projectNode.getAttribute("fts");
  365.             aRProj[0].sGlo=projectNode.getAttribute("glossary");
  366.             var RmtProject=projectNode.getElementsByTagName("remote");
  367.             var nCount=1;
  368.             for (var i=0;i<RmtProject.length;i++)
  369.             {
  370.                 var sURL=RmtProject[i].getAttribute("url");
  371.                 if(sURL)
  372.                 {
  373.                     if(sURL.lastIndexOf("/")!=sURL.length-1)
  374.                         sURL+="/";
  375.                     aRProj[nCount]=new Object();
  376.                     aRProj[nCount++].sPPath=_getFullPath(aRProj[0].sPPath,sURL);
  377.                 }
  378.             }
  379.             putProjectInfo(aRProj);
  380.         }
  381.         else
  382.         {
  383.             // on Netscape 6.0 under some situation the xml file cannot be loaded.
  384.             // so we use pure html instead.
  385.             if (gnChecked == 0)
  386.                 setTimeout("redirectToList();",100);
  387.             else
  388.             {
  389.                 gnChecked++;
  390.                 setTimeout("checkRemoteProject();", 1);
  391.             }
  392.         }
  393.     }
  394. }
  395.  
  396. function onLoadXMLError()
  397. {
  398.     gnChecked++;
  399.     setTimeout("checkRemoteProject();", 1);
  400. }
  401.  
  402. function redirectToList()
  403. {
  404.     if(gbReDirectThis)
  405.         document.location=gsNavReDirect;
  406.     else
  407.         parent.document.location=gsNavReDirect;
  408. }
  409.  
  410. function putProjectInfo(aRProj)
  411. {
  412.     if(gnChecked==0||isSamePath(gaProj[gnChecked].sPPath,aRProj[0].sPPath))
  413.     {
  414.         if(gnChecked!=0)
  415.         {
  416.             if(aRProj[0].sLangId!=gaProj[0].sLangId)
  417.                 alert("The merged Help system "+aRProj[0].sPPath+" is using a different language from the master Help system, which will cause the index and full-text search functionality to be disabled in the merged Help system.");
  418.         }
  419.         gaProj[gnChecked]=aRProj[0];
  420.         for(var i=1;i<aRProj.length;i++)
  421.         {
  422.             var bFound=false;
  423.             for(var j=0;j<gaProj.length;j++)
  424.             {
  425.                 if(isSamePath(gaProj[j].sPPath,aRProj[i].sPPath))
  426.                 {
  427.                     bFound=true;
  428.                     break;
  429.                 }
  430.             }
  431.             if(!bFound)
  432.             {
  433.                 gaProj[gaProj.length]=aRProj[i];
  434.             }
  435.         }
  436.         gnChecked++;
  437.         setTimeout("checkRemoteProject();", 1);
  438.     }
  439.     else
  440.         alert("Could not load correctly, please click Refresh.");
  441. }
  442.  
  443. function isSamePath(sPath1,sPath2)
  444. {
  445.     return (sPath1.toLowerCase()==sPath2.toLowerCase());
  446. }
  447.  
  448. function checkRemoteProject()
  449. {
  450.     if(gaProj.length!=gnChecked)
  451.     {
  452.         setTimeout("cancelProj("+gnChecked+");",10000);
  453.         loadData2(gaProj[gnChecked].sPPath+gsProjName);
  454.     }
  455.     else{
  456.         var oMsg=new whMessage(WH_MSG_PROJECTREADY,this,1,null);
  457.         gbReady=true;
  458.         SendMessage(oMsg);
  459.     }
  460. }
  461.  
  462. function cancelProj(i)
  463. {
  464.     if(i==gnChecked)
  465.     {
  466.         gnChecked++;
  467.         setTimeout("checkRemoteProject();", 1);
  468.     }    
  469. }
  470.  
  471. function window_resize()
  472. {
  473.     for(var i=0;i<goMan.maCom.length;i++)
  474.     {
  475.         var oFrame=getElement(goMan.maCom[i].msIFrameId);
  476.         if(oFrame)
  477.         {
  478.             oFrame.style.height=document.body.clientHeight;
  479.             oFrame.style.width=document.body.clientWidth;
  480.         }
  481.     }
  482.     window_resize2();
  483. }
  484.  
  485. function window_resize2()
  486. {
  487.     if(document.body)
  488.     {
  489.         if(document.body.clientWidth > 1 && document.body.clientHeight>1)
  490.         {
  491.             var oMsg = new whMessage(WH_MSG_RESIZEPANE, this, 1, null);
  492.             SendMessage(oMsg);
  493.         }
  494.     }
  495. }
  496.  
  497. function window_unload()
  498. {
  499.     UnRegisterListener2(this,WH_MSG_GETPROJINFO);
  500.     UnRegisterListener2(this,WH_MSG_SHOWTOC);
  501.     UnRegisterListener2(this,WH_MSG_SHOWIDX);
  502.     UnRegisterListener2(this,WH_MSG_SHOWFTS);
  503.     UnRegisterListener2(this,WH_MSG_SHOWGLO);
  504.     UnRegisterListener2(this,WH_MSG_GETPANEINFO);
  505.     UnRegisterListener2(this,WH_MSG_GETSEARCHSTR);
  506.     UnRegisterListener2(this,WH_MSG_HILITESEARCH);
  507. }
  508.  
  509. function onSendMessage(oMsg)
  510. {
  511.     if(oMsg)
  512.     {
  513.         var nMsgId=oMsg.nMessageId;
  514.         if(nMsgId==WH_MSG_GETPROJINFO)
  515.         {
  516.             if(gbReady)
  517.             {
  518.                 var oProj=new Object();
  519.                 oProj.aProj=gaProj;
  520.                 oProj.bXML=gbXML;
  521.                 oMsg.oParam=oProj;
  522.             }
  523.             else
  524.                 return false;
  525.         }
  526.         else if(nMsgId==WH_MSG_SHOWTOC)
  527.         {
  528.             if(goMan)
  529.                 goMan.show("toc");
  530.             var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "toc");
  531.             SendMessage(onMsg);
  532.             onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  533.             SendMessage(onMsg);
  534.         }
  535.         else if(nMsgId==WH_MSG_SHOWIDX)
  536.         {
  537.             if(goMan)
  538.                 goMan.show("idx");
  539.             var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "idx");
  540.             SendMessage(onMsg);
  541.             onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  542.             SendMessage(onMsg);
  543.         }
  544.         else if(nMsgId==WH_MSG_SHOWFTS)
  545.         {
  546.             if(goMan)
  547.                 goMan.show("fts");
  548.             var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "fts");
  549.             SendMessage(onMsg);
  550.             onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  551.             SendMessage(onMsg);
  552.         }
  553.         else if(nMsgId==WH_MSG_SHOWGLO)
  554.         {
  555.             if(goMan)
  556.                 goMan.show("glo");
  557.             var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "glo");
  558.             SendMessage(onMsg);
  559.             onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  560.             SendMessage(onMsg);
  561.         }
  562.         else if(nMsgId==WH_MSG_GETPANEINFO)
  563.         {
  564.             oMsg.oParam=goMan.getCurrent();
  565.             return false;
  566.         }
  567.         else if(nMsgId==WH_MSG_HILITESEARCH)
  568.         {
  569.             oMsg.oParam=true;
  570.             return true;
  571.         }
  572.         else if(nMsgId==WH_MSG_GETSEARCHSTR)
  573.         {
  574.             var ftsElem = getElement("ftsIFrame");
  575.             if(ftsElem)
  576.             {
  577.               if(!gbSafari3 && typeof(ftsElem.contentWindow.document.forms[0]) != "undefined")
  578.               {
  579.                 var str1 = ftsElem.contentWindow.document.forms[0].quesn.value;
  580.                 oMsg.oParam = str1;
  581.               }
  582.             }
  583.  
  584.             return true;
  585.         }
  586.     }
  587.     return true;
  588. }
  589.  
  590. if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
  591. {
  592.     RegisterListener2(this,WH_MSG_GETPROJINFO);
  593.     RegisterListener2(this,WH_MSG_SHOWTOC);
  594.     RegisterListener2(this,WH_MSG_SHOWIDX);
  595.     RegisterListener2(this,WH_MSG_SHOWFTS);
  596.     RegisterListener2(this,WH_MSG_SHOWGLO);
  597.     RegisterListener2(this,WH_MSG_GETPANEINFO);
  598.     RegisterListener2(this,WH_MSG_GETSEARCHSTR);
  599.     RegisterListener2(this,WH_MSG_HILITESEARCH);
  600.  
  601.     if((gbMac&&gbIE4)||(gbSunOS&&gbIE5)||gbOpera7)
  602.     {
  603.         window.onresize=window_resize;
  604.     }
  605.     else if(gbIE4)
  606.     {
  607.         window.onresize=window_resize2;
  608.     }
  609.     window.onload=window_OnLoad;
  610.     window.onbeforeunload=window_MyBunload;
  611.     window.onunload=window_unload;
  612.     gbWhPHost=true;
  613. }
  614. else
  615.     document.location.reload();
  616.  
  617.