4646. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/2/2018 12:00:24 PM 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.

4646.1 Files compared

# Location File Last Modified
1 Tue Jan 2 17:00:24 2018 UTC
2 HTRE_P2.zip\src.zip\output\ihta_admin.zip\ihta.zip whthost.js Fri Mar 24 20:39:28 2017 UTC

4646.2 Comparison summary

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

4646.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

4646.4 Active regular expressions

No regular expressions were active.

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