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 / _201194B4A2E432C580727968F4339741 < prev    next >
Text File  |  2014-03-12  |  11KB  |  425 lines

  1. ∩╗┐//    WebHelp 5.10.002
  2. var gsDefaultTarget="bsscright";
  3. var gsBgColor="#ffffff";
  4. var gsBgImage="";
  5. var goIdxFont=null;
  6. var goIdxEmptyFont=null;
  7. var goIdxHoverFont=null;
  8. var gsIdxMargin="0pt";
  9. var gsIdxIndent="8pt";
  10. var gsIdxActiveBgColor="#cccccc";
  11. var gsCK = null;
  12. var gsBCK = null;
  13. var gbCR = false;
  14. var gbBCR = false;
  15. var gbWhIHost=true;
  16.  
  17. function myEvent()
  18. {
  19.     this.pageX = 0;
  20.     this.pageY = 0;
  21. }
  22. var _event=new myEvent();
  23.  
  24. function setBackgroundcolor(sBgColor)
  25. {
  26.     gsBgColor=sBgColor;
  27. }
  28.  
  29. function setBackground(sBgImage)
  30. {
  31.     gsBgImage=sBgImage;
  32. }
  33.  
  34. function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration)
  35. {
  36.     var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration);
  37.     if(sType=="Normal")
  38.         goIdxFont=vFont;
  39.     else if(sType=="Empty")
  40.         goIdxEmptyFont=vFont;
  41.     else if(sType=="Hover")
  42.         goIdxHoverFont=vFont;
  43. }
  44.  
  45. function setActiveBgColor(sBgColor)
  46. {
  47.     gsIdxActiveBgColor=sBgColor;
  48. }
  49.  
  50. function setMargin(sMargin)
  51. {
  52.     gsIdxMargin=sMargin;
  53. }
  54.  
  55. function setIndent(sIndent)
  56. {
  57.     gsIdxIndent=sIndent;
  58. }
  59.  
  60. function writeOneItem(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel)
  61. {
  62.     var sHTML="";
  63.     var nIdxSet=aCurIdxSet[0];
  64.     var nIIdx=aPos[nIdxSet];
  65.     var sKOriName=getItemName(aDataCon,nIdxSet,nIIdx);
  66.     var sKName=_textToHtml(sKOriName);
  67.  
  68.     var nIdxIndent=parseInt(gsIdxIndent);
  69.     var sTopics="";
  70.     if(nLevel==1){
  71.         if(getItemType(aDataCon,nIdxSet,nIIdx)==1)
  72.         {
  73.             sHTML+="<H6><nobr>";
  74.             sHTML+="<b>"+sKName+"</b></nobr></H6>";
  75.         }
  76.         else{
  77.             for(var i=0;i<nLength;i++)
  78.                 sTopics+=getIdxTopics(aDataCon,aCurIdxSet[i],aPos[aCurIdxSet[i]]);
  79.             sHTML+="<p style=\"margin-left:"+gsIdxIndent+"\"><nobr>";
  80.             sHTML+="<a alt=\"" + sKName + "\" href=\"javascript:void(0);\" onfocus=\"clearHighLight();\" onclick=\"PopupMenu_Invoke(event,'"+excapeSingleQuotandSlash(getTargetName(aDataCon,nIdxSet,nIIdx))+"'";
  81.             if(sTopics.length>0)
  82.                 sHTML+=sTopics+");return false;\">"+sKName+"</a></nobr></p>";
  83.             else
  84.                 sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+"</a></nobr></p>";
  85.         }
  86.     }
  87.     else if(nLevel>=2){
  88.         var nIndent=nIdxIndent*nLevel;
  89.         for(var i=0;i<nLength;i++)
  90.             sTopics+=getIdxTopics(aDataCon,aCurIdxSet[i],aPos[aCurIdxSet[i]]);
  91.         if (nLevel==2)
  92.             sHTML+="<h6 class=\"firstsub\" style=\"margin-left:"+nIndent+"pt\"><nobr>";
  93.         else
  94.             sHTML+="<h6 style=\"margin-left:"+nIndent+"pt\"><nobr>";
  95.         sHTML+="<a alt=\"" + sKName + "\" href=\"javascript:void(0);\" onfocus=\"clearHighLight();\" onclick=\"PopupMenu_Invoke(event,'"+excapeSingleQuotandSlash(getTargetName(aDataCon,nIdxSet,nIIdx))+"'";
  96.         if(sTopics.length>0)
  97.             sHTML+=sTopics+");return false;\">"+sKName+"</a></nobr></h6>";
  98.         else
  99.             sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+"</a></nobr></h6>";
  100.     }
  101.     oHTML.addHTML(sHTML,nLength,bDown,(nLevel==1),sKOriName);
  102. }
  103.  
  104. function getTargetName(aDataCon,nIdxSet,nIIdx)
  105. {
  106.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  107.         if(aDataCon[nIdxSet].aKs[nIIdx].sTarget)
  108.             return aDataCon[nIdxSet].aKs[nIIdx].sTarget;
  109.     return gsDefaultTarget;
  110. }
  111.  
  112. function mergeItems(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel)
  113. {
  114.     var oLocalHTML=new indexHTMLPart();
  115.     writeOneItem(oLocalHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel);
  116.     
  117.     var aLocalPos=new Array();
  118.     var aMaxPos=new Array();
  119.     for(var i=0;i<aPos.length;i++)
  120.     {
  121.         aLocalPos[i]=aPos[i];
  122.         aMaxPos[i]=-1;
  123.     }
  124.     
  125.     for(i=0;i<nLength;i++)
  126.     {
  127.         var nNKOff=getNKOff(aDataCon,aCurIdxSet[i],aLocalPos[aCurIdxSet[i]]);
  128.         aLocalPos[aCurIdxSet[i]]++;
  129.         if(nNKOff>0)
  130.             aMaxPos[aCurIdxSet[i]]=aLocalPos[aCurIdxSet[i]]+nNKOff;
  131.     }
  132.     var oSubHTML=new indexHTMLPart();
  133.     writeItems(oSubHTML,aDataCon,aLocalPos,null,aMaxPos,true,nLevel+1);
  134.     oLocalHTML.addSubHTML(oSubHTML,true);
  135.     oHTML.appendHTML(oLocalHTML,bDown);
  136. }
  137.  
  138. function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos)
  139. {
  140.     if(bDown)
  141.     {
  142.         for(var i=0;i<nLength;i++)
  143.         {
  144.             var nNKOff=getNKOff(aDataCon,aCurIdxSet[i],aPos[aCurIdxSet[i]]);
  145.             aPos[aCurIdxSet[i]]+=(1+nNKOff);
  146.         }
  147.     }
  148.     else{
  149.         for(var i=0;i<nLength;i++)
  150.         {
  151.             var nPKOff=getPKOff(aDataCon,aCurIdxSet[i],aPos[aCurIdxSet[i]]);
  152.             aPos[aCurIdxSet[i]]-=(1+nPKOff);
  153.         }
  154.     }
  155. }
  156.  
  157. function getItemName(aDataCon,nIdxSet,nIIdx)
  158. {
  159.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  160.         return aDataCon[nIdxSet].aKs[nIIdx].sName;
  161.     else
  162.         return null;
  163. }
  164.  
  165. function getItemType(aDataCon,nIdxSet,nIIdx)
  166. {
  167.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  168.         return aDataCon[nIdxSet].aKs[nIIdx].nType;
  169.     else
  170.         return 0;
  171. }
  172.  
  173. function getNKOff(aDataCon,nIdxSet,nIIdx)
  174. {
  175.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  176.         return aDataCon[nIdxSet].aKs[nIIdx].nNKOff;
  177.     else
  178.         return null;
  179. }
  180.  
  181. function getPKOff(aDataCon,nIdxSet,nIIdx)
  182. {
  183.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  184.         return aDataCon[nIdxSet].aKs[nIIdx].nPKOff;
  185.     else
  186.         return null;
  187. }
  188.  
  189. function window_OnLoad()
  190. {
  191.     if(gsBgImage&&gsBgImage.length>0)
  192.     {
  193.         document.body.background=gsBgImage;
  194.     }
  195.     if(gsBgColor&&gsBgColor.length>0)
  196.     {
  197.         document.body.bgColor=gsBgColor;
  198.     }
  199.     document.body.insertAdjacentHTML("beforeEnd",writeLoadingDiv());
  200.     loadIdx();
  201.     var oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null)
  202.     SendMessage(oMsg);
  203. }
  204.  
  205. function loadIdx()
  206. {
  207.     if(!gbReady)
  208.     {
  209.         var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null);
  210.         if(SendMessage(oResMsg)&&oResMsg.oParam)
  211.         {
  212.             gbReady=true;
  213.             var oProj=oResMsg.oParam;
  214.             var aProj=oProj.aProj;
  215.             gbXML=oProj.bXML;
  216.             if(aProj.length>0)
  217.             {
  218.                 var sLangId=aProj[0].sLangId;
  219.                 for(var i=0;i<aProj.length;i++)
  220.                 {
  221.                     if(aProj[i].sIdx&&aProj[i].sLangId==sLangId)
  222.                     {
  223.                         addProjInfo(aProj[i].sPPath,aProj[i].sDPath,aProj[i].sIdx);
  224.                     }
  225.                 }
  226.             }
  227.             writeDataIFrame();
  228.             enEvt();
  229.         }        
  230.     }
  231. }
  232.  
  233. function getIdxTopics(aDataCon,nIdxSet,nIIdx)
  234. {
  235.     var sTopics="";
  236.     if(nIdxSet<aDataCon.length&&aDataCon[nIdxSet].aKs.length>nIIdx)
  237.     {
  238.         if(aDataCon[nIdxSet].aKs[nIIdx].aTopics)
  239.         {
  240.             var nLen=aDataCon[nIdxSet].aKs[nIIdx].aTopics.length;
  241.             var nProj=aDataCon[nIdxSet].nProjId;
  242.             var sPath=gaData[nProj].sPPath;
  243.             for(var i=0;i<nLen;i++)
  244.             {
  245.                 var sURL=aDataCon[nIdxSet].aKs[nIIdx].aTopics[i].sURL;
  246.                 var sFullPath=_getFullPath(sPath,sURL);
  247.                 sTopics+=",'"+excapeSingleQuotandSlash(_textToHtml(aDataCon[nIdxSet].aKs[nIIdx].aTopics[i].sName))+"','"+excapeSingleQuotandSlash(_textToHtml_nonbsp(sFullPath))+"'";
  248.             }
  249.         }
  250.     }
  251.     return sTopics;        
  252. }
  253.  
  254. function findCKInDom()
  255. {
  256.     if(gsCK!=null)
  257.     {
  258.         var sK=gsCK;
  259.         var oP=getElementsByTag(document,"P");
  260.         if(!oP) return false;
  261.         var len=oP.length;
  262.         var nB=0;
  263.         var nE=len-1;
  264.         var nM=0;
  265.         var sItem="";
  266.         var bF=false;
  267.         while(nB<nE){
  268.             nM=(nB+nE+1)>>1;
  269.             sItem=getInnerText(oP[nM]);
  270.             
  271.             if(compare(sItem,sK)==0)
  272.             {
  273.                 bF=true;
  274.                 break;
  275.             }
  276.             else if(compare(sItem,sK)>0)
  277.                 nE=nM-1;
  278.             else if(compare(sItem,sK)<0)
  279.                 nB=nM;
  280.         }
  281.         if(!bF)
  282.         {
  283.             if(nB==nE) nM=nB;
  284.         
  285.             if(nM+1<len)
  286.             {
  287.                 sItem=getInnerText(oP[nM+1]);
  288.                 if(compare(sItem,sK)<=0) nM++;
  289.             }            
  290.             if(nM+1<len)
  291.             {
  292.                 sItem=getInnerText(oP[nM+1]);
  293.                 if(compare(sItem.substring(0,sK.length),sK)==0) nM++;
  294.             }            
  295.         }
  296.     
  297.         var oMatch=oP[nM];
  298.         if(oMatch)
  299.         {
  300.             window.scrollTo(0,oMatch.offsetTop);
  301.             var tempColl=getElementsByTag(oMatch,"A");
  302.             if(tempColl&&tempColl.length>0){
  303.                 var nbTag=getElementsByTag(oMatch,"NOBR");
  304.                 if(nbTag&&nbTag.length>0)
  305.                     HighLightElement(nbTag[0], gsIdxActiveBgColor, "transparent");
  306.                 if (gbCR)
  307.                 {
  308.                     if (gbIE4)
  309.                         tempColl(0).click();
  310.                     else
  311.                     {
  312.                         var strCommand = tempColl[0].getAttribute("onClick");
  313.                         var nstrCommand = strCommand.indexOf(";");
  314.                         strCommand = strCommand.substring(0, nstrCommand);
  315.                         strCommand = strCommand.replace("event", "_event");
  316.                         window._event.pageX = oMatch.offsetLeft ;
  317.                         window._event.pageY = oMatch.offsetTop + 20;
  318.                         window.setTimeout(strCommand, 100);
  319.                     }
  320.                 }
  321.             }
  322.         }
  323.         gsCK=gsBCK;
  324.         gbCR=gbBCR;
  325.         if(gsBCK!=null)
  326.         {
  327.             gsBCK=null;
  328.             gbBCR=false;
  329.             findCK();
  330.             return false;
  331.         }
  332.         
  333.     }
  334.     return true;
  335. }
  336.  
  337. function clearHighLight()
  338. {
  339.     resetHighLight(gsBgColor);
  340. }
  341.  
  342. function IndexWriteClassStyle()
  343. {
  344.     var sStyle="";
  345.     sStyle+="<STYLE TYPE='text/css'>";
  346.     if (gsBgImage)
  347.         sStyle+="body {border-top:"+gsBgColor+" 1px solid;}\n";
  348.     else
  349.         sStyle+="body {border-top:black 1px solid;}\n";
  350.     if(gbIE4&&gbMac&&!gbIE5)
  351.     {
  352.         var nMargin=parseInt(gsIdxMargin);
  353.         nMargin-=10;
  354.         sStyle+="P {"+getFontStyle(goIdxFont)+"margin-top:"+gsIdxMargin+";margin-bottom:"+gsIdxMargin+";}\n";
  355.         sStyle+="H6 {"+getFontStyle(goIdxFont)+"margin-top:"+gsIdxMargin+";margin-bottom:"+gsIdxMargin+";}\n";
  356.         sStyle+="H6.firstsub {"+getFontStyle(goIdxFont)+"margin-top:"+nMargin+"pt;margin-bottom:"+gsIdxMargin+";}\n";
  357.     }
  358.     else
  359.     {
  360.         sStyle+="P {"+getFontStyle(goIdxFont)+"margin-top:"+gsIdxMargin+";margin-bottom:"+gsIdxMargin+";}\n";
  361.         sStyle+="H6 {"+getFontStyle(goIdxFont)+"margin-top:"+gsIdxMargin+";margin-bottom:"+gsIdxMargin+";}\n";
  362.     }
  363.     sStyle+="DIV {margin-top:"+gsIdxMargin+";margin-bottom:"+gsIdxMargin+";}\n";
  364.     sStyle+="A:link {"+getFontStyle(goIdxFont)+"}\n";
  365.     sStyle+="A:visited {"+getFontStyle(goIdxFont)+"}\n";
  366.     sStyle+="A:active {background-color:"+gsIdxActiveBgColor+";}\n";
  367.     sStyle+="A:hover {"+getFontStyle(goIdxHoverFont)+"}\n";
  368.     sStyle+="</STYLE>";    
  369.     document.write(sStyle);
  370.     return;
  371. }
  372.  
  373. function window_Unload()
  374. {
  375.     UnRegisterListener2(this,WH_MSG_PROJECTREADY);
  376.     UnRegisterListener2(this,WH_MSG_SEARCHINDEXKEY);
  377. }
  378.  
  379. function onSendMessage(oMsg)
  380. {
  381.     if(oMsg)
  382.     {
  383.         var nMsgId=oMsg.nMessageId;
  384.         if(nMsgId==WH_MSG_SEARCHINDEXKEY)
  385.         {
  386.             if(oMsg.oParam && oMsg.oParam.sInput)
  387.             {
  388.                 if(gsCK==null)
  389.                 {
  390.                     gsCK=oMsg.oParam.sInput;
  391.                     gbCR = oMsg.oParam.bCR;
  392.                     findCK();
  393.                 }
  394.                 else
  395.                 {
  396.                     gsBCK=oMsg.oParam.sInput;
  397.                     gbBCR = oMsg.oParam.bCR;
  398.                 }
  399.             }
  400.         }
  401.         else if(nMsgId==WH_MSG_PROJECTREADY)
  402.         {
  403.             loadIdx();
  404.         }
  405.     }
  406.     return true;
  407. }
  408.  
  409. if(window.gbWhVer&&window.gbWhLang&&window.gbWhMsg&&window.gbWhUtil&&window.gbWhHost&&window.gbWhProxy)
  410. {
  411.     RegisterListener2(this,WH_MSG_PROJECTREADY);
  412.     RegisterListener2(this,WH_MSG_SEARCHINDEXKEY);
  413.     goIdxFont=new whFont("Verdana","8pt","#000000","normal","normal","none");
  414.     goIdxEmptyFont=new whFont("Verdana","8pt","#666666","normal","normal","none");
  415.     goIdxHoverFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline");
  416.  
  417.     window.onload=window_OnLoad;
  418.     window.onbeforeunload=window_BUnload;
  419.     window.onunload=window_Unload;
  420.     gbWhIHost=true;
  421. }
  422. else
  423.     document.location.reload();
  424.  
  425.