// WebHelp 5.10.007
var gaHSLoad=new Array();
var gnMinIdx=0;
var gnInsIdx=-1;
var gsLoadingDivID="LoadingDiv";
var gsLoadingMsg="Loading, click here to cancel...";
var gaProj=null;
var gaTocs=new Array();
var goChunk=null;
var gbReady=false;
var gbToc=false;
var gbXML=false;
var gaRoot=new Array();
var gnCC=-1;
var gsTP="";
var gaBTPs="";
var gsCTPath="";
var gnLT=-1;
var gsPathSplit="\n";
var gsBgColor="#ffffff";
var gsBgImage="";
var goFont=null;
var goHFont=null;
var gsMargin="0pt";
var gsIndent="15pt";
var gsABgColor="#cccccc";
var giBookClose="";
var giBookOpen="";
var giBookItem="";
var giURLItem="";
var giNewBookClose="";
var giNewBookOpen="";
var giNewBookItem="";
var giNewURLItem="";
var gnImages=0;
var gnLoadedImages=0;
var gaImgs=new Array();
var gbLoadData=false;
var gobj=null;
var gaTocsNs61Fix=null;
var gbWhTHost=false;
var gBookItems=new Array();
var gInSync=false;
var gbLData=false;
var gbNeedFillStub=false;
var gbLoadToc=false;
function chunkInfoQueue()
{
this.aContent=new Array();
this.inQueue=function(cInfo)
{
this.aContent[this.aContent.length]=cInfo;
}
this.deQueue=function()
{
var cInfo=null;
if(this.aContent.length>0)
{
cInfo=this.aContent[0];
for(var i=1;i0)
{
var nCIdx=0;
do {
nCIdx++;
var i=nIdx+nCIdx;
var nItemType=getItemType(i);
if(nItemType==1){
if (!isBookEmpty(i))
return false;
}
else if(nItemType==4){
var sSrc=getRefURL(i);
var nProj=getProject(sSrc);
if(nProj!=-1){
sSrc=gaRoot[nProj].sToc;
if(sSrc)
return false;
}
}
else if(nItemType==2||nItemType==16||nItemType==8)
return false;
} while(nCIdx";
sHTML+=" "+sName+"
";
var sURL=_textToHtml_nonbsp(getItemURL(nIdx));
if(sURL!="")
addBookItem(getBookId(nIdx),_textToHtml_nonbsp(getTopicTarget(nIdx)),sURL);
sHTML+="";
}
else
sHTML="";
}
else
{
sHTML+="stub>";
gbNeedFillStub=true;
setTimeout("fillStub("+nIdx+","+bLocalProject+");",100);
}
return sHTML;
}
function checkFillStub()
{
if(!gbLData)
{
if(gchunkRequestQueue.length()>0)
{
var cInfo=gchunkRequestQueue.deQueue();
if(cInfo)
{
fillStub(cInfo.nIdx,cInfo.bLocal);
return;
}
}
}
if(gbNeedFillStub)
{
gbNeedFillStub=false;
setTimeout("syncInit()",1);
}
}
function fillStub(nIdx,bLocalProject)
{
if(!gbLData)
{
gbLData=true;
var sObj=getElement(getPBId(nIdx));
if(sObj!=null)
{
tocExpandHelpSet(nIdx,bLocalProject);
gbNeedFillStub=false;
setTimeout("syncInit()",1);
}
else
setTimeout("fillStub("+nIdx+","+bLocalProject+");",100);
}
else
gchunkRequestQueue.inQueue(new chunkInfo(nIdx,bLocalProject));
}
function getBookId(nIdx){return "B_"+nIdx;}
function getItemId(nIdx){return "I_"+nIdx;}
function markBook(nIdx)
{
var obj=getElement(getItemId(nIdx));
if(obj==null)
obj=getElement(getBookId(nIdx));
if(gbNav6)
{
gobj=obj;
setTimeout("delayMarkObj();",1);
}
else
markObj(obj);
}
function delayMarkObj()
{
if(gobj)
{
markObj(gobj);
gobj=null;
}
}
function markObj(obj)
{
if(obj!=null)
{
HighLightElement(obj,gsABgColor,"transparent");
var sPath=calTocPath(obj);
if(gsCTPath!=sPath)
gsCTPath=sPath;
}
}
function markItem(nIdx)
{
var obj=getElement(getItemId(nIdx));
if(gbNav6)
{
gobj=obj;
setTimeout("delayMarkObj();",1);
}
else
markObj(getElement(getItemId(nIdx)));
}
function calTocPath(obj)
{
var sPath=getInnerText2(obj);
var pObj=getParentNode(obj);
do
{
while(pObj!=null&&!isCBId(pObj.id)) pObj=getParentNode(pObj);
if(pObj!=null)
{
var nId=getIdByCBId(pObj.id);
var sObj=getElement(getPBId(nId));
if(sObj!=null)
{
var objs=getItemsByBook(sObj);
for(var i=0;i "+sName+"
";
return sHTML;
}
function writeBookItems(nIdx,num)
{
var sHTML="";
if(num>0){
var nCIdx=0;
do{
nCIdx++;
var i=nIdx+nCIdx;
var nItemType=getItemType(i);
if(nItemType==1||nItemType==4||nItemType==8){
sHTML+=writeBook(i);
nCIdx+=getItemContentsNum(i);
}
else if(nItemType==2||nItemType==16){
sHTML+=writeAnItem(i);
}
}
while(nCIdx"+gsLoadingMsg+"";
}
function getItemName(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
return oChunk.aTocs[nIdx-oChunk.nMI].sItemName;
else
return null;
}
function getItemContentsNum(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
return oChunk.aTocs[nIdx-oChunk.nMI].nContents;
else
return null;
}
function getItemType(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
return oChunk.aTocs[nIdx-oChunk.nMI].nType;
else
return 0;
}
function getItemURL(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
{
var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sItemURL;
if(!(sPath==null||sPath==""))
{
return _getFullPath(oChunk.sPPath,sPath);
}
}
return "";
}
function getRefURL(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
{
var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sRefURL;
if(!(sPath==null||sPath==""))
{
return _getFullPath(oChunk.sPPath,sPath)
}
}
return "";
}
function getTopicTarget(nIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
{
if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sTarget)!="undefined")
return oChunk.aTocs[nIdx-oChunk.nMI].sTarget;
}
return "";
}
function getItemIcon(nIdx,nIconIdx)
{
var oChunk=getChunk(nIdx);
if(oChunk)
{
if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sIconRef)!="undefined")
{
var sIconRef=oChunk.aTocs[nIdx-oChunk.nMI].sIconRef;
var nIndex=sIconRef.indexOf(";");
while(nIconIdx-->0&&nIndex!=-1)
{
sIconRef=sIconRef.substring(nIndex+1);
nIndex=sIconRef.indexOf(";");
}
if(nIconIdx<0)
{
if(nIndex!=-1)
sIconRef=sIconRef.substring(0,nIndex);
return _getFullPath(oChunk.sPPath,sIconRef)
}
}
}
return "";
}
function TocWriteClassStyle()
{
var sStyle="";
document.write(sStyle);
}
function TocWriteFixedWidth(bBegin,nWidth)
{
if((gbIE4)&&(gbMac)&&(!gbIE5)){
if(bBegin)
document.write("");
else
document.write(" |
");
}
}
function TocInitPage()
{
var tempColl=getItemsByBook(document.body);
if(tempColl.length>0)
tempColl[0].focus();
}
function getItemsFromObj(obj)
{
var aAnchor=new Array();
var tempColl=getChildrenByTag(obj,"P");
if(tempColl&&tempColl.length>0)
{
var anobr=new Array();
for(var i=0;i0)
for(var j=0;j0)
for(var u=0;u0)
for(var j=0;jdocument.body.clientHeight){
nNewScroll=nTop-20;
}
}
document.body.scrollTop=nNewScroll;
}
function TocExpand(nId,bChangeImg,bForceOpen)
{
var oDiv=getElement(getCBId(nId));
if(oDiv==null) return null;
var whichIm=document.images[getBId(nId)];
if((oDiv.style.display!="block")||bForceOpen){
oDiv.style.display="block";
if(bChangeImg){
var sPath=getPath(whichIm.src);
sPath=_getFullPath(sPath,getBookImage(nId,false));
whichIm.src=sPath;
}
}else{
oDiv.style.display="none";
if(bChangeImg){
var sPath=getPath(whichIm.src);
sPath=_getFullPath(sPath,getBookImage(nId,true));
whichIm.src=sPath;
}
if(gbMac&&gbIE5){
this.parent.document.getElementById("tocIFrame").style.width="101%";
this.parent.document.getElementById("tocIFrame").style.width="100%";
}
}
return oDiv;
}
function getChunkId(n)
{
var nCan=-1;
for(var i=0;i=gaTocs[nCan].nMI)
nCan=i;
}
if(nCan!=-1)
return nCan;
else
return -1;
}
function getChunk(n)
{
if(gnCC!=-1&&gaTocs[gnCC].nMI<=n&&(gnCC==gaTocs.length-1||
gaTocs[gnCC+1].nMI>n))
{
return gaTocs[gnCC];
}
else{
gnCC=getChunkId(n);
if(gnCC!=-1)
return gaTocs[gnCC];
else
return null;
}
}
function getBookImage(nIdx,bClosed)
{
var nIdx=bClosed?0:1;
var sIcon=getItemIcon(nIdx,nIdx);
if(sIcon=="")
if(bClosed)
sIcon=giBookClose;
else
sIcon=giBookOpen;
return _getFullPath(gaProj[0].sPPath,sIcon);
}
function getItemImage(nIdx,bRemote)
{
var sIcon=getItemIcon(nIdx,0);
if(sIcon=="")
if(bRemote)
sIcon=giURLItem;
else
sIcon=giBookItem;
return _getFullPath(gaProj[0].sPPath,sIcon);
}
function getInnerText2(obj)
{
var sText=getInnerText(obj);
if(sText.length>0&&!gbOpera7)
sText=sText.substring(1);
return sText;
}
function expandToc(oObj,sRest,aIdList)
{
var len=aIdList.length;
var nPos=sRest.indexOf(gsPathSplit);
if(nPos!=-1)
{
sPart=sRest.substring(0,nPos);
sRest=sRest.substring(nPos+1);
}
else
{
sPart=sRest;
var aTagAs=getItemsByBook(oObj);
for(var s=0;s0)
{
if(gbNav6)
{
var sCommand=obj[0].getAttribute("onClick");
var nCommand=sCommand.indexOf(";");
sCommand=sCommand.substring(0,nCommand);
setTimeout(sCommand,1);
}
else
obj[0].click();
}
return -1;
}
var nRet=expandToc(oCObj,sRest,aIdList);
if(nRet)
return nRet;
}
}
aIdList.length=len;
return 0;
}
function getIdByPBId(sPId)
{
return parseInt(sPId.substring(2,sPId.length-1));
}
function getIdByCBId(sCId)
{
return parseInt(sCId.substring(2,sCId.length-1));
}
function isPBId(sId)
{
return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("P")==sId.length-1);
}
function isCBId(sId)
{
return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("C")==sId.length-1);
}
function getBId(nIdx)
{
return "B_"+nIdx;
}
function getPBId(nIdx)
{
return getBId(nIdx)+"P";
}
function getCBId(nIdx)
{
return getBId(nIdx)+"C";
}
function getClosestTocPath(aPaths)
{
var nMaxSimilarity=0;
var nThatIndex=-1;
var sPath=null;
if(aPaths.length==0) return sPath;
for(var i=0;inMaxSimilarity)
{
nMaxSimilarity=nSimilarity;
nThatIndex=i;
}
}
if(nThatIndex!=-1)
sPath=aPaths[nThatIndex];
else
sPath=aPaths[0];
return sPath;
}
function comparePath(sPath1,sPath2)
{
var nMaxSimilarity=0;
var nStartPos1=0;
var nPos1=-1;
var nStartPos2=0;
var nPos2=-1;
do{
var sCheck1=null;
var sCheck2=null;
nPos1=sPath1.indexOf(gsPathSplit,nStartPos1);
if(nPos1!=-1)
{
sCheck1=sPath1.substring(nStartPos1,nPos1);
nStartPos1=nPos1+1;
}
else
{
sCheck1=sPath1.substring(nStartPos1);
nStartPos1=-1;
}
nPos2=sPath2.indexOf(gsPathSplit,nStartPos2);
if(nPos1!=-1)
{
sCheck2=sPath2.substring(nStartPos2,nPos2);
nStartPos2=nPos2+1;
}
else
{
sCheck2=sPath2.substring(nStartPos2);
nStartPos2=-1;
}
if(sCheck1==sCheck2)
nMaxSimilarity++;
else
break;
}while(nStartPos1!=-1&&nStartPos2!=-1);
return nMaxSimilarity;
}
function getTocPaths(oTopicParam)
{
var aRelTocPaths=oTopicParam.aPaths;
var aPaths=new Array();
for(var i=0;i0)
{
for(var i=0;i0)
{
document.body.background=gsBgImage;
}
if(gsBgColor&&gsBgColor.length>0)
{
document.body.bgColor=gsBgColor;
}
loadToc();
var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null)
SendMessage(oMsg);
}
function loadImages()
{
if(giBookClose)
{
gaImgs[gnImages]=giBookClose;
gnImages++;
}
if(giBookOpen)
{
gaImgs[gnImages]=giBookOpen;
gnImages++;
}
if(giBookItem)
{
gaImgs[gnImages]=giBookItem;
gnImages++;
}
if(giURLItem)
{
gaImgs[gnImages]=giURLItem;
gnImages++;
}
if(giNewBookClose)
{
gaImgs[gnImages]=giNewBookClose;
gnImages++;
}
if(giNewBookOpen)
{
gaImgs[gnImages]=giNewBookOpen;
gnImages++;
}
if(giNewBookItem)
{
gaImgs[gnImages]=giNewBookItem;
gnImages++;
}
if(giNewURLItem)
{
gaImgs[gnImages]=giNewURLItem;
gnImages++;
}
if(gnImages>0)
{
setTimeout("loadDataAfter();",1000);
loadImage(gaImgs[0]);
}
else
loadDataAfter();
}
function loadImage(sURL)
{
var oImg=new Image();
oImg.onload=checkImageLoading;
oImg.onerror=errorImageLoading;
oImg.src=_getFullPath(gaProj[0].sPPath,sURL);
}
function loadDataAfter()
{
if(!gbLoadData)
{
gbLoadData=true;
loadTData();
}
}
function errorImageLoading()
{
gnLoadedImages++;
if(gnImages==gnLoadedImages)
loadDataAfter();
else
loadImage(gaImgs[gnLoadedImages]);
}
function checkImageLoading()
{
gnLoadedImages++;
if(gnImages==gnLoadedImages)
loadDataAfter();
else
loadImage(gaImgs[gnLoadedImages]);
}
function window_unload()
{
UnRegisterListener2(this,WH_MSG_PROJECTREADY);
UnRegisterListener2(this,WH_MSG_SYNCTOC);
UnRegisterListener2(this,WH_MSG_SHOWTOC);
}
function onSendMessage(oMsg)
{
if(oMsg)
{
var nMsgId=oMsg.nMessageId;
if(nMsgId==WH_MSG_PROJECTREADY)
{
loadToc();
}
else if(nMsgId==WH_MSG_SYNCTOC)
{
if(gbReady)
{
syncWithPaths(oMsg.oParam);
}
}
else if(nMsgId==WH_MSG_SHOWTOC)
{
if(!gbNav6)
document.body.focus();
}
}
return true;
}
if(window.gbWhUtil&&window.gbWhVer&&window.gbWhMsg&&window.gbWhProxy)
{
RegisterListener2(this,WH_MSG_PROJECTREADY);
RegisterListener2(this,WH_MSG_SYNCTOC);
RegisterListener2(this,WH_MSG_SHOWTOC);
goFont=new whFont("Verdana","8pt","#000000","normal","normal","none");
goHFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline");
window.onload=window_OnLoad;
window.onbeforeunload=window_BUnload;
window.onunload=window_unload;
gbWhTHost=true;
}
else
document.location.reload();