4165. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/2/2018 11:59:59 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

4165.1 Files compared

# Location File Last Modified
1 Tue Jan 2 16:59:59 2018 UTC
2 HTRE_P2.zip\src.zip\output\ihta_admin.zip\dmp.zip whthost.js Mon Feb 24 17:07:20 2014 UTC

4165.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 1 1538
Removed 0 0

4165.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

4165.4 Active regular expressions

No regular expressions were active.

4165.5 Comparison detail

        1   //      We bHelp 5.10 .007
        2   var gaHSLo ad=new Arr ay();
        3   var gnMinI dx=0;
        4   var gnInsI dx=-1;
        5   var gsLoad ingDivID=" LoadingDiv ";
        6   var gsLoad ingMsg="Lo ading, cli ck here to  cancel... ";
        7   var gaProj =null;
        8   var gaTocs =new Array ();
        9   var goChun k=null;
        10   var gbRead y=false;
        11   var gbToc= false;
        12   var gbXML= false;
        13   var gaRoot =new Array ();
        14   var gnCC=- 1;
        15   var gsTP=" ";
        16   var gaBTPs ="";
        17   var gsCTPa th="";
        18   var gnLT=- 1;
        19   var gsPath Split="\n" ;
        20   var gsBgCo lor="#ffff ff";
        21   var gsBgIm age="";
        22   var goFont =null;
        23   var goHFon t=null;
        24  
        25   var gsMarg in="0pt";
        26   var gsInde nt="15pt";
        27   var gsABgC olor="#ccc ccc";
        28  
        29   var giBook Close="";
        30   var giBook Open="";
        31   var giBook Item="";
        32   var giURLI tem="";
        33   var giNewB ookClose=" ";
        34   var giNewB ookOpen="" ;
        35   var giNewB ookItem="" ;
        36   var giNewU RLItem="";
        37   var gnImag es=0;
        38   var gnLoad edImages=0 ;
        39   var gaImgs =new Array ();
        40   var gbLoad Data=false ;
        41   var gobj=n ull;
        42   var gaTocs Ns61Fix=nu ll;
        43   var gbWhTH ost=false;
        44   var gBookI tems=new A rray();
        45   var gInSyn c=false;
        46   var gbLDat a=false;
        47   var gbNeed FillStub=f alse;
        48   var gbLoad Toc=false;
        49  
        50   function c hunkInfoQu eue()
        51   {
        52           th is.aConten t=new Arra y();
        53           th is.inQueue =function( cInfo)
        54           {
        55                    this .aContent[ this.aCont ent.length ]=cInfo;
        56           }
        57           th is.deQueue =function( )
        58           {
        59                    var  cInfo=null ;
        60                    if(t his.aConte nt.length> 0)
        61                    {
        62                             cInfo= this.aCont ent[0];
        63                             for(va r i=1;i<th is.aConten t.length;i ++)
        64                                      this.aCo ntent[i-1] =this.aCon tent[i];
        65                             this.a Content.le ngth--;
        66                    }
        67                    retu rn cInfo;
        68           }
        69           th is.length= function()
        70           {
        71                    retu rn this.aC ontent.len gth;
        72           }
        73   }
        74  
        75   var gchunk RequestQue ue=new chu nkInfoQueu e();
        76  
        77   function c hunkInfo(n Idx, bLoca l)
        78   {
        79           th is.nIdx=nI dx;
        80           th is.bLocal= bLocal;
        81   }
        82  
        83   function s etBackgrou nd(sBgImag e)
        84   {
        85           gs BgImage=sB gImage;
        86   }
        87  
        88   function s etBackgrou ndcolor(sB gColor)
        89   {
        90           gs BgColor=sB gColor;
        91   }
        92  
        93   function s etFont(sTy pe,sFontNa me,sFontSi ze,sFontCo lor,sFontS tyle,sFont Weight,sFo ntDecorati on)
        94   {
        95           va r vFont=ne w whFont(s FontName,s FontSize,s FontColor, sFontStyle ,sFontWeig ht,sFontDe coration);
        96           if (sType=="N ormal") go Font=vFont ;
        97           el se if(sTyp e=="Hover" ) goHFont= vFont;
        98   }
        99  
        100   function s etActiveBg Color(sBgC olor){gsAB gColor=sBg Color;}
        101  
        102   function s etMargin(s Margin){gs Margin=sMa rgin;}
        103  
        104   function s etIndent(s Indent){gs Indent=sIn dent;}
        105  
        106   function s etIcon(sTy pe,sURL)
        107   {
        108           if (sType=="B ookOpen")
        109                    giBo okOpen=sUR L;
        110           el se if(sTyp e=="BookCl ose")
        111                    giBo okClose=sU RL;
        112           el se if(sTyp e=="Item")
        113                    giBo okItem=sUR L;
        114           el se if(sTyp e=="Remote Item")
        115                    giUR LItem=sURL ;
        116           el se if(sTyp e=="NewBoo kClose")
        117                    giNe wBookClose =sURL;
        118           el se if(sTyp e=="NewBoo kOpen")
        119                    giNe wBookOpen= sURL;
        120           el se if(sTyp e=="NewIte m")
        121                    giNe wBookItem= sURL;
        122           el se if(sTyp e=="NewRem oteItem")
        123                    giNe wURLItem=s URL;               
        124   }
        125  
        126   function b ookItem(sT arget,sURL )
        127   {
        128           if (sTarget)
        129                    this .sTarget=s Target;
        130           el se
        131                    this .sTarget=" bsscright" ;
        132           th is.sURL=sU RL;
        133   }
        134  
        135   function a ddBookItem (sBookId,s Target,sUR L)
        136   {
        137           gB ookItems[s BookId]=ne w bookItem (sTarget,s URL);          
        138   }
        139  
        140   function t ocChunk(sP Path,sDPat h)
        141   {
        142           th is.sPPath= sPPath;
        143           th is.sDPath= sDPath;
        144           th is.nMI=-1;
        145           th is.aTocs=n ull;
        146   }
        147  
        148   function a ddTocChunk (sPPath,sD Path)
        149   {
        150           va r oChunk=n ew tocChun k(sPPath,s DPath);
        151           ga Tocs[gaToc s.length]= oChunk;
        152           re turn oChun k;
        153   }
        154  
        155   function i sHSLoad(nI dx)
        156   {
        157           fo r(var i=0; i<gaHSLoad .length;i+ +)
        158                    if(g aHSLoad[i] ==nIdx)
        159                             return  true;
        160           re turn false ;
        161   }
        162  
        163   function s etHSLoad(n Idx)
        164   {
        165           if (!isHSLoad (nIdx))
        166           {
        167                    var  len=gaHSLo ad.length;
        168                    for( var i=0;i< len;i++)
        169                             if(gaH SLoad[i]== -1)
        170                             {
        171                                      gaHSLoad [i]=nIdx;
        172                                      return;
        173                             }
        174                    gaHS Load[len]= nIdx;
        175           }
        176   }
        177  
        178   function s etHSUnLoad (nIdx)
        179   {
        180           if (isHSLoad( nIdx))
        181           {
        182                    for( var i=0;i< gaHSLoad.l ength;i++)
        183                             if(gaH SLoad[i]== nIdx)
        184                             {
        185                                      gaHSLoad [i]=-1;
        186                                      return;
        187                             }
        188           }
        189   }
        190  
        191   function r emoveLoadi ngDiv()
        192   {
        193           va r eLoading Div=getEle ment(gsLoa dingDivID) ;
        194           if (eLoadingD iv)
        195                    remo veThis(eLo adingDiv);
        196   }
        197  
        198   function c heckBookIt em(nIdx)
        199   {
        200           if (!gInSync)
        201           {
        202                    var  sBookId=ge tBookId(nI dx);
        203                    if(g BookItems[ sBookId])
        204                    {
        205                             window .open(gBoo kItems[sBo okId].sURL ,gBookItem s[sBookId] .sTarget);
        206                    }
        207           }
        208   }
        209  
        210   function i nsertBookI tems(nIdx, num)
        211   {
        212           ch eckBookIte m(nIdx);
        213           va r sChildBo okId=getCB Id(nIdx);
        214           va r eChildDi v=getEleme nt(sChildB ookId);
        215           if (eChildDiv ){
        216                    if(( eChildDiv. childNodes &&eChildDi v.childNod es.length= =0)||
        217                             (eChil dDiv.all&& eChildDiv. all.length ==0)){
        218                             var sH TML=writeB ookItems(n Idx,num);
        219                             eChild Div.innerH TML=sHTML;
        220                             setTim eout("sync Init()",1) ;
        221                    }
        222           }
        223           Ex pandIt(nId x);
        224   }
        225  
        226   function i sBookEmpty (nIdx)
        227   {
        228           va r num=getI temContent sNum(nIdx) ;
        229           if  (num>0)
        230           {
        231                    var  nCIdx=0;
        232                    do {
        233                             nCIdx+ +;
        234                             var i= nIdx+nCIdx ;
        235                             var nI temType=ge tItemType( i);
        236                             if(nIt emType==1) {
        237                                      if (!isB ookEmpty(i ))
        238                                               return fal se;
        239                             }
        240                             else i f(nItemTyp e==4){
        241                                      var      sSrc=getRe fURL(i);
        242                                      var nPro j=getProje ct(sSrc);
        243                                      if(nProj !=-1){
        244                                               sSrc=gaRoo t[nProj].s Toc;
        245                                               if(sSrc)
        246                                                       re turn false ;
        247                                      }
        248                             }
        249                             else i f(nItemTyp e==2||nIte mType==16| |nItemType ==8)
        250                                      return f alse;
        251                    } wh ile(nCIdx< num);
        252           }
        253           re turn true;
        254   }
        255  
        256   function w riteBook(n Idx)
        257   {
        258           va r sIcon=ge tBookImage (nIdx,true );
        259           va r sName=_t extToHtml( getItemNam e(nIdx));
        260           sI con=_textT oHtml_nonb sp(sIcon);
        261           
        262           va r nType=ge tItemType( nIdx);
        263           va r bLocal=( nType==1);
        264           va r bLocalPr oject=(nTy pe!=4);
        265           
        266           va r sHTML="< div id=\"" +getPBId(n Idx)+"\" c lass=";
        267           if (bLocal)
        268           {
        269                    if ( !isBookEmp ty(nIdx))
        270                    {
        271                             var sU RL=_textTo Html_nonbs p(getItemU RL(nIdx));
        272                             var sB ookRef = " javascript :void()"
        273                             if(sUR L!="")
        274                                      sBookRef  = sURL;
        275                             sHTML+ ="parent>< p><nobr><a  id=\""+ge tBookId(nI dx)+"\" hr ef=\""+sBo okRef+"\"  onfocus=\" markBook(" +nIdx+");\ " onclick= \"";
        276                             if(gbS afari3)
        277                                      sHTML+=" markBook(" +nIdx+");i nsertBookI tems("+nId x+", "+get ItemConten tsNum(nIdx );
        278                             else
        279                                      sHTML+=" insertBook Items("+nI dx+", "+ge tItemConte ntsNum(nId x);
        280                             sHTML+ =");return  false;\"  title=\""+ sName+"\"> <img alt=\ "Book\" na me=\""+get BId(nIdx)+ "\" src=\" "+sIcon+"\ " border=0  align=\"a bsmiddle\" >";
        281                             sHTML+ ="&nbsp;"+ sName+"</a ></nobr></ p></div>";
        282                             if(sUR L!="")
        283                                      addBookI tem(getBoo kId(nIdx), _textToHtm l_nonbsp(g etTopicTar get(nIdx)) ,sURL);
        284                             sHTML+ ="<div id= \""+getCBI d(nIdx)+"\ " class=ch ild></div> ";
        285                    }
        286                    else
        287                             sHTML= "";
        288           }
        289           el se
        290           {
        291                    sHTM L+="stub>< /div>";
        292                    gbNe edFillStub =true;
        293                    setT imeout("fi llStub("+n Idx+","+bL ocalProjec t+");",100 );
        294           }
        295           re turn sHTML ;
        296   }
        297  
        298   function c heckFillSt ub()
        299   {
        300           if (!gbLData)
        301           {
        302                    if(g chunkReque stQueue.le ngth()>0)
        303                    {
        304                             var cI nfo=gchunk RequestQue ue.deQueue ();
        305                             if(cIn fo)
        306                             {
        307                                      fillStub (cInfo.nId x,cInfo.bL ocal);
        308                                      return;
        309                             }
        310                    }
        311           }
        312           if (gbNeedFil lStub)
        313           {
        314                    gbNe edFillStub =false;
        315                    setT imeout("sy ncInit()", 1);
        316           }
        317   }
        318  
        319   function f illStub(nI dx,bLocalP roject)
        320   {
        321           if (!gbLData)
        322           {
        323                    gbLD ata=true;
        324                    var  sObj=getEl ement(getP BId(nIdx)) ;
        325                    if(s Obj!=null)
        326                    {
        327                             tocExp andHelpSet (nIdx,bLoc alProject) ;
        328                             gbNeed FillStub=f alse;
        329                             setTim eout("sync Init()",1) ;
        330                    }
        331                    else
        332                             setTim eout("fill Stub("+nId x+","+bLoc alProject+ ");",100);
        333           }
        334           el se
        335                    gchu nkRequestQ ueue.inQue ue(new chu nkInfo(nId x,bLocalPr oject));
        336   }
        337  
        338   function g etBookId(n Idx){retur n "B_"+nId x;}
        339  
        340   function g etItemId(n Idx){retur n "I_"+nId x;}
        341  
        342   function m arkBook(nI dx)
        343   {
        344           va r obj=getE lement(get ItemId(nId x));
        345           if (obj==null )
        346                    obj= getElement (getBookId (nIdx));
        347           if (gbNav6)
        348           {
        349                    gobj =obj;
        350                    setT imeout("de layMarkObj ();",1);
        351           }
        352           el se
        353                    mark Obj(obj);
        354   }
        355  
        356   function d elayMarkOb j()
        357   {
        358           if (gobj)
        359           {
        360                    mark Obj(gobj);
        361                    gobj =null;
        362           }
        363   }
        364  
        365   function m arkObj(obj )
        366   {
        367           if (obj!=null )
        368           {
        369                    High LightEleme nt(obj,gsA BgColor,"t ransparent ");
        370                    var  sPath=calT ocPath(obj );
        371                    if(g sCTPath!=s Path)
        372                             gsCTPa th=sPath;
        373           }
        374   }
        375  
        376   function m arkItem(nI dx)
        377   {
        378           va r obj=getE lement(get ItemId(nId x));
        379           if (gbNav6)
        380           {
        381                    gobj =obj;
        382                    setT imeout("de layMarkObj ();",1);
        383           }
        384           el se
        385                    mark Obj(getEle ment(getIt emId(nIdx) ));
        386   }
        387  
        388   function c alTocPath( obj)
        389   {
        390           va r sPath=ge tInnerText 2(obj);
        391           va r pObj=get ParentNode (obj);
        392           do
        393           {
        394                    whil e(pObj!=nu ll&&!isCBI d(pObj.id) ) pObj=get ParentNode (pObj);
        395                    if(p Obj!=null)
        396                    {
        397                             var nI d=getIdByC BId(pObj.i d);
        398                             var sO bj=getElem ent(getPBI d(nId));
        399                             if(sOb j!=null)
        400                             {
        401                                      var objs =getItemsB yBook(sObj );
        402                                      for(var  i=0;i<objs .length;i+ +)
        403                                      {
        404                                               var sText= getInnerTe xt2(objs[i ]);
        405                                               if(sText.l ength!=0)
        406                                               {
        407                                                       sP ath=sText+ gsPathSpli t+sPath;
        408                                                       br eak;
        409                                               }
        410                                      }
        411                             }
        412                             pObj=g etParentNo de(pObj);
        413                    }
        414           }w hile(pObj! =null);
        415           re turn sPath ;
        416   }
        417  
        418   function w riteAnItem (nIdx)
        419   {
        420           va r sTarget= _textToHtm l_nonbsp(g etTopicTar get(nIdx)) ;
        421           va r sIcon=ge tItemIcon( nIdx,0);
        422           if (sIcon=="" )
        423           {
        424                    var  nItemType= getItemTyp e(nIdx);
        425                    if(n ItemType&2 )
        426                             sIcon= getItemIma ge(nIdx,fa lse);
        427                    else
        428                             sIcon= getItemIma ge(nIdx,tr ue);
        429           }
        430           sI con=_textT oHtml_nonb sp(sIcon);
        431           va r sName=_t extToHtml( getItemNam e(nIdx));
        432           va r sHTML="< p><nobr><a  id=\""+ge tItemId(nI dx)+"\" on focus =\"m arkItem("+ nIdx+");\"  onclick=\ "markItem( "+nIdx+"); \""
        433           va r sAltStri ng="";
        434           if (nItemType &2)
        435                    sAlt String="Pa ge";
        436           el se
        437                    sAlt String="Re mote Page" ;
        438           if (sTarget!= "")
        439                    sHTM L+="target =\""+sTarg et+"\" ";
        440           sH TML+="href =\""+_text ToHtml_non bsp(getIte mURL(nIdx) )+"\" titl e=\""+sNam e+"\"><img  alt=\""+s AltString+ "\" src=\" "+sIcon+"\ " border=0  align=\"a bsmiddle\" >&nbsp;"+s Name+"</a> </nobr></p >";
        441           re turn sHTML ;
        442   }
        443  
        444   function w riteBookIt ems(nIdx,n um)
        445   {
        446           va r sHTML="" ;
        447           if (num>0){
        448                    var  nCIdx=0;
        449                    do{
        450                             nCIdx+ +;
        451                             var i= nIdx+nCIdx ;
        452                             var nI temType=ge tItemType( i);
        453                             if(nIt emType==1| |nItemType ==4||nItem Type==8){
        454                                      sHTML+=w riteBook(i );    
        455                                      nCIdx+=g etItemCont entsNum(i) ;            
        456                             }
        457                             else i f(nItemTyp e==2||nIte mType==16) {
        458                                      sHTML+=w riteAnItem (i);
        459                             }
        460                    }
        461                    whil e(nCIdx<nu m);
        462           }
        463           re turn sHTML ;
        464   }
        465  
        466   function t ocExpandHe lpSet(nIdx ,bLocal)
        467   {
        468           ch eckBookIte m(nIdx);
        469           re moveLoadin gDiv();
        470           if (!isHSLoad (nIdx))
        471           {
        472                    setH SLoad(nIdx );
        473                    var  sSrc="";
        474                    if(b Local){
        475                             var oC hunk=getCh unk(nIdx);
        476                             if(oCh unk)
        477                             {
        478                                      goChunk= addTocChun k(oChunk.s PPath,oChu nk.sDPath) ;
        479                                      sSrc=oCh unk.aTocs[ nIdx-oChun k.nMI].sRe fURL;
        480                             }
        481                    }
        482                    else {
        483                             sSrc=g etRefURL(n Idx);
        484                             var nP roj=getPro ject(sSrc) ;
        485                             if(nPr oj!=-1)
        486                             {
        487                                      sSrc=gaR oot[nProj] .sToc;
        488                                      if(sSrc)
        489                                               goChunk=ad dTocChunk( gaProj[nPr oj].sPPath ,gaProj[nP roj].sDPat h);
        490                                      else
        491                                               goChunk=nu ll;
        492                             }
        493                             else
        494                                      goChunk= null;
        495                    }
        496                    if(g oChunk)
        497                    {
        498                             Prepar eLoading(n Idx);
        499                             gbToc= false;
        500                             loadDa ta2(goChun k.sPPath+g oChunk.sDP ath+sSrc);
        501                    }
        502                    else
        503                    {
        504                             gbLDat a=false;
        505                             checkF illStub();
        506                    }
        507           }
        508   }
        509  
        510   function g etProject( sSrc)
        511   {
        512           fo r(var i=0; i<gaProj.l ength;i++)
        513                    if(i sSamePath( getPath(sS rc),gaProj [i].sPPath ))
        514                             return  i;
        515           re turn -1;
        516   }
        517  
        518   function g etPath(sPa th)
        519   {
        520           if (sPath!="" )
        521           {
        522                    sPat h=_replace Slash(sPat h);
        523                    var  nPosFile=s Path.lastI ndexOf("/" );
        524                    sPat h=sPath.su bstring(0, nPosFile+1 );
        525           }
        526           re turn sPath ;
        527   }
        528  
        529   function i sSamePath( sPath1,sPa th2)
        530   {
        531           re turn (sPat h1.toLower Case()==sP ath2.toLow erCase());
        532   }
        533  
        534   function P repareLoad ing(nIdx)
        535   {
        536           gn InsIdx=nId x;
        537           if (!gsTP)
        538           {
        539                    var  oObj=getEl ement(getP BId(gnInsI dx));
        540                    if(o Obj)
        541                             oObj.i nsertAdjac entHTML("a fterEnd",w riteLoadin gDiv(nIdx) );
        542           }
        543   }
        544  
        545   function w riteLoadin gDiv(nIdx)
        546   {
        547           re turn"<div  id=\""+gsL oadingDivI D+"\" clas s=parent o nclick=\"r emoveLoadi ngDiv();\"  style=\"p adding-lef t:4px;back ground-col or:ivory;b order-widt h:1;border -style:sol id;border- color:blac k;width:15 0px;\">"+g sLoadingMs g+"</div>" ;
        548   }
        549  
        550   function g etItemName (nIdx)
        551   {
        552           va r oChunk=g etChunk(nI dx);
        553           if (oChunk)
        554                    retu rn oChunk. aTocs[nIdx -oChunk.nM I].sItemNa me;
        555           el se
        556                    retu rn null;
        557   }
        558  
        559   function g etItemCont entsNum(nI dx)
        560   {
        561           va r oChunk=g etChunk(nI dx);
        562           if (oChunk)
        563                    retu rn oChunk. aTocs[nIdx -oChunk.nM I].nConten ts;
        564           el se
        565                    retu rn null;
        566   }
        567  
        568   function g etItemType (nIdx)
        569   {
        570           va r oChunk=g etChunk(nI dx);
        571           if (oChunk)
        572                    retu rn oChunk. aTocs[nIdx -oChunk.nM I].nType;
        573           el se
        574                    retu rn 0;
        575   }
        576  
        577   function g etItemURL( nIdx)
        578   {
        579           va r oChunk=g etChunk(nI dx);
        580           if (oChunk)
        581           {
        582                    var  sPath=oChu nk.aTocs[n Idx-oChunk .nMI].sIte mURL;
        583                    if(! (sPath==nu ll||sPath= =""))
        584                    {
        585                             return  _getFullP ath(oChunk .sPPath,sP ath);
        586                    }
        587           }
        588           re turn "";
        589   }
        590  
        591   function g etRefURL(n Idx)
        592   {
        593           va r oChunk=g etChunk(nI dx);
        594           if (oChunk)
        595           {
        596                    var  sPath=oChu nk.aTocs[n Idx-oChunk .nMI].sRef URL;
        597                    if(! (sPath==nu ll||sPath= =""))
        598                    {
        599                             return  _getFullP ath(oChunk .sPPath,sP ath)
        600                    }
        601           }
        602           re turn "";
        603   }
        604  
        605   function g etTopicTar get(nIdx)
        606   {
        607           va r oChunk=g etChunk(nI dx);
        608           if (oChunk)
        609           {
        610                    if(t ypeof(oChu nk.aTocs[n Idx-oChunk .nMI].sTar get)!="und efined")
        611                             return  oChunk.aT ocs[nIdx-o Chunk.nMI] .sTarget;
        612           }
        613           re turn "";
        614   }
        615  
        616   function g etItemIcon (nIdx,nIco nIdx)
        617   {
        618           va r oChunk=g etChunk(nI dx);
        619           if (oChunk)
        620           {
        621                    if(t ypeof(oChu nk.aTocs[n Idx-oChunk .nMI].sIco nRef)!="un defined")
        622                    {
        623                             var sI conRef=oCh unk.aTocs[ nIdx-oChun k.nMI].sIc onRef;
        624                             var nI ndex=sIcon Ref.indexO f(";");
        625                             while( nIconIdx-- >0&&nIndex !=-1)
        626                             {
        627                                      sIconRef =sIconRef. substring( nIndex+1);
        628                                      nIndex=s IconRef.in dexOf(";") ;
        629                             }
        630                             if(nIc onIdx<0)
        631                             {
        632                                      if(nInde x!=-1)
        633                                               sIconRef=s IconRef.su bstring(0, nIndex);
        634                                      return _ getFullPat h(oChunk.s PPath,sIco nRef)
        635                             }
        636                    }
        637           }
        638           re turn "";
        639   }
        640  
        641   function T ocWriteCla ssStyle()
        642   {
        643           va r sStyle=" <STYLE TYP E='text/cs s'>\n";
        644           if (gsBgImage )
        645                    sSty le+="body  {border-to p:"+gsBgCo lor+" 1px  solid;}\n" ;
        646           el se
        647                    sSty le+="body  {border-to p:black 1p x solid;}\ n";
        648           sS tyle+="P { "+getFontS tyle(goFon t)+"margin -top:"+gsM argin+";ma rgin-botto m:"+gsMarg in+";}\n";
        649           sS tyle+="DIV  {margin-t op:"+gsMar gin+";marg in-bottom: "+gsMargin +";}\n";
        650           sS tyle+=".pa rent {marg in-left:0p t;}\n";
        651           sS tyle+=".st ub {margin -left:0pt; display:no ne}\n";
        652           sS tyle+=".ch ild {displ ay:none;ma rgin-left: "+gsIndent +";}\n";
        653           sS tyle+="A:l ink {"+get FontStyle( goFont)+"} \n";
        654           sS tyle+="A:v isited {"+ getFontSty le(goFont) +"}\n";
        655           sS tyle+="A:a ctive {bac kground-co lor:"+gsAB gColor+";} \n";
        656           sS tyle +="A: hover {"+g etFontStyl e(goHFont) +"}\n";
        657           sS tyle+="</S TYLE>";
        658           do cument.wri te(sStyle) ;
        659   }
        660  
        661   function T ocWriteFix edWidth(bB egin,nWidt h)
        662   {
        663           if ((gbIE4)&& (gbMac)&&( !gbIE5)){
        664                    if(b Begin)
        665                             docume nt.write(" <table wid th="+nWidt h+" border =0><tr><td >");
        666                    else
        667                             docume nt.write(" </td></tr> </table>") ;
        668           }
        669   }
        670  
        671   function T ocInitPage ()
        672   {
        673           va r tempColl =getItemsB yBook(docu ment.body) ;
        674           if (tempColl. length>0)
        675                    temp Coll[0].fo cus();
        676   }
        677  
        678   function g etItemsFro mObj(obj)
        679   {
        680           va r aAnchor= new Array( );
        681           va r tempColl =getChildr enByTag(ob j,"P");
        682           if (tempColl& &tempColl. length>0)
        683           {
        684                    var  anobr=new  Array();
        685                    for( var i=0;i< tempColl.l ength;i++)
        686                    {
        687                             var te mpNobr=get ChildrenBy Tag(tempCo ll[i],"NOB R");
        688                             if(tem pNobr&&tem pNobr.leng th>0)
        689                                      for(var  j=0;j<temp Nobr.lengt h;j++)
        690                                               anobr[anob r.length]= tempNobr[j ];
        691                    }
        692                    for( var s=0;s< anobr.leng th;s++)
        693                    {
        694                             var te mpAnchor=g etChildren ByTag(anob r[s],"A");
        695                             if(tem pAnchor&&t empAnchor. length>0)
        696                                      for(var  u=0;u<temp Anchor.len gth;u++)
        697                                               aAnchor[aA nchor.leng th]=tempAn chor[u];
        698                    }
        699           }
        700           re turn aAnch or;
        701   }
        702  
        703   function g etItemsByB ook(obj)
        704   {
        705           va r aAnchor= new Array( );
        706           va r aTAnchor =getItemsF romObj(obj );
        707           fo r(var i=0; i<aTAnchor .length;i+ +)
        708                    aAnc hor[aAncho r.length]= aTAnchor[i ];
        709           va r tempBook =getChildr enByTag(ob j,"DIV");
        710           if (tempBook& &tempBook. length>0)
        711                    for( var j=0;j< tempBook.l ength;j++)
        712                    {
        713                             var aT AnchorDiv= getItemsFr omObj(temp Book[j]);
        714                             for(va r s=0;s<aT AnchorDiv. length;s++ )
        715                                      aAnchor[ aAnchor.le ngth]=aTAn chorDiv[s] ;
        716                    }
        717           re turn aAnch or;
        718   }
        719  
        720   function E xpandIt(nI d)
        721   {
        722           if (!gsTP)
        723                    Expa ndIt2(nId, false);
        724   }
        725  
        726   function E xpandIt2(n Id,bForceO pen)
        727   {
        728           va r oC=TocEx pand(nId,t rue,bForce Open);
        729           va r nNewScro ll=documen t.body.scr ollTop;
        730           if (oC.style. display==" block"){
        731                    var  nTop=oC.of fsetTop;
        732                    var  nBottom=nT op+oC.offs etHeight;
        733                    if(d ocument.bo dy.scrollT op+getClie ntHeight() <nBottom){
        734                             nNewSc roll=nBott om-getClie ntHeight() ;
        735                    }
        736                    if(n Bottom-nTo p>getClien tHeight()) {
        737                             nNewSc roll=nTop- 20;
        738                    }
        739           }
        740           do cument.bod y.scrollTo p=nNewScro ll;
        741   }
        742  
        743   function T ocExpand(n Id,bChange Img,bForce Open)
        744   {
        745           va r oDiv=get Element(ge tCBId(nId) );
        746           if (oDiv==nul l) return  null;
        747  
        748           va r whichIm= document.i mages[getB Id(nId)];
        749           if ((oDiv.sty le.display !="block") ||bForceOp en){
        750                    oDiv .style.dis play="bloc k";
        751                    if(b ChangeImg) {
        752                             var sP ath=getPat h(whichIm. src);
        753                             sPath= _getFullPa th(sPath,g etBookImag e(nId,fals e));
        754                             whichI m.src=sPat h;               
        755                    }
        756           }e lse{
        757                    oDiv .style.dis play="none ";
        758                    if(b ChangeImg) {
        759                             var sP ath=getPat h(whichIm. src);
        760                             sPath= _getFullPa th(sPath,g etBookImag e(nId,true ));
        761                             whichI m.src=sPat h;
        762                    }
        763                    if(g bMac&&gbIE 5){
        764                             this.p arent.docu ment.getEl ementById( "tocIFrame ").style.w idth="101% ";
        765                             this.p arent.docu ment.getEl ementById( "tocIFrame ").style.w idth="100% ";
        766                    }
        767           }
        768           re turn oDiv;
        769   }
        770  
        771   function g etChunkId( n)
        772   {
        773           va r nCan=-1;
        774           fo r(var i=0; i<gaTocs.l ength;i++)
        775                    if(g aTocs[i].n MI<=n&&gaT ocs[i].nMI !=-1)
        776                    {
        777                             if(nCa n==-1)
        778                                      nCan=i;
        779                             else
        780                                      if(gaToc s[i].nMI>= gaTocs[nCa n].nMI)
        781                                               nCan=i;
        782                    }
        783           if (nCan!=-1)
        784                    retu rn nCan;
        785           el se
        786                    retu rn -1;
        787   }
        788  
        789   function g etChunk(n)
        790   {
        791           if (gnCC!=-1& &gaTocs[gn CC].nMI<=n &&(gnCC==g aTocs.leng th-1||
        792                    gaTo cs[gnCC+1] .nMI>n))
        793           {        
        794                    retu rn gaTocs[ gnCC];
        795           }
        796           el se{
        797                    gnCC =getChunkI d(n);
        798                    if(g nCC!=-1)
        799                             return  gaTocs[gn CC];
        800                    else
        801                             return  null;
        802           }
        803   }
        804  
        805   function g etBookImag e(nIdx,bCl osed)
        806   {
        807           va r nIdx=bCl osed?0:1;
        808           va r sIcon=ge tItemIcon( nIdx,nIdx) ;
        809           if (sIcon=="" )
        810                    if(b Closed)
        811                             sIcon= giBookClos e;
        812                    else
        813                             sIcon= giBookOpen ;
        814           re turn _getF ullPath(ga Proj[0].sP Path,sIcon );
        815   }
        816  
        817   function g etItemImag e(nIdx,bRe mote)
        818   {
        819           va r sIcon=ge tItemIcon( nIdx,0);
        820           if (sIcon=="" )
        821                    if(b Remote)
        822                             sIcon= giURLItem;
        823                    else
        824                             sIcon= giBookItem ;
        825           re turn _getF ullPath(ga Proj[0].sP Path,sIcon );
        826   }
        827  
        828   function g etInnerTex t2(obj)
        829   {
        830           va r sText=ge tInnerText (obj);
        831           if (sText.len gth>0&&!gb Opera7)
        832                    sTex t=sText.su bstring(1) ;
        833           re turn sText ;
        834   }
        835  
        836   function e xpandToc(o Obj,sRest, aIdList)
        837   {
        838           va r len=aIdL ist.length ;
        839           va r nPos=sRe st.indexOf (gsPathSpl it);
        840           if (nPos!=-1)
        841           {
        842                    sPar t=sRest.su bstring(0, nPos);
        843                    sRes t=sRest.su bstring(nP os+1);
        844           }
        845           el se
        846           {
        847                    sPar t=sRest;
        848                    var  aTagAs=get ItemsByBoo k(oObj);
        849                    for( var s=0;s< aTagAs.len gth;s++)
        850                    {
        851                             var sT ext=getInn erText2(aT agAs[s]);
        852                             if(sTe xt==sPart)
        853                             {
        854                                      aIdList[ len]=aTagA s[s];
        855                                      return 1 ;
        856                             }
        857                    }
        858                    retu rn 0;
        859           }
        860                    
        861           va r aChildre n=getChild renByTag(o Obj,"DIV") ;
        862           fo r(var i=0; i<aChildre n.length;i ++)
        863           {
        864                    var  sPId=aChil dren[i].id ;
        865                    if(! isPBId(sPI d))
        866                             contin ue;
        867                    var  sText=getI nnerText2( aChildren[ i]);
        868                    sTex t = sText. replace("\ n", "");
        869                    if(s Text!=sPar t)
        870                             contin ue;
        871                    aIdL ist[len]=g etIdByPBId (sPId);
        872                    var  sCId=getCB Id(aIdList [len]);
        873                    var  oCObj=getE lement(sCI d);
        874                    if(o CObj)
        875                    {
        876                             if(oCO bj.innerHT ML=="")
        877                             {
        878                                      var obj= getItemsBy Book(aChil dren[i]);
        879                                      if(obj.l ength>0)
        880                                      {
        881                                               if(gbNav6  || gbSafar i3)
        882                                               {
        883                                                   if(gbN av6 )
        884                                                   {
        885                                                            var sCom mand=obj[0 ].getAttri bute("onCl ick");
        886                                                            var nCom mand=sComm and.indexO f(";");
        887                                                            sCommand =sCommand. substring( 0,nCommand );
        888                                                   }
        889                                                   else i f(gbSafari 3)
        890                                                   {
        891                                                            var sCom mand=obj[0 ].getAttri bute("onCl ick");
        892                                                            var nCom mand1=sCom mand.index Of(";");
        893                                                            var nCom mand2=sCom mand.index Of(";", nC ommand1+1) ;
        894                                                            sCommand =sCommand. substring( nCommand1+ 1, nComman d2);
        895                                                   }
        896                                                   var in dx1 = sCom mand.index Of("(");
        897                                                       va r indx2 =  sCommand.i ndexOf("," , indx1);
        898                                                       va r arg1 = s Command.su bstring(in dx1+1, ind x2);
        899                                                       in dx1 = indx 2;
        900                                                       in dx2 = sCom mand.index Of(")", in dx1);
        901                                                       va r arg2 = s Command.su bstring(in dx1+1, ind x2);
        902                                                       n1  = parseIn t(arg1);
        903                                                       n2  = parseIn t(arg2);
        904                                                       in sertBookIt ems(n1, n2 );
        905                                               }
        906                                               else
        907                                                       ob j[0].click ();
        908                                      }
        909                                      return - 1;
        910                             }
        911                             var nR et=expandT oc(oCObj,s Rest,aIdLi st);
        912                             if(nRe t)
        913                                      return n Ret;
        914                    }
        915           }
        916           aI dList.leng th=len;
        917           re turn 0;
        918   }
        919  
        920   function g etIdByPBId (sPId)
        921   {
        922           re turn parse Int(sPId.s ubstring(2 ,sPId.leng th-1));
        923   }
        924  
        925   function g etIdByCBId (sCId)
        926   {
        927           re turn parse Int(sCId.s ubstring(2 ,sCId.leng th-1));
        928   }
        929  
        930   function i sPBId(sId)
        931   {
        932           re turn (sId& &sId.index Of("B_")== 0&&sId.las tIndexOf(" P")==sId.l ength-1);
        933   }
        934  
        935   function i sCBId(sId)
        936   {
        937           re turn (sId& &sId.index Of("B_")== 0&&sId.las tIndexOf(" C")==sId.l ength-1);
        938   }
        939  
        940   function g etBId(nIdx )
        941   {
        942           re turn "B_"+ nIdx;
        943   }
        944  
        945   function g etPBId(nId x)
        946   {
        947           re turn getBI d(nIdx)+"P ";
        948   }
        949  
        950   function g etCBId(nId x)
        951   {
        952           re turn getBI d(nIdx)+"C ";
        953   }
        954  
        955   function g etClosestT ocPath(aPa ths)
        956   {
        957           va r nMaxSimi larity=0;
        958           va r nThatInd ex=-1;
        959           va r sPath=nu ll;
        960           if (aPaths.le ngth==0) r eturn sPat h;
        961           fo r(var i=0; i<aPaths.l ength;i++)
        962           {
        963                    var  nSimilarit y=compareP ath(gsCTPa th,aPaths[ i]);
        964                    if(n Similarity >nMaxSimil arity)
        965                    {
        966                             nMaxSi milarity=n Similarity ;
        967                             nThatI ndex=i;
        968                    }
        969           }
        970           if (nThatInde x!=-1)
        971                    sPat h=aPaths[n ThatIndex] ;
        972           el se
        973                    sPat h=aPaths[0 ];
        974           re turn sPath ;
        975   }
        976  
        977   function c omparePath (sPath1,sP ath2)
        978   {
        979           va r nMaxSimi larity=0;
        980           va r nStartPo s1=0;
        981           va r nPos1=-1 ;
        982           va r nStartPo s2=0;
        983           va r nPos2=-1 ;
        984           do {
        985                    var  sCheck1=nu ll;
        986                    var  sCheck2=nu ll;
        987                    nPos 1=sPath1.i ndexOf(gsP athSplit,n StartPos1) ;
        988                    if(n Pos1!=-1)
        989                    {
        990                             sCheck 1=sPath1.s ubstring(n StartPos1, nPos1);
        991                             nStart Pos1=nPos1 +1;
        992                    }
        993                    else
        994                    {
        995                             sCheck 1=sPath1.s ubstring(n StartPos1) ;
        996                             nStart Pos1=-1;
        997                    }
        998                    nPos 2=sPath2.i ndexOf(gsP athSplit,n StartPos2) ;
        999                    if(n Pos1!=-1)
        1000                    {
        1001                             sCheck 2=sPath2.s ubstring(n StartPos2, nPos2);
        1002                             nStart Pos2=nPos2 +1;
        1003                    }
        1004                    else
        1005                    {
        1006                             sCheck 2=sPath2.s ubstring(n StartPos2) ;
        1007                             nStart Pos2=-1;
        1008                    }
        1009                    if(s Check1==sC heck2)
        1010                             nMaxSi milarity++ ;
        1011                    else
        1012                             break;
        1013           }w hile(nStar tPos1!=-1& &nStartPos 2!=-1);
        1014           re turn nMaxS imilarity;
        1015   }
        1016  
        1017   function g etTocPaths (oTopicPar am)
        1018   {
        1019           va r aRelTocP aths=oTopi cParam.aPa ths;
        1020           va r aPaths=n ew Array() ;
        1021           fo r(var i=0; i<gaProj.l ength;i++)
        1022                    if(i sSamePath( gaProj[i]. sPPath,oTo picParam.s PPath))
        1023                    {
        1024                             for(va r j=0;j<aR elTocPaths .length;j+ +)
        1025                                      for (var  k=0;k<gaR oot[i].aRP ath.length ;k++)
        1026                                      {
        1027                                               var sPath= gaRoot[i]. aRPath[k]+ aRelTocPat hs[j];
        1028                                               aPaths[aPa ths.length ]=sPath.su bstring(1) ;
        1029                                      }
        1030                             break;
        1031                    }
        1032           re turn aPath s;
        1033   }
        1034  
        1035   function s yncInit()
        1036   {
        1037           if (gsTP&&!gb NeedFillSt ub)
        1038           {
        1039                    gInS ync=true;
        1040                    var  obj=docume nt.body;
        1041                    var  aIdList=ne w Array();
        1042                    var  nRet=expan dToc(obj,g sTP,aIdLis t);
        1043                    if(n Ret!=-1)
        1044                    {
        1045                             if(nRe t==1)
        1046                             {
        1047                                      if(aIdLi st.length)
        1048                                               for(var i= 0;i<aIdLis t.length-1 ;i++)
        1049                                                       Ex pandIt2(aI dList[i],t rue);
        1050                                      gsCTPath =gsTP;
        1051                                      HighLigh tElement(a IdList[aId List.lengt h-1],gsABg Color,"tra nsparent") ;
        1052                                      aIdList[ aIdList.le ngth-1].fo cus();
        1053                                      gsTP=nul l;
        1054                             }
        1055                             if(gaB TPs!=""&&g aBTPs!=nul l)
        1056                             {
        1057                                      var aPat hs=gaBTPs;
        1058                                      gsTP=nul l;
        1059                                      gaBTPs=n ull;
        1060                                      if(aPath s!=null)
        1061                                      {
        1062                                               var sPath= getClosest TocPath(aP aths);
        1063                                               if(sPath!= null)
        1064                                               {       
        1065                                                       gs TP=sPath;               
        1066                                                       se tTimeout(" syncInit() ",1);
        1067                                               }
        1068                                      }
        1069                             }
        1070                    }
        1071                    gInS ync=false;
        1072           }
        1073   }
        1074  
        1075   function o nGetProjIn fo(oMsg) {
        1076       if (oM sg && oMsg .oParam) {
        1077           gb LoadToc =  true;
        1078           va r oProj =  oMsg.oPara m;
        1079           ga Proj = oPr oj.aProj;
        1080           gb XML = oPro j.bXML;
        1081           lo ad1B1();
        1082       }
        1083   }
        1084  
        1085   function l oadToc()
        1086   {
        1087           if (!gbLoadTo c)
        1088           {
        1089                var oRes Msg = new  whMessage( WH_MSG_GET PROJINFO,  null, null );
        1090                request( oResMsg, o nGetProjIn fo);
        1091           }
        1092   }
        1093  
        1094   function l oad1B1()
        1095   {
        1096           if (gnLT+1<ga Proj.lengt h)
        1097                    for( var i=gnLT +1;i<gaPro j.length;i ++)
        1098                             if(gaP roj[i].sTo c)
        1099                             {
        1100                                      gbToc=tr ue;
        1101                                      gnLT=i;
        1102                                      setTimeo ut("loadTo cInfo()",1 );
        1103                                      return t rue;
        1104                             }
        1105           re turn false ;
        1106   }
        1107  
        1108   function l oadTocInfo ()
        1109   {
        1110           lo adData2(ga Proj[gnLT] .sPPath+ga Proj[gnLT] .sDPath+ga Proj[gnLT] .sToc);
        1111   }
        1112  
        1113   function l oadData2(s File)
        1114   {
        1115           if (gbXML)
        1116                    load DataXML(sF ile);
        1117           el se
        1118                    load Data(sFile );
        1119   }
        1120  
        1121   function p rojReady(s Root,aProj )
        1122   {
        1123           if (gaRoot.le ngth<=gnLT ||!gaRoot[ gnLT])
        1124                    gaRo ot[gnLT]=n ew Object( );
        1125           ga Root[gnLT] .sToc=sRoo t;
        1126           
        1127           if (gnLT==0)
        1128           {
        1129                    gaRo ot[gnLT].a RPath=new  Array();
        1130                    gaRo ot[gnLT].a RPath[0]=g sPathSplit ;
        1131           }
        1132  
        1133           up datePTPath (gnLT,aPro j);
        1134  
        1135           if (!((gnLT+1 <gaProj.le ngth)&&loa d1B1()))
        1136           {
        1137                    gbRe ady=true;
        1138                    if(g bIE4)
        1139                             setTim eout("load Images();" ,1);
        1140                    else
        1141                             setTim eout("load TData();", 1);
        1142           }
        1143   }
        1144  
        1145   function l oadTData()
        1146   {
        1147           if (gaProj[0] .sToc!="")
        1148           {
        1149                    gbLD ata=true;
        1150                    goCh unk=addToc Chunk(gaPr oj[0].sPPa th,gaProj[ 0].sDPath) ;
        1151                    gbTo c=false;
        1152                    load Data2(gaPr oj[0].sPPa th+gaProj[ 0].sDPath+ gaRoot[0]. sToc);
        1153           }
        1154   }
        1155  
        1156   function u pdatePTPat h(n,aProj)
        1157   {
        1158           if (aProj)
        1159                    for( var i=0;i< aProj.leng th;i++)
        1160                    {
        1161                             var sF ullPath=_g etFullPath (gaProj[n] .sPPath,aP roj[i].sPP ath);
        1162                             for(va r j=0;j<ga Proj.lengt h;j++)
        1163                                      if(isSam ePath(sFul lPath,gaPr oj[j].sPPa th))
        1164                                      {
        1165                                               if(gaRoot. length<=j| |!gaRoot[j ])
        1166                                                       ga Root[j]=ne w Object() ;
        1167                                               if(!gaRoot [j].aRPath )
        1168                                                       ga Root[j].aR Path=new A rray();
        1169  
        1170                                               if(gaRoot[ n].aRPath)
        1171                                                       fo r(var k=0; k<gaRoot[n ].aRPath.l ength;k++)
        1172                                                       {
        1173                                                                var  bDup=false ;
        1174                                                                var  sTFPath=ga Root[n].aR Path[k]+aP roj[i].sRP ath;
        1175                                                                for( var l=0;l< gaRoot[j]. aRPath.len gth;l++)
        1176                                                                         if(gaR oot[j].aRP ath[l]==sT FPath)
        1177                                                                         {
        1178                                                                                  bDup=tru e;
        1179                                                                                  break;
        1180                                                                         }
        1181                                                                if(! bDup)
        1182                                                                         gaRoot [j].aRPath [gaRoot[j] .aRPath.le ngth]=sTFP ath;
        1183                                                       }
        1184                                               else
        1185                                                       ga Root[j].aR Path[gaRoo t[j].aRPat h.length]= aProj[i].s RPath;
        1186                                               break;
        1187                                      }
        1188                    }
        1189   }
        1190  
        1191   function o nLoadXMLEr ror()
        1192   {
        1193           if (gbToc)
        1194           {
        1195                    var  sRoot="";
        1196                    var  aRProj=new  Array();
        1197                    proj Ready(sRoo t,aRProj);
        1198           }
        1199           el se
        1200           {
        1201                    var  aToc=new A rray();
        1202                    putD ata(aToc)
        1203           }
        1204   }
        1205  
        1206   function p utDataXML( xmlDoc,sDo cPath)
        1207   {
        1208           if (gbToc)
        1209           {
        1210                    var  tocNode=xm lDoc.getEl ementsByTa gName("toc ")[0];
        1211                    if(t ocNode)
        1212                    {
        1213                             var sR oot=tocNod e.getAttri bute("root ");
        1214                             var rm tProject=t ocNode.get ElementsBy TagName("p roject");
        1215                             var aR Proj=new A rray();
        1216                             if(rmt Project.le ngth>0)
        1217                             {
        1218                                      for(var  i=0;i<rmtP roject.len gth;i++)
        1219                                      {
        1220                                               aRProj[i]= new Object ();
        1221                                               var sURL=r mtProject[ i].getAttr ibute("url ");
        1222                                               if(sURL)
        1223                                               {
        1224                                                       if (sURL.last IndexOf("/ ")!=sURL.l ength-1)
        1225                                                                sURL +="/";                                                   
        1226                                               }
        1227                                               aRProj[i]. sPPath=sUR L;
        1228                                               aRProj[i]. sRPath = " ";
        1229                                               var oSubPa th = rmtPr oject[i].g etElements ByTagName( "subpath") [0];
        1230                                               if (oSubPa th)
        1231                                               {
        1232                                                       wh ile (oSubP ath)
        1233                                                       {
        1234                                                                aRPr oj[i].sRPa th += oSub Path.getAt tribute("n ame") + "\ n";
        1235                                                                oSub Path = oSu bPath.getE lementsByT agName("su bpath")[0] ;
        1236                                                       }
        1237                                               }
        1238                                               else
        1239                                                       aR Proj[i].sR Path=rmtPr oject[i].g etAttribut e("path");
        1240                                      }
        1241                             }
        1242                             projRe ady(sRoot, aRProj);
        1243                    }
        1244           }
        1245           el se
        1246           {
        1247                    var  chunkNode= xmlDoc.get ElementsBy TagName("t ocdata")[0 ];
        1248                    if(c hunkNode)
        1249                    {
        1250                             var aT oc=new Arr ay();
        1251                             proces sBook(chun kNode,aToc );
        1252                             putDat a(aToc);
        1253                    }
        1254           }
        1255   }
        1256  
        1257   function p rocessBook (node,aToc )
        1258   {
        1259           va r i=0;
        1260           va r entry=nu ll;
        1261           va r prevEntr y=null;
        1262           va r oChild=n ode.firstC hild;
        1263           do {
        1264                    if(o Child)
        1265                    {
        1266                             if(oCh ild.nodeNa me.indexOf ("#")!=0)
        1267                             {
        1268                                      var sNam e=oChild.g etAttribut e("name");
        1269                                      var sURL =oChild.ge tAttribute ("url");
        1270                                      var sRef =oChild.ge tAttribute ("ref");
        1271                                      var sTar get=oChild .getAttrib ute("targe t");
        1272                                      var sIco ns=oChild. getAttribu te("images ");
        1273                                      var item =new Objec t();
        1274                                      item.sIt emName=sNa me;
        1275                                      if(sTarg et)
        1276                                               item.sTarg et=sTarget ;
        1277                                      if(sIcon s)
        1278                                               item.sIcon Ref=sIcons ;
        1279                                      if(sURL= =null) sUR L="";
        1280  
        1281                                      item.sIt emURL=sURL ;
        1282                                      
        1283                                      if(oChil d.nodeName =="book")
        1284                                      {
        1285                                               item.nType =1;
        1286                                               aToc[aToc. length]=it em;
        1287                                               var nCurrP os=aToc.le ngth;
        1288                                               processBoo k(oChild,a Toc);
        1289                                               item.nCont ents=aToc. length-nCu rrPos;
        1290                                      }
        1291                                      else if( oChild.nod eName=="it em")
        1292                                      {
        1293                                               item.nType =2;
        1294                                               item.nCont ents=0;
        1295                                               aToc[aToc. length]=it em;
        1296                                      }
        1297                                      else if( oChild.nod eName=="re moteitem")
        1298                                      {
        1299                                               item.nType =16;
        1300                                               item.nCont ents=0;
        1301                                               aToc[aToc. length]=it em;
        1302                                      }
        1303                                      else if( oChild.nod eName=="pr oject")
        1304                                      {
        1305                                               if(sRef)
        1306                                               {
        1307                                                       if (sRef.last IndexOf("/ ")!=sRef.l ength-1)
        1308                                                                sRef +="/";                                                   
        1309                                               }
        1310                                               item.nType =4;
        1311                                               item.sRefU RL=sRef;
        1312                                               item.nCont ents=0;
        1313                                               aToc[aToc. length]=it em;
        1314                                      }
        1315                                      else if( oChild.nod eName=="ch unk")
        1316                                      {
        1317                                               item.nType =8;
        1318                                               item.sRefU RL=sRef;
        1319                                               item.nCont ents=0;
        1320                                               aToc[aToc. length]=it em;
        1321                                      }
        1322                             }
        1323                    }
        1324                    else
        1325                             break;
        1326                    oChi ld=oChild. nextSiblin g;
        1327           }w hile(true) ;
        1328   }
        1329  
        1330   function p utData(aTo cs)
        1331   {
        1332           ga TocsNs61Fi x=aTocs;
        1333           se tTimeout(" realPutDat a();",1);
        1334   }
        1335  
        1336   function o nGetTocPat hs(oMsg) {
        1337       if (oM sg && oMsg .oParam) {
        1338           if  (oMsg.oPa ram.oTocIn fo)
        1339                syncWith Paths(oMsg .oParam.oT ocInfo);
        1340       }
        1341   }
        1342  
        1343   function r ealPutData ()
        1344   {
        1345           re moveLoadin gDiv();
        1346           va r aTocs=ga TocsNs61Fi x;
        1347           if (!aTocs) r eturn;
        1348           if (goChunk)
        1349           {
        1350                    var  n=gnMinIdx ;
        1351                    goCh unk.nMI=gn MinIdx;
        1352                    goCh unk.aTocs= aTocs;
        1353                    gnMi nIdx+=aToc s.length;
        1354                    if(g nInsIdx!=- 1)
        1355                    {
        1356                             var oO bj=getElem ent(getPBI d(gnInsIdx ));
        1357                             if(oOb j)
        1358                             {
        1359                                      oObj.ins ertAdjacen tHTML("aft erEnd",wri teBookItem s(n-1,aToc s.length)) ;
        1360                                      setTimeo ut("syncIn it()",1);
        1361                             }
        1362                    }
        1363                    else {
        1364                             docume nt.body.in sertAdjace ntHTML("be foreEnd",w riteBookIt ems(n-1,aT ocs.length ));
        1365                             var oP aram=new O bject();
        1366                             oParam .oTocInfo= null;
        1367                             var oM sg=new whM essage(WH_ MSG_GETTOC PATHS,null , oParam);
        1368                             reques t(oMsg, on GetTocPath s);
        1369                    }        
        1370           }
        1371           gb LData=fals e;
        1372           ch eckFillStu b();
        1373   }
        1374  
        1375   function s yncWithPat hs(oTopicP aram)
        1376   {
        1377           va r aPaths=g etTocPaths (oTopicPar am);
        1378           if (gsTP)
        1379                    gaBT Ps=aPaths;
        1380           el se{
        1381                    var  sPath=getC losestTocP ath(aPaths );
        1382                    if(s Path!=null )
        1383                    {
        1384                             gsTP=s Path;
        1385                             setTim eout("sync Init()",1) ;
        1386                    }
        1387           }
        1388   }
        1389  
        1390   function w indow_OnLo ad()
        1391   {
        1392           if (gsBgImage &&gsBgImag e.length>0 )
        1393           {
        1394                    docu ment.body. background =gsBgImage ;
        1395           }
        1396           if (gsBgColor &&gsBgColo r.length>0 )
        1397           {
        1398                    docu ment.body. bgColor=gs BgColor;
        1399           }
        1400           lo adToc();
        1401           // commenting  this out  as it is c reating pr oblem in I E10 and se ems redund ant
        1402           /* var oMsg=n ew whMessa ge(WH_MSG_ SHOWTOC,nu ll,null)
        1403           no tify(oMsg) ;*/
        1404   }
        1405  
        1406   function l oadImages( )
        1407   {
        1408           if (giBookClo se)
        1409           {
        1410                    gaIm gs[gnImage s]=giBookC lose;
        1411                    gnIm ages++;
        1412           }                 
        1413           if (giBookOpe n)
        1414           {
        1415                    gaIm gs[gnImage s]=giBookO pen;
        1416                    gnIm ages++;
        1417           }                 
        1418           if (giBookIte m)
        1419           {
        1420                    gaIm gs[gnImage s]=giBookI tem;
        1421                    gnIm ages++;
        1422           }                 
        1423           if (giURLItem )
        1424           {
        1425                    gaIm gs[gnImage s]=giURLIt em;
        1426                    gnIm ages++;
        1427           }                 
        1428           if (giNewBook Close)
        1429           {
        1430                    gaIm gs[gnImage s]=giNewBo okClose;
        1431                    gnIm ages++;
        1432           }                 
        1433           if (giNewBook Open)
        1434           {
        1435                    gaIm gs[gnImage s]=giNewBo okOpen;
        1436                    gnIm ages++;
        1437           }                 
        1438           if (giNewBook Item)
        1439           {
        1440                    gaIm gs[gnImage s]=giNewBo okItem;
        1441                    gnIm ages++;
        1442           }                 
        1443           if (giNewURLI tem)
        1444           {
        1445                    gaIm gs[gnImage s]=giNewUR LItem;
        1446                    gnIm ages++;
        1447           }
        1448           if (gnImages> 0)
        1449           {
        1450                    setT imeout("lo adDataAfte r();",1000 );
        1451                    load Image(gaIm gs[0]);
        1452           }
        1453           el se
        1454                    load DataAfter( );
        1455   }
        1456  
        1457   function l oadImage(s URL)
        1458   {
        1459           va r oImg=new  Image();
        1460           oI mg.onload= checkImage Loading;
        1461           oI mg.onerror =errorImag eLoading;
        1462           oI mg.src=_ge tFullPath( gaProj[0]. sPPath,sUR L);
        1463   }
        1464  
        1465   function l oadDataAft er()
        1466   {
        1467           if (!gbLoadDa ta)
        1468           {
        1469                    gbLo adData=tru e;
        1470                    load TData();
        1471           }
        1472   }
        1473  
        1474   function e rrorImageL oading()
        1475   {
        1476           gn LoadedImag es++;
        1477           if (gnImages= =gnLoadedI mages)
        1478                    load DataAfter( );
        1479           el se
        1480                    load Image(gaIm gs[gnLoade dImages]);       
        1481   }
        1482  
        1483   function c heckImageL oading()
        1484   {
        1485           gn LoadedImag es++;
        1486           if (gnImages= =gnLoadedI mages)
        1487                    load DataAfter( );
        1488           el se
        1489                    load Image(gaIm gs[gnLoade dImages]);       
        1490   }
        1491  
        1492   function w indow_unlo ad()
        1493   {
        1494           un registerLi stener2(WH _MSG_PROJE CTREADY);
        1495           un registerLi stener2(WH _MSG_SYNCT OC);
        1496           un registerLi stener2(WH _MSG_SHOWT OC);
        1497   }
        1498  
        1499   function o nReceiveNo tification (oMsg)
        1500   {
        1501           if (oMsg)
        1502           {
        1503                    var  nMsgId=oMs g.msgId;
        1504                    if(n MsgId==WH_ MSG_PROJEC TREADY)
        1505                    {
        1506                             loadTo c();
        1507                    }
        1508                    else  if(nMsgId ==WH_MSG_S YNCTOC)
        1509                    {
        1510                             if(gbR eady)
        1511                             {
        1512                                      syncWith Paths(oMsg .iParam);
        1513                             }
        1514                    }
        1515                    else  if(nMsgId ==WH_MSG_S HOWTOC)
        1516                    {
        1517                             if(!gb Nav6)
        1518                                      document .body.focu s();
        1519                    }
        1520           }
        1521           re turn true;
        1522   }
        1523  
        1524   if(window. gbWhUtil&& window.gbW hVer&&wind ow.gbWhMsg &&window.g bWhProxy)
        1525   {
        1526           re gisterList ener2(WH_M SG_PROJECT READY);
        1527           re gisterList ener2(WH_M SG_SYNCTOC );
        1528           re gisterList ener2(WH_M SG_SHOWTOC );
        1529           go Font=new w hFont("Ver dana","8pt ","#000000 ","normal" ,"normal", "none");
        1530           go HFont=new  whFont("Ve rdana","8p t","#007f0 0","normal ","normal" ,"underlin e");
        1531  
        1532           wi ndow.onloa d=window_O nLoad;
        1533           wi ndow.onbef oreunload= window_BUn load;
        1534           wi ndow.onunl oad=window _unload;
        1535           gb WhTHost=tr ue;
        1536   }
        1537   else
        1538           do cument.loc ation.relo ad();