var gsSK2=null; var gsSK=null; var gsFtsBreakChars="\t\r\n\"\\ .,!@#$%^&*()~'`:;<>?/{}[]|+-=\x85\x92\x93\x94\x95\x96\x97\x99\xA9\xAE\xB7"; var gnCLF=0; var gsHelpCannotSearch="Cannot search for that phrase."; var gsNoTopics="No Topics Found."; var gsLoadingDivID="LoadingDiv"; var gsLoadingMsg="Loading data, please wait..."; var gsSearchMsg="Searching..."; var gsResultDivID="ResultDiv"; var gaaFCD=new Array(); var gaaFTCD=new Array(); var goCF=null; var goCTF=null; var gaTI=null; var gnCurrentOp=0; var gbNot=false; var gbReady=false; var gnLoadFts=1; var gnCacheLimits=5; var gaCCD=new Array(); var gbXML=false; var gaData=new Array(); var gsBgColor="#ffffff"; var gsBgImage=""; var gsMargin="0pt"; var gsIndent="0pt"; var gsCheckKey=null; var gnIndexNum=0; var gaFtsContentsCon=null; var gaTopicCheckInfo=null; var gnTopicCheck=0; var goFont=null; var goErrFont=null; var goHoverFont=null; var gsABgColor="#cccccc"; var gbWhFHost=false; function setBackground(sBgImage) { gsBgImage=sBgImage; } function setBackgroundcolor(sBgColor) { gsBgColor=sBgColor; } function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) { var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); if(sType=="Normal") goFont=vFont; else if(sType=="Error") goErrFont=vFont; else if(sType=="Hover") goHoverFont=vFont; } function setActiveBgColor(sBgColor) { gsABgColor=sBgColor; } function setMargin(sMargin) { gsMargin=sMargin; } function setIndent(sIndent) { gsIndent=sIndent; } function updateCache(oCF) { var len=gaCCD.length; if(len0&&sURL) { var topic=new Object(); topic.sTopicTitle=name; topic.sTopicURL=sURL; aTopics[aTopics.length]=topic; } } oChild=oChild.nextSibling; } putFtsTData(aTopics); } } else if(gnLoadFts==2) { var node=xmlDoc.lastChild; if(node) { var oChild=node.firstChild; var aFtsContents=new Array(); while(oChild) { if(oChild.nodeName=="key") { var name=oChild.getAttribute("name"); if(name&&name.length>0) { var item=new Object(); item.sItemName=name; aFtsContents[aFtsContents.length]=item; var oChildChild=oChild.firstChild; while(oChildChild) { if(oChildChild.nodeName=="#text") { var sIDs=oChildChild.nodeValue; if(sIDs) { var nBPos=0; do { var nPos=sIDs.indexOf(",",nBPos); var sID=null; if(nPos!=-1) sID=sIDs.substring(nBPos,nPos); else sID=sIDs.substring(nBPos); if(sID) { var id=parseInt(sID); if(!isNaN(id)) { if(!item.aTopics) item.aTopics=new Array(); item.aTopics[item.aTopics.length]=id; } } nBPos=nPos+1; }while(nBPos!=0&&nBPos0) { document.body.background=gsBgImage; } if(gsBgColor&&gsBgColor.length>0) { document.body.bgColor=gsBgColor; } writeResultDiv(); loadFts(); var oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null) SendMessage(oMsg); } function writeResultDiv() { var sHTML="
"; document.body.insertAdjacentHTML("beforeEnd",sHTML); } function loadFts() { if(!gbReady) { var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); if(SendMessage(oResMsg)&&oResMsg.oParam) { gbReady=true; var oProj=oResMsg.oParam; var aProj=oProj.aProj; gbXML=oProj.bXML; if(aProj.length>0) { var sLangId=aProj[0].sLangId; for(var i=0;i=0)&&(gsFtsBreakChars.charAt(nSep)=="|"))){ gnCurrentOp=0; gbNot=false; }else if((sCW=="and")||((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="&"))){ gnCurrentOp=1; gbNot=false; }else if((sCW=="not")|| ((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="~"))){ gbNot=!gbNot; }else if(sCW!=""&&!IsStopWord(sCW,gaFtsStop)){ var sCurrentStem=GetStem(sCW); gsCW=sCurrentStem; ftsFindKeyword(); return; } findOneKey(); return; } else{ displayTopics(); checkAgain(); } } function checkAgain() { gsSK=gsSK2; gsSK2=null; if(gsSK!=null) setTimeout("findFTSKey();",1); } function displayTopics() { var sHTML=""; var sLine=""; for(var i=0;i"+_textToHtml(gaTI[i].sTopicTitle)+""; if(i>>4<<4==i) { sHTML+=sLine; sLine=""; } } if(sLine.length>0) sHTML+=sLine; if(sHTML.length==0) sHTML="

"+gsNoTopics+"

" else sHTML="
"+sHTML+"
"; var resultDiv=getElement(gsResultDivID); if(resultDiv) resultDiv.innerHTML=sHTML; } function displayMsg(sErrorMsg) { var sHTML="

"+sErrorMsg+"

"; var resultDiv=getElement(gsResultDivID); if(resultDiv) resultDiv.innerHTML=sHTML; } function ftsFindKeyword() { var sKey=gsCW; var bNeedLoad=false; var aFtsContentsCon=null; var s=0; if(sKey==null) return; if(!gsCheckKey||sKey!=gsCheckKey||gnIndexNum==0) { aFtsContentsCon=new Array(); gnCheck=0; gsCheckKey=sKey; gnTopicCheck=0; gaTopicCheckInfo=null; } else{ s=gnIndexNum; aFtsContentsCon=gaFtsContentsCon; } for(var i=gnCheck;i=aTI.length) { aLS=gaTI; aSS=aTI; } else { aLS=aTI; aSS=gaTI; } var s=0; for(var i=0;i=0) { var nM; var bFound=false; do{ nM=(nB+nE)>>1; if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)>0) nE=nM-1; else if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) nB=nM+1; else { bFound=true; break; } }while(nB<=nE); if(bFound) insertItemIntoArray(aTI,nM,oTI); else { if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) insertItemIntoArray(aTI,nM+1,oTI); else insertItemIntoArray(aTI,nM,oTI); } } else aTI[0]=oTI; } function mergeTopics(aTI1,aTI2) { var i1=0; var i2=0; var len1=aTI1.length; var len2=aTI2.length; var aTopicNew=new Array(); var i=0; while(i1>1; if(compare(keys[nM].sItemName,sKey)>0) nE=nM-1; else if(compare(keys[nM].sItemName,sKey)<0) nB=nM+1; else{ bFound=true; break; } }while(nB<=nE); if(bFound) { if(keys[nM].aTopics) { for(var i=0;i>1; if(aFTCD[nM].nBegin>nTopicId) nE=nM-1; else if(aFTCD[nM].nEnd