3482. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/2/2018 11:59:18 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.

3482.1 Files compared

# Location File Last Modified
1 Tue Jan 2 16:59:18 2018 UTC
2 HTRE_P2.zip\src.zip\output\IHTA OLH Files.zip\qir.zip whtopic.js Fri Sep 16 17:20:20 2016 UTC

3482.2 Comparison summary

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

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

3482.4 Active regular expressions

No regular expressions were active.

3482.5 Comparison detail

        1   //      We bHelp 5.10 .005
        2   var gsPPat h="";
        3   var gaPath s=new Arra y();
        4   var gaAven ues=new Ar ray();
        5   var gaSear chTerms =  new Array( );
        6  
        7   var goFram e=null;
        8   var gsStar tPage="";
        9   var gsRelC urPagePath ="";
        10   var gsSear chFormHref ="";
        11   var gnTopi cOnly=-1;
        12   var gnOutm ostTopic=- 1;
        13   var gsHili teSearchSe tting = "d isable,#b2 b4bf,black ";
        14   var g_Rune sVowels="\ u0061\u006 5\u0069\u0 06F\u0075\ u0079";
        15   var g_Rune sWordBreak s="\u0001\ u0002\u000 3\u0004\u0 005\u0006\ u0007\u000 8\u0009\u0 00A\u000B\ u000C\u000 D\u000E\u0 00F\u0010\ u0011\u001 2\u0013\u0 014\u0015\ u0016\u001 7\u0018\u0 019\u001A\ u001B\u001 C\u001D\u0 01E\u001F\ u0022\u005 C\u0020\u0 02E\u002C\ u0021\u004 0\u0023\u0 024\u0025\ u005E\u002 6\u002A\u0 028\u0029\ u007E\u002 7\u0060\u0 03A\u003B\ u003C\u003 E\u003F\u0 02F\u007B\ u007D\u005 B\u005D\u0 07C\u002B\ u002D\u003 D\u0081\u0 082\u0083\ u0084\u008 5\u0086\u0 087\u0088\ u0089\u008 A\u008B\u0 08C\u008D\ u008E\u008 F\u0090\u0 091\u0092\ u0093\u009 4\u0095\u0 096\u0097\ u0098\u009 9\u009A\u0 09B\u009C\ u009D\u009 E\u009F\u0 0A1\u00A9\ u00AB\u00A E\u00B7\u0 0BB\u00BF\ u00A0\u200 0\u2001\u2 002\u2003\ u2004\u200 5\u2006\u2 007\u2008\ u2009\u200 A\u2028\u2 029\u202F\ u205F\u300 0";
        16   var g_Rune sWhiteSpac es="\u0020 \u0009\u00 0D\u000A\u 00A0\u2000 \u2001\u20 02\u2003\u 2004\u2005 \u2006\u20 07\u2008\u 2009\u200A \u2028\u20 29\u202F\u 205F\u3000 ";
        17   var g_Rune sSpecialBr eaks = ",! @#$%^&*()~ '`:;<>?/{} []|+-=" ;
        18   var g_Rune sQuote='\x 22';
        19   var g_Rune sHelSuffix es=new Arr ay("ed,0", "ingly,0", "ings,0"," ing,0","ly ,1","s,1", "e,1");
        20   var gsBkgn dColor="";
        21   var gsText Color="";
        22   var BTN_TE XT=1;
        23   var BTN_IM G=2;
        24  
        25   var goSync =null;
        26  
        27   var goShow =null;
        28   var goHide =null;
        29  
        30   var goPrev =null;
        31   var goNext =null;
        32   var gnForm =0;
        33   var goShow Nav=null;
        34   var goHide Nav=null;
        35  
        36   var goWebS earch=null ;
        37  
        38   var gsBtnS tyle="";
        39   var gaButt ons=new Ar ray();
        40   var gaType s=new Arra y();
        41   var whtopi c_foldUnlo ad=null;
        42   var gbWhTo pic=false;
        43   var gbSync Enabled=fa lse;
        44   var gBCId  = 0;
        45   var gnYPos  = -1;
        46   var gbBadU riError =  false;
        47   var gFrame Id = null;
        48  
        49   var gBread CrumbInfo  = new Arra y;
        50  
        51   function B readCrumbI nfo(relHom ePage, sty leInfo, se parator, s trHome, st rHomePath)  {
        52       this.r elHomePage  = relHome Page;
        53       this.s tyleInfo =  styleInfo ;
        54       this.s eparator =  separator ;
        55       this.s trHome = s trHome;
        56       this.s trHomePath  = strHome Path;
        57       this.b cLinks = [ ];
        58   }
        59  
        60   function A ddMasterBr eadcrumbs( relHomePag e, styleIn fo, separa tor, strHo me, strHom ePath) {
        61       docume nt.write(" <span id=\ "brseq" +  gBCId + "\ " ></span> ");
        62       gBread CrumbInfo[ gBCId] = n ew BreadCr umbInfo(re lHomePage,  styleInfo , separato r, strHome , strHomeP ath);
        63       gBCId+ +;
        64   }
        65  
        66   function U pdateBread CrumbsMark er() {  
        67           if (gBreadCru mbInfo.len gth > 0)
        68           {
        69                    var  bcInfo = g BreadCrumb Info[0];
        70                    var  sCurTopicP ath = _get Path(docum ent.locati on.href);
        71                    var  sHomePath  = _getFull Path(sCurT opicPath,  bcInfo.rel HomePage);
        72                    var  sHomeFolde r = _getPa th(sHomePa th);
        73                    var  sMasterDat aPath = _g etFullPath (sHomeFold er, "Maste rData.xml" );
        74                    GetM asterBread crumbs(sMa sterDataPa th);
        75           }
        76   }
        77  
        78   function G etMasterBr eadcrumbs( sMasterDat aPath) {
        79       //dont  read if n ot part of  merged pr ojects
        80           if (sMasterDa taPath.ind exOf("/mer gedProject s/") == -1  &&
        81                             sMaste rDataPath. indexOf("\ \mergedPro jects\\")  == -1)
        82       {
        83                writeBre adCrumbs() ;
        84                             return ;
        85       }
        86  
        87       var sC urrentDocP ath = _get Path(docum ent.locati on.href);
        88       var fi leName = _ getRelativ eFileName( sCurrentDo cPath, sMa sterDataPa th);
        89  
        90       xmlJsR eader.load File(fileN ame, funct ion (a_xml Doc, args)  {
        91           on LoadingMas terDataXML (a_xmlDoc,  args);
        92       }, sMa sterDataPa th);
        93   }
        94  
        95  
        96   function o nLoadingMa sterDataXM L(xmlDoc1,  sMasterDa taPath)
        97   {
        98       if(xml Doc1 == nu ll)
        99       {
        100           wr iteBreadCr umbs();
        101           re turn;
        102       }
        103       var ro ot = xmlDo c1.documen tElement;
        104           va r masterPr oj = xmlDo c1.getElem entsByTagN ame("Maste rProject") ;
        105           va r masterNa me="";
        106           va r masterRe lPath="";
        107  
        108           if (masterPro j.length >  0)
        109           {
        110                    mast erName = m asterProj[ 0].getAttr ibute("nam e");
        111                    mast erRelPath  = masterPr oj[0].getA ttribute(" url");               
        112           }
        113  
        114           va r x = xmlD oc1.getEle mentsByTag Name("item ");
        115           va r i = 0;
        116           va r strTrail  = "";
        117  
        118           fo r(i=x.leng th-1; i>=0 ; i--)
        119           {
        120                    var  bcName= x[ i].getAttr ibute("nam e");
        121                    var  path = x[i ].getAttri bute("url" );
        122  
        123                    bcNa me = bcNam e.replace( /\\\\/g, ' \\'); 
        124  
        125           va r strLink  = "";
        126           va r sMasterP ath = _get FullPath(_ getPath(sM asterDataP ath), mast erRelPath) ;
        127           if (path != " ")
        128           {
        129               strLink =  _getFullP ath(sMaste rPath, pat h); 
        130           }
        131           fo r(var j=0; j<gBCId;j+ +) 
        132           {
        133                var bcli nk = new O bject();
        134                bclink.n ame = bcNa me;
        135                bclink.s trLink = s trLink;
        136                             bclink .firstEntr y = (i==0? true:false );
        137                gBreadCr umbInfo[j] .bcLinks.p ush(bclink );
        138           }
        139           }        
        140  
        141           //  call for  master bre adcrumbs
        142           sM asterDataP ath = _get FullPath(s MasterPath , "MasterD ata.xml");
        143           Ge tMasterBre adcrumbs(s MasterData Path);
        144   }
        145  
        146   function w riteBreadC rumbs() {
        147       for(va r i=0;i<gB CId;i++) {    
        148           va r bHomeFou nd = false ;
        149           va r strTrail  = "";
        150           if (gBreadCru mbInfo[i]. bcLinks.le ngth == 0)
        151           {    
        152                    if(g BreadCrumb Info[i].st yleInfo ==  "breadcru mbs")
        153                             strTra il = "<a c lass=\""+  gBreadCrum bInfo[i].s tyleInfo +  "\"" + "  href=\"" +  gBreadCru mbInfo[i]. strHomePat h + "\">"  + gBreadCr umbInfo[i] .strHome +  "</a> " +  ((gBreadC rumbInfo[i ].strHome  == "")? "" :gBreadCru mbInfo[i]. separator)  + " ";
        154                    else
        155                         strTrail =  "<a style =\""+ gBre adCrumbInf o[i].style Info + "\" " + " href =\"" + gBr eadCrumbIn fo[i].strH omePath +  "\">" + gB readCrumbI nfo[i].str Home + "</ a> " + ((g BreadCrumb Info[i].st rHome == " ")? "":gBr eadCrumbIn fo[i].sepa rator) + "  ";
        156           }
        157           el se{
        158                var len  = gBreadCr umbInfo[i] .bcLinks.l ength;
        159                for(var  j=len-1;j> =0;j--)
        160                { 
        161                    if(g BreadCrumb Info[i].bc Links[j].f irstEntry  == true)
        162                    {
        163                             if(bHo meFound)
        164                                con tinue;
        165                             else
        166                                bHo meFound =  true;
        167                    }
        168                    if(g BreadCrumb Info[i].bc Links[j].s trLink ==  "")
        169                    {
        170                         strTrail + = gBreadCr umbInfo[i] .bcLinks[j ].name + "  " + gBrea dCrumbInfo [i].separa tor + " ";
        171                    }
        172                    else {
        173                         if(gBreadC rumbInfo[i ].styleInf o == "brea dcrumbs")
        174                                          strT rail += "< a class=\" "+ gBreadC rumbInfo[i ].styleInf o + "\"" +  " href=\" " + gBread CrumbInfo[ i].bcLinks [j].strLin k + "\">"  + gBreadCr umbInfo[i] .bcLinks[j ].name + " </a> " + g BreadCrumb Info[i].se parator +  " ";
        175                                      else
        176                                          strT rail += "< a style=\" "+ gBreadC rumbInfo[i ].styleInf o + "\"" +  " href=\" " + gBread CrumbInfo[ i].bcLinks [j].strLin k + "\">"  + gBreadCr umbInfo[i] .bcLinks[j ].name + " </a> " + g BreadCrumb Info[i].se parator +  " ";
        177                    }
        178                }
        179           }
        180           va r brselem  = document .getElemen tById("brs eq"+i);
        181           if (typeof(br selem) !=  'undefined ' && brsel em != null )
        182                brselem. innerHTML  = strTrail ;
        183           el se
        184           {
        185                //used i n air help
        186                RH_Bread CrumbDataS tringVaria ble = RH_B readCrumbD ataStringV ariable.re place(/__b rseq__/g,  strTrail);
        187                             if(gbA IR)
        188                             {
        189                                      try{
        190                                                       Up dateBreadC rumbState( );
        191                                      }catch(e ) {}    
        192                             }
        193                             else i f(gbAIRSSL )
        194                                      createFr ameInfo();
        195           }
        196       }
        197   }
        198  
        199   /////////h ighlight S earch Rout ines ///// ////
        200   function C losedRange ( a_nStart , a_nEnd )
        201   {
        202           th is.nStart  = a_nStart ;
        203           th is.nEnd =  a_nEnd;
        204   }
        205  
        206   ////////// / Dom Text  node //// ////////// /
        207   var s_strH lStart=nul l;
        208   var s_strH lEnd =null ;
        209  
        210   function D omTextNode ( a_Node,  a_nFrom )
        211   {
        212           th is.node =  a_Node;
        213           th is.nFrom =  a_nFrom;
        214           
        215           th is.aClosed Ranges = n ew Array() ;
        216  
        217           th is.getClos edRanges =  function(  a_aRanges , a_nStart  )
        218           {
        219                    var  nTo = this .nFrom + a _Node.data .length;                        
        220                    for  ( var i =  a_nStart;  i < a_aRan ges.length ; i++ )
        221                    {
        222                             if ( a _aRanges[i ].nStart < = nTo &&
        223                                       a_aRang es[i].nEnd  >= this.n From )
        224                             {
        225                                      this.aCl osedRanges [this.aClo sedRanges. length] =  new Closed Range( a_a Ranges[i]. nStart > t his.nFrom  ? a_aRange s[i].nStar t : this.n From,
        226                                                                                                                                                                                    a_aRanges [i].nEnd <  nTo ? a_a Ranges[i]. nEnd : nTo  );
        227                             }
        228                             if ( a _aRanges[i ].nEnd > n To )
        229                             {
        230                                      return i ;
        231                             }
        232                    }
        233                    retu rn i;
        234           }
        235  
        236           th is.doHighl ight = fun ction( a_a Ranges, a_ nStart )
        237           {
        238                    s_st rHlStart =  "<font st yle='color :" + gsTex tColor + " ; backgrou nd-color:"  + gsBkgnd Color + "' >";
        239                    s_st rHlEnd = " </font>";
        240  
        241                    if (  a_nStart  >= a_aRang es.length  )
        242                             return  a_nStart;
        243  
        244                    var  nEnd = thi s.getClose dRanges( a _aRanges,  a_nStart ) ;
        245                    if (  this.aClo sedRanges. length ==  0 )
        246                             return  nEnd;
        247                    var  strText =  this.node. data;
        248                    //re place newl ine, carri age return , tab char acters wit h space
        249                    strT ext = strT ext.replac e(/[\n\r\t ]/g," "); 
        250                    
        251                    var  strHTML =  "";
        252                    var  nLastStart  = 0;
        253                    for  ( var i =  0; i < thi s.aClosedR anges.leng th; i++ )
        254                    {
        255                             strHTM L += _text ToHtml_non bsp(strTex t.substrin g( nLastSt art, this. aClosedRan ges[i].nSt art - this .nFrom ));
        256                             strHTM L += s_str HlStart;
        257                             strHTM L += _text ToHtml_non bsp(strTex t.substrin g( this.aC losedRange s[i].nStar t - this.n From,
        258                                                                                             this.aCl osedRanges [i].nEnd -  this.nFro m ));
        259                             strHTM L += s_str HlEnd;
        260  
        261                             nLastS tart = thi s.aClosedR anges[i].n End - this .nFrom;
        262                    }
        263                    strH TML += _te xtToHtml_n onbsp(strT ext.substr ( nLastSta rt ));
        264                    
        265                    var  spanElemen t = docume nt.createE lement( "s pan" );
        266                    span Element.in nerHTML =  strHTML;
        267                    if ( gbIE)
        268                    {
        269                         //for IE,  when assig ning strin g to inner HTML, lead ing whites paces are  dropped
        270                         if ((strHT ML.length  >0)&&(strH TML.charAt (0) == " " ))
        271                             spanEl ement.inne rHTML = "& nbsp;" + s panElement .innerHTML  ;       
        272                    }   
        273                    
        274                    this .node.pare ntNode.rep laceChild(  spanEleme nt, this.n ode );
        275                    if(g nYPos == - 1)
        276                    {
        277                             var el emObj = sp anElement;
        278                             var cu rtop = 0;
        279                             if (el emObj.offs etParent)
        280                             {
        281                                      while (e lemObj.off setParent)
        282                                      {
        283                                               curtop +=  elemObj.of fsetTop
        284                                               elemObj =  elemObj.of fsetParent ;
        285                                      }
        286                             }
        287                             else i f (elemObj .y)
        288                                      curtop + = elemObj. y;
        289                             
        290                             gnYPos  = curtop;
        291                    }
        292                    show Highlighte dElement(s panElement );
        293                    retu rn nEnd;
        294           };
        295   }
        296  
        297   function g etDropSpot Id(dropTex tId)
        298   {
        299           va r src = nu ll; 
        300           if (!src&&dro pTextId)
        301           {
        302                    for  (var i=0;i <gPopupDat a.length;i ++)
        303                    {
        304                             if(gPo pupData[i] .popupId = = dropText Id)
        305                             {
        306                                      src=gPop upData[i]. el;
        307                                      break;
        308                             }
        309                             else i f(gPopupDa ta[i].popu pId == "#"  + dropTex tId)
        310                             {
        311                                      src=gPop upData[i]. el;
        312                                      break;
        313                             }
        314                    }
        315           }
        316           re turn src;
        317   }
        318  
        319   function s howHighlig htedElemen t(highligh tElement)  {
        320           // display a  dropdown/e xpand text  if highli ghted elem ent is ins ide it
        321           va r parent =  highlight Element.pa rentNode;
        322           wh ile( (type of parent  != 'undefi ned') && p arent != n ull )
        323           {
        324                    var  tagname =  parent.tag Name.toLow erCase();
        325                    if(  tagname ==  'body')
        326                             break;
        327                    if(  (tagname = = "div" &&  parent.cl assName ==  "droptext "))
        328                    {
        329                             if(par ent.style. display ==  "none")
        330                                      parent.s tyle.displ ay = "";
        331                             var ds Id = getDr opSpotId(p arent.getA ttribute(" id"));
        332                             if(dsI d != null)
        333                             {
        334                                      var dsEl em = docum ent.getEle mentById(d sId);
        335                                      showHigh lightedEle ment(dsEle m);
        336                             }
        337                    }
        338                    else  if((tagna me == "spa n" && pare nt.classNa me == "exp andtext")  ||
        339                             (tagna me == "spa n" && pare nt.classNa me == "glo sstext"))
        340                    {
        341                             if(par ent.style. display ==  "none")
        342                                      parent.s tyle.displ ay = "";
        343                    }
        344                    pare nt = paren t.parentNo de;
        345           }
        346   }
        347  
        348   function D omTexts()
        349   {
        350           th is.strText  = "";
        351           th is.aNodes  = new Arra y();
        352           th is.aRanges  = new Arr ay();
        353  
        354           th is.addElem entNode =  function(  a_Node )
        355           {
        356                    if (  a_Node ==  null || a _Node.chil dNodes ==  null )
        357                             return ;
        358  
        359                    var  nLen = a_N ode.childN odes.lengt h;
        360                    for  ( var i =  0; i < nLe n; i++ )
        361                    {
        362                             var no de = a_Nod e.childNod es.item( i  );
        363                             if ( n ode != nul l )
        364                             {
        365                                      if ( nod e.nodeType  == 3 )
        366                                      {
        367                                               this.addTe xtNode( no de );
        368                                      }
        369                                      else if  ( node.nod eType == 1  )
        370                                      {
        371                                               this.addEl ementNode(  node );
        372                                      }
        373                             }
        374                    }
        375           }
        376  
        377           th is.addText Node = fun ction( a_N ode )
        378           {
        379                    if (  a_Node ==  null )
        380                             return ;
        381  
        382                    var  strInnerTe xt = a_Nod e.data;
        383                    
        384                    //re place newl ine, carri age return , tab char acters wit h space
        385                    strI nnerText =  strInnerT ext.replac e(/[\n\r\t ]/g," "); 
        386                    if (  strInnerT ext.length  != 0 )
        387                    {
        388                             var nF rom = this .strText.l ength;
        389                             this.s trText +=  strInnerTe xt;
        390                             this.a Nodes[this .aNodes.le ngth] = ne w DomTextN ode( a_Nod e, nFrom ) ;
        391                    }
        392           }
        393  
        394           th is.isWordM atch = fun ction( a_s trHlWord,  a_strTextW ord )
        395           {
        396                    retu rn a_strTe xtWord.ind exOf(a_str HlWord.toL owerCase() ) != -1;
        397           }
        398                                                
        399           th is.makeHig hlightRang es = funct ion()
        400           {
        401                    if(t ypeof(gaSe archTerms[ 0]) == "un defined")
        402                             return ;
        403  
        404                    var  str = esca peRegExp(g aSearchTer ms[0].toLo werCase()) ;
        405                    for( var j = 1;  j < gaSea rchTerms.l ength; j++ )
        406                    {
        407                             str +=  "|" + esc apeRegExp( gaSearchTe rms[j].toL owerCase() );
        408                             
        409                    }
        410  
        411                    var  regexp = n ew RegExp( str, "i");
        412  
        413                    var  n = new Ob ject;
        414                    n.in dex = 0;
        415                    var  prevLen =  0;
        416                    var  tmpStr1 =  this.strTe xt.toLower Case();
        417  
        418                    whil e(n != nul l && n.ind ex > -1)
        419                    {
        420                             n = re gexp.exec( tmpStr1);
        421  
        422                             if (n  != null &&   n.index  > -1 )
        423                             {
        424                                      var strW ord = n[0] ;
        425                                      this.aRa nges[this. aRanges.le ngth] = ne w ClosedRa nge(  prev Len + n.in dex,         prevLen  + n.index  + strWord. length);
        426                                      prevLen  = prevLen  + n.index  + strWord. length;                                                        
        427                                      tmpStr1  = tmpStr1. substring( n.index +  strWord.le ngth, tmpS tr1.length );
        428                             }
        429                    }
        430           }
        431           
        432           th is.highlig htNodes =  function()
        433           {
        434                    var  nFrom = 0;
        435                    for  ( var i =  0; i < thi s.aNodes.l ength; i++  )
        436                             nFrom  = this.aNo des[i].doH ighlight(  this.aRang es, nFrom  );
        437           }
        438  
        439           th is.jump2Fi rstHighlig htedWord =  function( )
        440           {
        441                    if ( gnYPos > 5 1)
        442                             window .scrollTo( 0, gnYPos- 50);
        443           }
        444   }
        445  
        446   function p rocessSusp endNodes(  a_aNodes )
        447   {
        448           if  ( a_aNode s.length = = 0 )
        449                    retu rn false;
        450  
        451           va r dt = new  DomTexts( );
        452  
        453           // build dom  texts...
        454           fo r ( var i  = 0; i < a _aNodes.le ngth; i++  )
        455           {
        456                    var  node = a_a Nodes[i];
        457                    if (  node.node Type == 1  )
        458                    {
        459                             dt.add ElementNod e( node );
        460                    }
        461                    else  if ( node .nodeType  == 3 )
        462                    {
        463                             dt.add TextNode(  node );
        464                    }
        465           }
        466           
        467           dt .makeHighl ightRanges ();
        468           dt .highlight Nodes();
        469           dt .jump2Firs tHighlight edWord();
        470   }
        471  
        472   var s_strR ecursiveTa gs = "sub  sup img ap plet objec t br ifram e embed no embed para m area inp ut " +
        473                                                        " select tex tarea butt on option  hr frame n oframes ma rquee labe l p dl " +
        474                                                        " div center  noscript  blockquote  form isin dex table  fieldset a ddress lay er " +
        475                                                        " dt dd capt ion thead  tfoot tbod y tr th td  lengend h 1 h2 h3 h4  h5 h6 " +
        476                                                        " ul ol dir  menu li pr e xmp list ing plaint ext ins de l";
        477  
        478   function d oesTagRecu rsiveProce ss( a_Node  )
        479   {
        480           if  ( a_Node  == null )
        481                    retu rn false;
        482  
        483           va r strTagNa me = a_Nod e.tagName. toLowerCas e();
        484           va r rg = "\\ b" + strTa gName + "\ \b";
        485           va r ss = s_s trRecursiv eTags.matc h( rg );
        486           re turn ss !=  null;
        487   }
        488  
        489   function d oHighLight DomElement ( a_aSuspe ndedNodes,  a_Node )
        490   {
        491           va r childNod es = a_Nod e.childNod es;
        492           
        493           if  ( childNo des == nul l || child Nodes.leng th == 0 )
        494                    retu rn;
        495  
        496           va r nLen = c hildNodes. length;
        497           fo r ( var i  = 0; i < n Len; i++ )
        498           {
        499                    var  node = chi ldNodes.it em( i );
        500                    if (  node == n ull )
        501                             contin ue;
        502  
        503                    if (  node.node Type == 1  )
        504                    {        //elem ent
        505                             if ( d oesTagRecu rsiveProce ss( node )  )
        506                             {
        507                                      if ( a_a SuspendedN odes.lengt h > 0 )
        508                                      {
        509                                               processSus pendNodes(  a_aSuspen dedNodes ) ;
        510                                               a_aSuspend edNodes.le ngth = 0;
        511                                      }
        512                             }
        513                             doHigh LightDomEl ement( a_a SuspendedN odes, node  );
        514                    }
        515                    else  if ( node .nodeType  == 3 )
        516                    {        //text
        517                             a_aSus pendedNode s[a_aSuspe ndedNodes. length] =  node;
        518                    }
        519           }
        520   }
        521  
        522   function h ighlightDo cument()
        523   {
        524           if  ( !docume nt.body ||  document. body == nu ll )
        525                    retu rn;
        526                    
        527           va r aSuspend edNodes =  new Array( );
        528           do HighLightD omElement(  aSuspende dNodes, do cument.bod y );
        529           pr ocessSuspe ndNodes( a SuspendedN odes );
        530   }
        531  
        532   /////// st art routin e //////// /
        533   function I sHighLight Required()
        534   {
        535           va r bRetVal  = false;
        536           va r searchSe tting = gs HiliteSear chSetting. match( "^( .+),(.+),( .*)$" );
        537  
        538           if (searchSet ting != nu ll)
        539           {
        540                    if(s earchSetti ng[1] == " enable")
        541                    {
        542                             gsBkgn dColor = s earchSetti ng[2];
        543                             gsText Color = se archSettin g[3];
        544                             bRetVa l = true;
        545                    }
        546           }
        547           re turn bRetV al;
        548   }
        549  
        550   function o nGetHighli ghtInfo(oM sg)
        551   {
        552       if(oMs g && oMsg. oParam)
        553       {
        554           if (typeof(oM sg.oParam. bHighlight ) == 'unde fined' ||  oMsg.oPara m.bHighlig ht == fals e)
        555                return;
        556           if (oMsg.oPar am.nResult s <= 0)
        557                return;
        558           va r strTerms  = "";
        559           st rTerms = o Msg.oParam .strTerms;
        560           St artHighLig htSearch(s trTerms); 
        561       }
        562   }
        563  
        564   function o nGetPaneIn foToHighli ght(oMsg)
        565   {
        566       if (oM sg)
        567       {
        568           if (oMsg.oPar am != "fts ") 
        569                             return ;
        570                var oMsg  = new whM essage(WH_ MSG_GETHIG HLIGHTINFO , null, ne w Object() );
        571           re quest(oMsg , onGetHig hlightInfo );
        572           }
        573   }
        574  
        575   function h ighlightSe arch()
        576   {
        577           if (!IsHighLi ghtRequire d())       return;
        578           
        579           // check pane  in focus  is Search  pane.
        580           va r oMsg=new  whMessage (WH_MSG_GE TPANEINFO,  null, nul l);
        581           re quest(oMsg , onGetPan eInfoToHig hlight);
        582   }
        583  
        584   function S tartHighLi ghtSearch( strTerms)
        585   {
        586           if (!IsHighLi ghtRequire d())       return;
        587  
        588           fi ndSearchTe rms(strTer ms);
        589           
        590           hi ghlightDoc ument();
        591   }
        592  
        593   //////// c ommon with  FTS routi nes to ide ntify stop  word etc.  ///////// ///
        594   // Languag eService.j s--------- ---------- --------
        595  
        596   function L anguageSer vice()
        597   {
        598           th is.getNorm alizedOrg  = function ( a_strOrg , a_Result  )
        599           {
        600                    var  strUpper =  a_strOrg. toUpperCas e();
        601                    var  strLower =  a_strOrg. toLowerCas e();
        602  
        603                    if (  utf8Compa re(strUppe r, strLowe r) == 0 ||  utf8Compa re(strUppe r, a_strOr g) != 0 )
        604                    {
        605                             a_Resu lt.strNorm alizedOrg  = strLower ;
        606                             a_Resu lt.bUpperC ase = fals e;
        607                    }
        608                    else
        609                    {
        610                             a_Resu lt.strNorm alizedOrg  = strUpper ;
        611                             a_Resu lt.bUpperC ase = true ;
        612                    }
        613           }
        614           th is.stemWit h = functi on( a_strW ord, a_str Suffix )
        615           {
        616                    var  s = a_strS uffix.spli t( "," );
        617                    var  strSuffix  = s[0];
        618                    var  bRemoveOnl y = ( s[1]  == '1' );
        619                    
        620                    var  ss = a_str Word.match ( "^..+" +  strSuffix  + "$" );
        621                    if (  ss == nul l )
        622                             return  null;
        623  
        624                    var  nLenRest =  a_strWord .length -  strSuffix. length;
        625                    var  bAddE = fa lse;
        626                    if (  !bRemoveO nly )
        627                    {
        628                             if ( ! this.isVow el( a_strW ord.charAt ( nLenRest  - 1 ) ) )
        629                             {
        630                                      if ( a_s trWord.cha rAt( nLenR est - 1 )  == a_strWo rd.charAt(  nLenRest  - 2 ) )
        631                                               nLenRest-- ;
        632                                      else
        633                                               bAddE = tr ue;
        634                             }
        635                    }
        636                    
        637                    var  strStem =  a_strWord. substr( 0,  nLenRest  );
        638                    
        639                    if (  strStem.l ength < 2  || (( strS tem.length  == 2) &&  !bAddE ) )
        640                             return  null;
        641  
        642                    //if  ( strStem .length <=  2 )
        643                             //retu rn null;
        644                             
        645                    retu rn strStem ;
        646           }
        647           th is.helStem  = functio n( a_Resul t )
        648           {
        649                    var  strWord =  a_Result.s trNormaliz edOrg.toLo werCase();
        650  
        651                    var  nSuffixNum  = g_Runes HelSuffixe s.length;
        652                    var  nStemFound  = 0;
        653                    var  strStem =  null;
        654                    for  ( var i =  0; i < nSu ffixNum; i ++ )
        655                    {
        656                             strSte m = this.s temWith( s trWord, g_ RunesHelSu ffixes[i]  );
        657                             if ( s trStem !=  null )
        658                             {
        659                                      nStemFou nd = i + 1 ;
        660                                      break;
        661                             }
        662                    }
        663                    if (  strStem = = null )
        664                             strSte m = strWor d;
        665  
        666                    a_Re sult.strHe lStem = st rStem;
        667                    a_Re sult.nHelW ordShape =  a_Result. bUpperCase  ? nStemFo und * 2 +  1 : nStemF ound * 2;
        668           }
        669           th is.isVowel  = functio n( a_ch )
        670           {
        671                    retu rn g_Runes Vowels.ind exOf( a_ch  ) >= 0;
        672           }
        673           th is.isWordB reak = fun ction( a_c h )
        674           {
        675                    retu rn ( !this .isQuote(  a_ch ) &&  g_RunesWor dBreaks.in dexOf( a_c h ) >= 0 ) ;
        676           }
        677           th is.isWhite Space = fu nction( a_ ch )
        678           {
        679                    retu rn ( g_Run esWhiteSpa ces.indexO f( a_ch )  >= 0 );
        680           }
        681           th is.isSpeci alBreak =  function(  a_ch )
        682           {
        683                    retu rn ( g_Run esSpecialB reaks.inde xOf( a_ch  ) >= 0 );
        684           }        
        685           th is.isCJKCo dePoint =  function(  a_ch )
        686           {
        687                    //fr om http:// en.wikiped ia.org/wik i/Plane_%2 8Unicode%2 9
        688                    if (  (typeof(a _ch) == "u ndefined"  ) || (a_ch  == "" ) )
        689                             return  false ;
        690                    var  val = a_ch .charCodeA t(0)    ;
        691                                      
        692                    retu rn (  ((0x 2E80 <= va l) &&  ( v al <= 0x9F FF)) //Eas t Asian sc ripts and  symbols
        693                                       || ((0x F900 <= va l) &&  ( v al <= 0xFA FF))  //CJ K Compatib ility Ideo graphs
        694                                       || ((0x FE30 <= va l) &&  ( v al <= 0xFE 4F))        //CJK Com patibility  Forms 
        695                                       || ((0x FF00 <= va l) &&  ( v al <= 0xFF EF)) ); // Halfwidth  and Fullwi dth Forms  (FF00�FF EF)
        696           }
        697           th is.isQuote  = functio n( a_ch )
        698           {
        699                    retu rn ( a_ch  == g_Runes Quote );
        700           }
        701           th is.isAND =  function(  a_strOp )
        702           {        retu rn ( a_str Op == "and " );    }
        703           th is.isOR =  function(  a_strOp )
        704           {        retu rn ( a_str Op == "or"  );              }
        705           th is.isNOT =  function(  a_strOp )
        706           {        retu rn ( a_str Op == "not " );    }
        707           th is.isOpera tor = func tion( strO p )
        708           {        if (  strOp ==  "and" ||
        709                              strOp  == "or" | |
        710                              strOp  == "not"  )
        711                             return  true;
        712           }
        713   }
        714  
        715   // Runes.j s--------- ---------- ---------- -----
        716  
        717   var     ES NT_AND                  = 1;
        718   var     ES NT_OR                   = 2;
        719   var     ES NT_NOT                  = 3;
        720   var     ES NT_DEFAULT     = 4;
        721   var     ES NT_PHRASE               = 5;
        722  
        723   function R unesContex t( a_strSr c )
        724   {
        725           th is.strSrc  = a_strSrc ;
        726           th is.nCur =  0;
        727           th is.bFailed  = false;
        728           th is.bNot =  false;
        729           th is.nWordIn dex = 0;
        730           
        731           th is.getCurC har = func tion()
        732           {
        733                    retu rn this.st rSrc.charA t( this.nC ur );
        734           }
        735           th is.getChar  = functio n( i )
        736           {
        737                    retu rn this.st rSrc.charA t( i );
        738           }
        739           th is.reachEn d = functi on()
        740           {
        741                    retu rn this.nC ur >= this .strSrc.le ngth;
        742           }
        743   }
        744  
        745   function D olWord( a_ strWord, a _nPosition  )
        746   {
        747           th is.strWord              = a_strW ord;
        748           th is.nPositi on           = a_nPos ition;
        749   }
        750  
        751   function S olNode(){}
        752  
        753   function R unesServic e()
        754   {
        755           th is.langSev  = new Lan guageServi ce();
        756           
        757           th is.isOpera tor = func tion( a_st r, a_nFrom  )
        758           {
        759                    var  strOp = th is.getWord ( a_str, a _nFrom ).t oLowerCase ();
        760  
        761                    if (  this.lang Sev.isOper ator( strO p ) )
        762                             return  true;
        763  
        764                    retu rn false;
        765           }
        766           
        767           th is.getLeng thOfWordBr eak = func tion( a_st r, a_nFrom  )
        768           {
        769                    var  i = a_nFro m, nLen =  a_str.leng th;
        770                    whil e ( i < nL en && this .langSev.i sWordBreak ( a_str.ch arAt( i )  ) )
        771                             i++;
        772                    retu rn i - a_n From;
        773           }
        774           
        775           th is.getLeng thOfCJKWor dBreak = f unction( a _str, a_nF rom )
        776           {
        777                    var  i = a_nFro m, nLen =  a_str.leng th;
        778                    whil e ( i < nL en && (thi s.langSev. isWordBrea k( a_str.c harAt( i )  ) || this .langSev.i sCJKCodePo int( a_str .charAt( i  ) )))
        779                             i++;
        780                    retu rn i - a_n From;
        781           }
        782  
        783           th is.getLeng thOfWord =  function(  a_str, a_ nFrom )
        784           {
        785                    var  i = a_nFro m, nLen =  a_str.leng th;
        786                    whil e ( i < nL en &&
        787                                      !this.la ngSev.isWo rdBreak( a _str.charA t( i ) ) & &
        788                                      !this.la ngSev.isQu ote( a_str .charAt( i  ) ) )
        789                             ++i;
        790                    retu rn i - a_n From;
        791           }
        792           
        793           th is.getNonC JKWord = f unction( a _str, a_nF rom )
        794           {
        795                    var  i = a_nFro m, nLen =  a_str.leng th;
        796                    whil e ( i < nL en &&
        797                                      !this.la ngSev.isWo rdBreak( a _str.charA t( i ) ) & &
        798                                      !this.la ngSev.isCJ KCodePoint ( a_str.ch arAt( i )  ) &&
        799                                      !this.la ngSev.isQu ote( a_str .charAt( i  ) ) )
        800                             ++i;
        801                    var  nLen =  i  - a_nFrom;
        802                    retu rn a_str.s ubstr( a_n From, nLen  );
        803           }
        804  
        805           th is.getWord  = functio n( a_str,  a_nFrom )
        806           {
        807                    var  nLen = thi s.getLengt hOfWord( a _str, a_nF rom );
        808                    retu rn a_str.s ubstr( a_n From, nLen  );
        809           }
        810           
        811           th is.getTerm  = functio n( a_Conte xt, a_Rslt  )
        812           {
        813                    if (  this.lang Sev.isQuot e( a_Conte xt.getCurC har() ) )
        814                    {
        815                             a_Cont ext.nCur++ ;
        816  
        817                             var nL en = this. getLengthO fPhrase( a _Context.s trSrc, a_C ontext.nCu r );
        818                             if ( n Len <= 0 )
        819                                      return f alse;
        820  
        821                             a_Rslt .eType = E SNT_PHRASE ;
        822                             a_Rslt .strTerm =  a_Context .strSrc.su bstr( a_Co ntext.nCur , nLen );
        823                             a_Cont ext.nCur + = nLen + 1 ;
        824                    }
        825                    else
        826                    {
        827                             var nL en = this. getLengthO fDefault(  a_Context. strSrc, a_ Context.nC ur );
        828                             if ( n Len <= 0 )
        829                                      return f alse;
        830  
        831                             a_Rslt .eType = E SNT_DEFAUL T;
        832                             a_Rslt .strTerm =  a_Context .strSrc.su bstr( a_Co ntext.nCur , nLen );
        833                             a_Cont ext.nCur + = nLen;
        834                    }
        835  
        836                    retu rn true;
        837           }
        838  
        839           th is.getOper ator = fun ction( a_C ontext, a_ Rslt )
        840           {
        841                    if (  a_Context .reachEnd( ) )
        842                             return  false;
        843  
        844                    var  strOp = th is.getWord ( a_Contex t.strSrc,  a_Context. nCur ).toL owerCase() ;
        845  
        846                    if (  this.lang Sev.isAND(  strOp ) )
        847                    {
        848                             a_Rslt .eType = E SNT_AND;
        849                             a_Cont ext.nCur + = strOp.le ngth;
        850                    }
        851                    else  if ( this .langSev.i sOR( strOp  ) )
        852                    {
        853                             a_Rslt .eType = E SNT_OR;
        854                             a_Cont ext.nCur + = strOp.le ngth;
        855                    }
        856                    else  if ( this .langSev.i sNOT( strO p ) )
        857                    {
        858                             a_Rslt .eType = E SNT_NOT;
        859                             a_Cont ext.nCur + = strOp.le ngth;
        860                    }
        861                    else
        862                    {
        863                             a_Rslt .eType = E SNT_OR;
        864                    }
        865                    
        866                    retu rn true;
        867           }
        868  
        869           th is.getLeng thOfPhrase  = functio n( a_str,  a_nFrom )
        870           {
        871                    var  i = a_nFro m, nLen =  a_str.leng th;
        872                    whil e ( i < nL en )
        873                    {
        874                             if ( t his.langSe v.isQuote(  a_str.cha rAt( i ) )  )
        875                                      return i  - a_nFrom ;
        876                             ++i;
        877                    }
        878                    retu rn -1;
        879           }
        880  
        881           th is.getLeng thOfDefaul t = functi on( a_str,  a_nFrom )
        882           {
        883                    var  i = a_nFro m, nLen =  a_str.leng th;
        884                    whil e ( i < nL en &&
        885                                      !this.is Operator(  a_str, i )  &&
        886                                      !this.la ngSev.isQu ote( a_str .charAt( i  ) ) )
        887                    {
        888                             i += t his.getLen gthOfWord(  a_str, i  );
        889                             i += t his.getLen gthOfWordB reak( a_st r, i );
        890                    }
        891                    retu rn i - a_n From;
        892           }
        893  
        894           th is.parseOp erator = f unction( a _Context,  a_Result,  a_bNotAllo wed )
        895           {
        896                    a_Co ntext.nCur  += this.g etLengthOf WordBreak(  a_Context .strSrc, a _Context.n Cur );
        897  
        898                    var  rslt = new  Object;
        899                    if (  !this.get Operator(  a_Context,  rslt ) )
        900                             return  false;
        901  
        902                    if (  rslt.eTyp e == ESNT_ NOT )
        903                    {
        904                             if (a_ bNotAllowe d)
        905                             {
        906                                 if  ( a_Conte xt.bNOT )
        907                                 {
        908                                          rslt .eType = E SNT_OR;
        909                                 }
        910                                 el se
        911                                 {
        912                                          a_Co ntext.bNOT  = true;
        913                                 }
        914                             }
        915                             else
        916                             {
        917                                 a_ Context.bF ailed = tr ue;
        918                                 re turn false  ;                        
        919                             }
        920                    }
        921                    a_Re sult.eType  = rslt.eT ype;
        922                    a_Re sult.right  = new Sol Node();
        923                    if (  !this.par seTerm( a_ Context, a _Result.ri ght ) )
        924                             return  false;
        925  
        926                    retu rn true;
        927           }
        928  
        929           /* *
        930           St art parsin g the sear ch query f rom a_Cont ext.nCur a nd check f or presenc e of a phr ase or nor mal term
        931           Or  a term pr efixed wit h NOT oper ator. In c ase a phra se or norm al term is  encounter ed, check  for operat ors
        932           in  the rest  of the exp ression.  
        933           A  term can c ontain man y words fo r e.g. 
        934           Se arch query : hello wo rld AND fi rst topic
        935           Th is consist  of two se arch terms
        936           1)  hello wor ld
        937           2)  first top ic
        938           An d each of  these term s have two  words eac h.
        939           ** /
        940           th is.parseTe rm = funct ion( a_Con text, a_Re sult )
        941           {
        942                    a_Co ntext.nCur  += this.g etLengthOf WordBreak(  a_Context .strSrc, a _Context.n Cur );
        943  
        944                    var  rslt = new  Object;
        945                    if (  !this.get Term( a_Co ntext, rsl t ) )
        946                    {
        947                             if ((  this.parse Operator(  a_Context,  rslt, tru e ) )&&(rs lt.eType = = ESNT_NOT ))
        948                         {
        949                             a_Resu lt.eType =  rslt.eTyp e;
        950                             if (rs lt.right.e Type == ES NT_DEFAULT )
        951                             {
        952                                      a_Result .strTerm =  rslt.righ t.strTerm;   
        953                                      return t rue ;                
        954                                 }
        955                                 el se
        956                                 {
        957                                      a_Contex t.bFailed  = true;
        958                                      return f alse;
        959                                 }
        960                         }
        961                         else
        962                         {
        963                             a_Cont ext.bFaile d = true;
        964                                 re turn false ;
        965                         }                    
        966                    }
        967  
        968                    if (  this.pars eOperator(  a_Context , a_Result , false )  )
        969                    {
        970                             a_Resu lt.left =  new SolNod e();
        971                             a_Resu lt.left.eT ype = rslt .eType;
        972                             a_Resu lt.left.st rTerm = rs lt.strTerm ;
        973                    }
        974                    else
        975                    {
        976                             a_Resu lt.eType =  rslt.eTyp e;
        977                             a_Resu lt.strTerm  = rslt.st rTerm;
        978                    }
        979                    
        980                    retu rn true;
        981           }
        982  
        983           th is.extract Term = fun ction( a_C ontext, a_ Term )
        984           {
        985                    a_Te rm.aWords  = new Arra y();
        986                    this .dolSegmen t( a_Term  );
        987  
        988                    if (  a_Term.aW ords.lengt h == 0 )
        989                             return  false;
        990  
        991                    if(a _Term.eTyp e != ESNT_ PHRASE)
        992                    {
        993                             //if s earch type  is not ph rase searc h, remove  special br eak charac ters
        994                             var j  =0;
        995                             for (  var i = 0;  i < a_Ter m.aWords.l ength; i++  )
        996                             {
        997                                      if(!this .langSev.i sSpecialBr eak( a_Ter m.aWords[i ].strWord. charAt( 0  ) ))
        998                                      {
        999                                               a_Term.aWo rds[j] = a _Term.aWor ds[i];
        1000                                               j++;
        1001                                      }
        1002                             }
        1003                             a_Term .aWords.le ngth = j;
        1004                    }
        1005                    
        1006                    for  ( var i =  0; i < a_T erm.aWords .length; i ++ )
        1007                    {
        1008                             a_Term .aWords[i] .nWordId =  a_Term.aW ords[i].nP osition +  a_Context. nWordIndex ;
        1009                    }
        1010                    a_Co ntext.nWor dIndex = a _Term.aWor ds[a_Term. aWords.len gth - 1].n WordId + 1 ;
        1011                    retu rn true;
        1012           }
        1013  
        1014           /* *
        1015           Ch eck each t erm in the  query and  break up  each term  in individ ual words.
        1016           ** /
        1017           th is.parsePh raseAndDef ault = fun ction( a_C ontext, a_ Node )
        1018           {
        1019                    if (  a_Node.eT ype == ESN T_PHRASE | | a_Node.e Type == ES NT_DEFAULT  || a_Node .eType ==  ESNT_NOT)
        1020                    {
        1021                             if ( ! this.extra ctTerm( a_ Context, a _Node ) &&
        1022                                       a_Node. eType == E SNT_PHRASE  )
        1023                                      a_Contex t.bFailed  = true;
        1024                    }
        1025                    else
        1026                    {
        1027                             this.p arsePhrase AndDefault ( a_Contex t, a_Node. left );
        1028                             this.p arsePhrase AndDefault ( a_Contex t, a_Node. right );
        1029                    }
        1030           }
        1031  
        1032           th is.helStem  = functio n( a_strOr g, a_Resul t )
        1033           {
        1034                    this .langSev.g etNormaliz edOrg( a_s trOrg, a_R esult );
        1035                    this .langSev.h elStem( a_ Result );
        1036           }
        1037           
        1038           /* *
        1039            *  Check pre sence of a ny break c haracters  in given t erm, start ing from " cur" posit ion.
        1040            *  If the br eak charac ters prese nt are spe cial break /CJK, incl ude them i n a_Result .
        1041            *  Update po sition of  next word  and also c haracter p osition of  next non  breaking
        1042            *  character  in the te rm. 
        1043            *  Change th e term typ e to phras e, if a CJ K break is  encounter ed.
        1044            * /
        1045           th is.parseBr eakCharact ers  = fun ction( a_T erm , a_po sitions)
        1046           {
        1047                    var  a_strSrc =  a_Term.st rTerm;
        1048                    var  a_Result =  a_Term.aW ords ;  
        1049                    var  nLen = a_s trSrc.leng th;
        1050                    var  nCur = a_p ositions[" cur"];
        1051                    var  nPosition  = a_positi ons["pos"]  ;
        1052                    var  bCJKTerm =  false ;
        1053                    var  bCJKBreak  = false ;
        1054                    whil e ( nCur <  nLen && ( this.langS ev.isWordB reak( a_st rSrc.charA t( nCur ))  || this.l angSev.isC JKCodePoin t( a_strSr c.charAt(  nCur ))) )
        1055                    {
        1056                             
        1057                             if ( t his.langSe v.isSpecia lBreak( a_ strSrc.cha rAt( nCur  ) ) || (bC JKBreak =  this.langS ev.isCJKCo dePoint( a _strSrc.ch arAt( nCur  ))) )
        1058                             {
        1059                                      //it's a  special w ord/CJK br eak, inclu de it in s earch
        1060                                      a_Result [a_Result. length] =  new DolWor d( a_strSr c.charAt(  nCur ), nP osition );
        1061                                      nPositio n++;
        1062                                      
        1063                                      if (!bCJ KTerm && b CJKBreak)  //set the  term as CJ K term
        1064                                               bCJKTerm   = true ;
        1065                             }
        1066                             nCur++ ;
        1067                    }
        1068                    a_po sitions["c ur"] = nCu r ;
        1069                    a_po sitions["p os"] = nPo sition ;                  
        1070                    
        1071                    if ( bCJKTerm)
        1072                             a_Term .eType = E SNT_PHRASE  ;
        1073           }
        1074           
        1075           /* *
        1076           Br eak the cu rrent term  in words.
        1077           If  the term  contains C JK charact ers, treat  each one  of them
        1078           as  a seperat e word.
        1079           If  any of th e words is  a CJK cha racter, tr eat this t erm as a p hrase term .
        1080           ** /
        1081           th is.dolSegm ent = func tion( a_Te rm )
        1082           {
        1083                    var  a_strSrc =  a_Term.st rTerm;
        1084                    var  a_Result =  a_Term.aW ords ;           
        1085                    var  nLen = a_s trSrc.leng th;
        1086                    var  strWord =  "";                
        1087                    var  positions  = new Arra y();
        1088                    posi tions["cur "] = 0 ;
        1089                    posi tions["pos "] = 1 ;
        1090  
        1091                    this .parseBrea kCharacter s( a_Term,  positions  );
        1092                    
        1093                    whil e ( positi ons["cur"]  < nLen )
        1094                    {
        1095                             strWor d = this.g etNonCJKWo rd( a_strS rc, positi ons["cur"]  );
        1096                             a_Resu lt[a_Resul t.length]  = new DolW ord( strWo rd, positi ons["pos"]  );
        1097                             
        1098                             positi ons["cur"]  += strWor d.length;
        1099                             positi ons["pos"] ++ ;
        1100                             
        1101                             //chec k if we ca n find som e special  break/CJK  characters  in betwee n this and  next word           
        1102                             this.p arseBreakC haracters(  a_Term, p ositions   );
        1103                    }
        1104           }
        1105           
        1106           th is.solPars e = functi on( a_strS rc, a_Resu lt )
        1107           {
        1108                    var  context =  new RunesC ontext( a_ strSrc );
        1109                    this .parseTerm ( context,  a_Result  );
        1110  
        1111                    if (  context.b Failed )
        1112                             return  false;
        1113                             
        1114                    this .parsePhra seAndDefau lt( contex t, a_Resul t );
        1115                    if (  context.b Failed )
        1116                             return  false; 
        1117  
        1118                    retu rn true;
        1119           }
        1120   }
        1121  
        1122   function _ helStemNod e( a_Runes , a_Node )
        1123   {
        1124           wi th ( a_Nod e )
        1125           {
        1126                    if (  eType ==  ESNT_PHRAS E || eType  == ESNT_D EFAULT ||  eType == E SNT_NOT)
        1127                    {
        1128                             for (  var i = 0;  i < aWord s.length;  i++ )
        1129                             {
        1130                                      a_Runes. helStem( a Words[i].s trWord, aW ords[i] )
        1131                             }
        1132                    }
        1133                    else
        1134                    {
        1135                             _helSt emNode( a_ Runes, lef t );
        1136                             _helSt emNode( a_ Runes, rig ht );
        1137                    }
        1138           }
        1139   }
        1140  
        1141   function f indSearchT erms(searc hTerms)
        1142   {
        1143           va r runes =  new RunesS ervice();
        1144           va r expressi on = new S olNode();
        1145           if  ( !runes. solParse(  searchTerm s, express ion ) )
        1146                    retu rn ;
        1147                    
        1148           _h elStemNode ( runes, e xpression  )
        1149                    
        1150           bu ildSearchT erms(expre ssion) ;  
        1151   }
        1152  
        1153   function b uildSearch Terms(a_No de)
        1154   {
        1155           if  (a_Node.e Type == ES NT_NOT     )
        1156                    retu rn ;
        1157           el se if ( a_ Node.eType  == ESNT_P HRASE )
        1158           {
        1159                    gaSe archTerms[ gaSearchTe rms.length ] = trim(  a_Node.str Term ) ;
        1160           }
        1161           el se if ( a_ Node.eType  == ESNT_D EFAULT )
        1162           {
        1163                    with  ( a_Node  )
        1164                    {
        1165                             for (  var i = 0;  i < aWord s.length;  i++ )
        1166                             {
        1167                                      gaSearch Terms[gaSe archTerms. length] =  aWords[i]. strHelStem  ;
        1168                             }
        1169                    }
        1170           }
        1171           el se
        1172           {
        1173                    buil dSearchTer ms(  a_Nod e.left );
        1174                    buil dSearchTer ms(  a_Nod e.right );
        1175           }
        1176   }
        1177  
        1178   function t rim(string ToTrim) {
        1179           re turn strin gToTrim.re place(/^\s +|\s+$/g," ");
        1180   }
        1181  
        1182   function u tf8Compare (strText1, strText2)
        1183   {
        1184           va r strt1=st rText1;
        1185           va r strt2=st rText2;
        1186  
        1187           tr y {
        1188                    strt 1=strText1 .toLowerCa se();
        1189           }
        1190           ca tch(er) {
        1191           }
        1192  
        1193           tr y {
        1194                    strt 2=strText2 .toLowerCa se();
        1195           }
        1196           ca tch(er) {
        1197           }
        1198  
        1199           if (strt1<str t2) return  -1;
        1200           if (strt1>str t2) return  1;
        1201           re turn 0;
        1202   }
        1203  
        1204  
        1205  
        1206   /////// en d highligh t search r ountines / ////////// //
        1207  
        1208   function s etButtonFo nt(sType,s FontName,s FontSize,s FontColor, sFontStyle ,sFontWeig ht,sFontDe coration)
        1209   {
        1210           va r vFont=ne w whFont(s FontName,s FontSize,s FontColor, sFontStyle ,sFontWeig ht,sFontDe coration);
        1211           gs BtnStyle+= ".whtbtn"+ sType+"{"+ getFontSty le(vFont)+ "}";
        1212   }
        1213  
        1214   function w riteBtnSty le()
        1215   {
        1216           if (gaButtons .length>0)
        1217           {
        1218                    if(g sBtnStyle. length>0)
        1219                    {
        1220                             var sS tyle="<sty le type='t ext/css'>" ;
        1221                             sStyle +=gsBtnSty le+"</styl e>";
        1222                             docume nt.write(s Style);
        1223                    }
        1224           }
        1225   }
        1226  
        1227   function b utton(sTex t,nWidth,n Height)
        1228   {
        1229           th is.sText=s Text;
        1230           th is.nWidth= nWidth;
        1231           th is.nHeight =nHeight;
        1232           
        1233           th is.aImgs=n ew Array() ;
        1234           va r i=0;
        1235           wh ile(button .arguments .length>i+ 3)
        1236           {
        1237                    this .aImgs[i]= button.arg uments[3+i ];
        1238                    i++;
        1239           }
        1240   }
        1241  
        1242  
        1243   //recursiv ely finds  the parent  project S tartPage p ath if exi sts 
        1244   //also com putes the  child toc  path in th e parent t oc recursi vely until  
        1245   //main pro j
        1246  
        1247   function o nGetPPStar tPage(xmlD oc, sPath)
        1248   {
        1249       if(xml Doc == nul l)
        1250                return;
        1251           
        1252           va r root = x mlDoc.docu mentElemen t;
        1253           va r masterPr oj = null;
        1254           tr y
        1255           {
        1256                    mast erProj = x mlDoc.getE lementsByT agName("sy ncinfo");    
        1257                    if(m asterProj. length > 0 )
        1258                    {
        1259                             var st artpage =  xmlDoc.get ElementsBy TagName("s tartpage") ;       
        1260                             if(sta rtpage.len gth>0)
        1261                             {
        1262                                 ma sterStartP ageName =  startpage[ 0].getAttr ibute("nam e");
        1263                                 ma sterStartP ageRelPath  = startpa ge[0].getA ttribute(" url");
        1264                                 va r sXmlFold erPath = _ getPath(sP ath);
        1265                         sXmlFolder Path = _ge tFullPath( sXmlFolder Path, mast erStartPag eRelPath+m asterStart PageName);
        1266                    
        1267                    gsSt artPage =  sXmlFolder Path;
        1268                    gsRe lCurPagePa th=_getRel ativeFileN ame(gsStar tPage, doc ument.loca tion.href) ;
        1269                    
        1270                         getPPStart PagePath(s XmlFolderP ath);
        1271                             }
        1272                    }
        1273           }
        1274           ca tch(e)
        1275           {
        1276                return;
        1277           }
        1278   }
        1279  
        1280   function g etPPStartP agePath(sP ath)
        1281   {
        1282           if (sPath.len gth != 0)
        1283           {
        1284                    var  sXmlFolder Path = _ge tPath(sPat h);
        1285                    if(s XmlFolderP ath.indexO f("/merged Projects/" ) == -1 &&
        1286                             sXmlFo lderPath.i ndexOf("\\ mergedProj ects\\") = = -1)
        1287           {
        1288                             return ;
        1289           }
        1290                    
        1291                    var  sdocPath =  _getFullP ath(sXmlFo lderPath,  "MasterDat a.xml");
        1292           va r sCurrent DocPath =  _getPath(d ocument.lo cation.hre f);
        1293           va r fileName  = _getRel ativeFileN ame(sCurre ntDocPath,  sdocPath) ;
        1294  
        1295           xm lJsReader. loadFile(f ileName, f unction (a _xmlDoc, a rgs) {
        1296                onGetPPS tartPage(a _xmlDoc, a rgs);
        1297           },  sPath);
        1298           }
        1299   }
        1300  
        1301   //project  info
        1302   function s etRelStart Page(sPath )
        1303   {
        1304           if (gsPPath.l ength==0)
        1305           {
        1306                    gsPP ath=_getFu llPath(_ge tPath(docu ment.locat ion.href),  _getPath( sPath));
        1307                    onSe tStartPage ();
        1308                    
        1309                    gsSt artPage=_g etFullPath (_getPath( document.l ocation.hr ef), sPath );
        1310                    gsRe lCurPagePa th=_getRel ativeFileN ame(gsStar tPage, doc ument.loca tion.href) ;
        1311                    
        1312                    try{
        1313                             getPPS tartPagePa th(gsStart Page);
        1314                    }
        1315                    catc h(e)
        1316                    {
        1317                             alert( "Error rea ding maste rData.xml" );
        1318                    }
        1319           }
        1320   }
        1321  
        1322   function g etImage(oI mage,sType )
        1323   {
        1324           va r sImg="";
        1325           if (oImage&&o Image.aImg s&&(oImage .aImgs.len gth>0))
        1326           {
        1327                    sImg +="<img al t=\""+sTyp e+"\" src= \""+oImage .aImgs[0]+ "\"";
        1328                    if(o Image.nWid th>0)
        1329                             sImg+= " width="+ oImage.nWi dth;
        1330                    if(o Image.nHei ght>0)
        1331                             sImg+= " height=" +oImage.nH eight;
        1332                    sImg +=" border =0>";
        1333           }
        1334           re turn sImg;
        1335   }
        1336  
        1337   function a ddTocInfo( sTocPath)
        1338   {
        1339           ga Paths[gaPa ths.length ]=sTocPath ;
        1340   }
        1341  
        1342  
        1343   var flex_n extLocatio n;
        1344   var flex_p reviousLoc ation;
        1345  
        1346   function a ddAvenueIn fo(sName,s Prev,sNext )
        1347   {
        1348           ga Avenues[ga Avenues.le ngth]=new  avenueInfo (sName,sPr ev,sNext);
        1349           fl ex_previou sLocation  = sPrev;
        1350           fl ex_nextLoc ation = sN ext;
        1351   }
        1352  
        1353   function a ddButton(s Type,nStyl e,sText,sH ref,sOnCli ck,sOnMous eOver,sOnL oad,nWidth ,nHeight,s Img1,sImg2 ,sImg3)
        1354   {
        1355           va r sButton= "";
        1356           va r nBtn=gaB uttons.len gth;
        1357           if (sType=="p rev")
        1358           {
        1359                    if(c anGo(false ))
        1360                    {
        1361                             var sT itle="Prev ious Topic ";
        1362                             goPrev =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 );
        1363                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nprev\" hr ef=\"javas cript:void (0);\" onc lick=\"goA venue(fals e);return  false;\">" ;
        1364                             if(nSt yle==BTN_T EXT)
        1365                                      sButton+ =goPrev.sT ext;
        1366                             else
        1367                                      sButton+ =getImage( goPrev,sTi tle);
        1368                             sButto n+="</a>";
        1369                    }
        1370           }
        1371           el se if(sTyp e=="next")
        1372           {
        1373                    if(c anGo(true) )
        1374                    {
        1375                             var sT itle="Next  Topic";
        1376                             goNext =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 );
        1377                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nnext\" hr ef=\"javas cript:void (0);\" onc lick=\"goA venue(true );return f alse;\">";
        1378                             if(nSt yle==BTN_T EXT)
        1379                                      sButton+ =goNext.sT ext;
        1380                             else
        1381                                      sButton+ =getImage( goNext,sTi tle);
        1382                             sButto n+="</a>";
        1383                    }
        1384           }
        1385           el se if(sTyp e=="show")
        1386           {
        1387                    if(i sTopicOnly ()&&(!gbOp era6||gbOp era7))
        1388                    {
        1389                             var sT itle="Show  Navigatio n Componen t";
        1390                             goShow =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 );
        1391                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nshow\" hr ef=\"javas cript:void (0);\" onc lick=\"sho w();return  false;\"> ";
        1392                             if(nSt yle==BTN_T EXT)
        1393                                      sButton+ =goShow.sT ext;
        1394                             else
        1395                                      sButton+ =getImage( goShow,sTi tle);
        1396                             sButto n+="</a>";
        1397                    }
        1398           }
        1399           el se if(sTyp e=="hide")
        1400           {
        1401                    if(! isTopicOnl y()&&!gbOp era6)
        1402                    {
        1403                             var sT itle="Hide  Navigatio n Componen t";
        1404                             goHide =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 );
        1405                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nhide\" hr ef=\"javas cript:void (0);\" onc lick=\"hid e();return  false;\"> ";
        1406                             if(nSt yle==BTN_T EXT)
        1407                                      sButton+ =goHide.sT ext;
        1408                             else
        1409                                      sButton+ =getImage( goHide,sTi tle);
        1410                             sButto n+="</a>";
        1411                    }
        1412           }
        1413           el se if(sTyp e=="showna v")
        1414           {
        1415                    if(i sShowHideE nable())
        1416                    {
        1417                             var sT itle="Show  Navigatio n Componen t";
        1418                             goShow Nav=new bu tton(sText ,nWidth,nH eight,sImg 1,sImg2,sI mg3);
        1419                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nshownav\"  href=\"ja vascript:v oid(0);\"  onclick=\" showHidePa ne(true);r eturn fals e;\">";
        1420                             if(nSt yle==BTN_T EXT)
        1421                                      sButton+ =goShowNav .sText;
        1422                             else
        1423                                      sButton+ =getImage( goShowNav, sTitle);
        1424                             sButto n+="</a>";
        1425                    }
        1426           }
        1427           el se if(sTyp e=="hidena v")
        1428           {
        1429                    if(i sShowHideE nable())
        1430                    {
        1431                             var sT itle="Hide  Navigatio n Componen t";
        1432                             goHide Nav=new bu tton(sText ,nWidth,nH eight,sImg 1,sImg2,sI mg3);
        1433                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nhidenav\"  href=\"ja vascript:v oid(0);\"  onclick=\" showHidePa ne(false); return fal se;\">";
        1434                             if(nSt yle==BTN_T EXT)
        1435                                      sButton+ =goHideNav .sText;
        1436                             else
        1437                                      sButton+ =getImage( goHideNav, sTitle);
        1438                             sButto n+="</a>";
        1439                    }
        1440           }
        1441           el se if(sTyp e=="syncto c")
        1442           {
        1443                    if(g aPaths.len gth>0)
        1444                    {
        1445                             var sT itle="Sync  TOC";
        1446                             goSync =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 );
        1447                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nsynctoc\"  href=\"ja vascript:v oid(0);\"  onclick=\" syncWithSh ow();retur n false;\" >";
        1448                             if(nSt yle==BTN_T EXT)
        1449                                      sButton+ =goSync.sT ext;
        1450                             else
        1451                                      sButton+ =getImage( goSync,sTi tle);
        1452                             sButto n+="</a>";
        1453                    }
        1454           }
        1455           el se if(sTyp e=="websea rch")
        1456           {
        1457                    if(g sSearchFor mHref.leng th>0)
        1458                    {
        1459                             var sT itle="WebS earch";
        1460                             goWebS earch=new  button(sTe xt,nWidth, nHeight,sI mg1,sImg2, sImg3);
        1461                             sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nwebsearch \" href=\" "+gsSearch FormHref+" \">";
        1462                             if(nSt yle==BTN_T EXT)
        1463                                      sButton+ =goWebSear ch.sText;
        1464                             else
        1465                                      sButton+ =getImage( goWebSearc h,sTitle);
        1466                             sButto n+="</a>";
        1467                    }
        1468           }
        1469           el se if(sTyp e=="search form")
        1470           {
        1471                    gaBu ttons[nBtn ]="NeedSea rchForm";
        1472                    gaTy pes[nBtn]= sType;
        1473           }
        1474           if (sButton.l ength!=0)
        1475           {
        1476                    if(n Style==BTN _TEXT)
        1477                             sButto n+="&nbsp; ";
        1478                    gaBu ttons[nBtn ]="<td>"+s Button+"</ td>";
        1479                    gaTy pes[nBtn]= sType;
        1480           }
        1481   }
        1482  
        1483   function o nGetSyncSu pport(oMsg )
        1484   {
        1485           if (oMsg && o Msg.oParam )
        1486           {
        1487                    gbSy ncEnabled= oMsg.oPara m;
        1488           }
        1489   }
        1490  
        1491   function G etSyncEnab led()
        1492   {
        1493           va r oMsg=new  whMessage (WH_MSG_IS SYNCSSUPPO RT,null,nu ll);
        1494           re quest(oMsg , onGetSyn cSupport);
        1495   }
        1496  
        1497   function i sInPopup()
        1498   {
        1499           re turn (wind ow.name.in dexOf("BSS CPopup")!= -1);
        1500   }
        1501  
        1502   function g etIntopicB ar(sAlign)
        1503   {
        1504           va r sHTML="" ;
        1505           if (gaButtons .length>0)
        1506           {
        1507                    sHTM L+="<div a lign="+sAl ign+">";
        1508  
        1509                    sHTM L+="<table  cellpaddi ng=\"2\" c ellspacing =\"0\" bor der=\"0\"> <tr>";
        1510                    for( var i=0;i< gaButtons. length;i++ )
        1511                    {
        1512                             if(gaT ypes[i]!=" synctoc"|| gbSyncEnab led)
        1513                             {
        1514                                      if(gaBut tons[i]==" NeedSearch Form")
        1515                                               sHTML+=get SearchForm HTML();
        1516                                      else
        1517                                               sHTML+=gaB uttons[i];
        1518                             }
        1519                    }
        1520                    sHTM L+="</tr>< /table>";
        1521  
        1522                    sHTM L+="</div> ";
        1523           }
        1524           re turn sHTML ;
        1525   }
        1526  
        1527  
        1528   function w riteIntopi cBar(nAlig ns)
        1529   {
        1530           if (isInPopup ()) return ;
        1531           if (gaButtons .length>0)
        1532           {
        1533                    var  sHTML="";
        1534                    if(n Aligns!=0)
        1535                    {
        1536                             sHTML+ ="<table w idth=100%> <tr>"
        1537                             if(nAl igns&1)
        1538                                      sHTML+=" <td width= 33%>"+getI ntopicBar( "left")+"< /td>";
        1539                             if(nAl igns&2)
        1540                                      sHTML+=" <td width= 34%>"+getI ntopicBar( "center")+ "</td>";
        1541                             if(nAl igns&4)
        1542                                      sHTML+=" <td width= 33%>"+getI ntopicBar( "right")+" </td>";
        1543                             sHTML+ ="</tr></t able>";
        1544                             docume nt.write(s HTML);
        1545                    }
        1546           }
        1547   }
        1548  
        1549   function s endAveInfo Out()
        1550   {
        1551           if (!isInPopu p())
        1552                    setT imeout("se ndAveInfo( );",100);
        1553   }
        1554  
        1555   function s endAveInfo ()
        1556   {
        1557           va r oMsg=new  whMessage (WH_MSG_AV ENUEINFO,g aAvenues,  null);
        1558           no tify(oMsg) ;
        1559   }
        1560  
        1561  
        1562   function o nNext()
        1563   {
        1564           va r oMsg=new  whMessage (WH_MSG_NE XT,null,nu ll);
        1565           no tify(oMsg) ;
        1566   }
        1567  
        1568   function o nPrev()
        1569   {
        1570           va r oMsg=new  whMessage (WH_MSG_PR EV,null,nu ll);
        1571           no tify(oMsg) ;
        1572   }
        1573  
        1574   function c reateSyncI nfo()
        1575   {
        1576           va r oParam=n ew Object( );
        1577           va r sPath =  null;
        1578       if(gsP Path.lengt h==0)
        1579                    sPat h =_getPat h(document .location. href);
        1580           el se 
        1581                    sPat h = gsPPat h;
        1582           oP aram.sPPat h=sPath;
        1583           oP aram.sTPat h=document .location. href;
        1584           oP aram.aPath s=gaPaths;
        1585           re turn oPara m;
        1586   }
        1587  
        1588   function s yncWithSho w()
        1589   {
        1590           if (isTopicOn ly())
        1591                    show ();
        1592           el se
        1593           {
        1594                    sync ();
        1595                    show TocPane();
        1596           }
        1597   }
        1598  
        1599   function s howTocPane ()
        1600   {
        1601           va r oMsg=new  whMessage (WH_MSG_SH OWTOC,null ,null);
        1602           no tify(oMsg) ;
        1603   }
        1604  
        1605   function s endSyncInf o()
        1606   {
        1607           if (!isInPopu p())
        1608           {
        1609                    var  iParam=nul l;
        1610                    if(g aPaths.len gth>0)
        1611                    {
        1612                             iParam =createSyn cInfo();
        1613                    }
        1614                    var  oMsg=new w hMessage(W H_MSG_SYNC INFO, iPar am, null);
        1615                    noti fy(oMsg);
        1616           }
        1617   }
        1618  
        1619   function s endInvalid SyncInfo()
        1620   {
        1621           if (!isInPopu p())
        1622           {
        1623                    var  oMsg=new w hMessage(W H_MSG_SYNC INFO,null, null);
        1624                    noti fy(oMsg);
        1625           }
        1626   }
        1627  
        1628   function e nableWebSe arch(bEnab le)
        1629   {
        1630           if (!isInPopu p())
        1631           {
        1632                    var  oMsg=new w hMessage(W H_MSG_ENAB LEWEBSEARC H, bEnable , null);
        1633                    noti fy(oMsg);
        1634           }
        1635   }
        1636  
        1637   function a utoSync(nS ync)
        1638   {
        1639           if (nSync==0)  return;
        1640           if (isInPopup ()) return ;
        1641           if (isOutMost Topic())
        1642                    sync ();
        1643   }
        1644  
        1645   function i sOutMostTo pic()
        1646   {
        1647           if (gnOutmost Topic==-1)  {
        1648                if (wind ow.name ==  'bsscrigh t')
        1649                    gnOu tmostTopic  = 1;
        1650                else
        1651                    gnOu tmostTopic  = 0;
        1652            }
        1653           re turn (gnOu tmostTopic ==1);
        1654   }
        1655  
        1656   function s ync()
        1657   {
        1658           if (gaPaths.l ength>0)
        1659           {
        1660                    var  iParam=cre ateSyncInf o();
        1661                    var  oMessage=n ew whMessa ge(WH_MSG_ SYNCTOC,iP aram, null );
        1662                    noti fy(oMessag e);
        1663           }
        1664   }
        1665  
        1666  
        1667   function a venueInfo( sName,sPre v,sNext)
        1668   {
        1669           th is.sName=s Name;
        1670           th is.sPrev=s Prev;
        1671           th is.sNext=s Next;
        1672   }
        1673  
        1674  
        1675  
        1676   function u nRegisterL istener()
        1677   {
        1678           if (gbAIRSSL)
        1679                    retu rn;
        1680           se ndInvalidS yncInfo();
        1681           en ableWebSea rch(false) ;
        1682           if (whtopic_f oldUnload)
        1683                    whto pic_foldUn load();
        1684   }
        1685  
        1686   function o nReceiveNo tification (oMsg)
        1687   {
        1688           va r nMsgId=o Msg.msgId;
        1689           if (nMsgId==W H_MSG_NEXT )
        1690           {
        1691                    goAv enue(true) ;
        1692           }
        1693           el se if(nMsg Id==WH_MSG _PREV)
        1694           {
        1695                    goAv enue(false );
        1696           }
        1697           el se if(nMsg Id==WH_MSG _WEBSEARCH )
        1698           {
        1699                    webs earch();
        1700           }
        1701           re turn true;
        1702   }
        1703  
        1704   function o nReceiveRe quest(oMsg )
        1705   {
        1706       var nM sgId=oMsg. msgId;
        1707       if(nMs gId==WH_MS G_GETAVIAV ENUES)
        1708           {
        1709                    oMsg .oParam.aA venues=gaA venues;
        1710                    repl y(oMsg);
        1711                    retu rn false;
        1712           }
        1713           el se if(nMsg Id==WH_MSG _GETTOCPAT HS)
        1714           {
        1715                    if(i sOutMostTo pic())
        1716                    {
        1717                             oMsg.o Param.oToc Info=creat eSyncInfo( );
        1718                             reply( oMsg);
        1719                             return  false;            
        1720                    }
        1721                    else
        1722                             return  true;
        1723           }
        1724           re turn true;
        1725   }
        1726  
        1727  
        1728   function o nGetCurren tAvenue(oM sg)
        1729   {
        1730           if (oMsg && o Msg.oParam )
        1731           {
        1732                var sTop ic=null;
        1733                var sAve nue= oMsg. oParam.sAv enue;
        1734                var nAve nue=-1;
        1735                if(sAven ue!=null&& sAvenue!=" ")
        1736                {
        1737                         for(var i= 0;i<gaAven ues.length ;i++)
        1738                         {
        1739                                 if (gaAvenues [i].sName= =sAvenue)
        1740                                 {
        1741                                          nAve nue=i;
        1742                                          brea k;
        1743                                 }
        1744                         }
        1745                         if(nAvenue !=-1)
        1746                         {
        1747                                 if (oMsg.iPar am.bNext)
        1748                                          sTop ic=gaAvenu es[nAvenue ].sNext;
        1749                                 el se
        1750                                          sTop ic=gaAvenu es[nAvenue ].sPrev;
        1751                         }
        1752                }
        1753                else
        1754                {
        1755                         for(var i= 0;i<gaAven ues.length ;i++)
        1756                         {
        1757                                 if (gaAvenues [i].sNext! =null&&gaA venues[i]. sNext.leng th>0&&oMsg .iParam.bN ext)
        1758                                 {
        1759                                          sTop ic=gaAvenu es[i].sNex t;
        1760                                          brea k;
        1761                                 }
        1762                                 el se if(gaAv enues[i].s Prev!=null &&gaAvenue s[i].sPrev .length>0& &!oMsg.iPa ram.bNext)
        1763                                 {
        1764                                          sTop ic=gaAvenu es[i].sPre v;
        1765                                          brea k;
        1766                                 }
        1767                         }
        1768                }
        1769           
        1770                if(sTopi c!=null&&s Topic!="")
        1771                {
        1772                         if(gsPPath !=null&&gs PPath!="")
        1773                         {
        1774                                 sF ullTopicPa th=_getFul lPath(gsPP ath,sTopic );
        1775                                 do cument.loc ation=sFul lTopicPath ;
        1776                         }
        1777                }
        1778                
        1779           }
        1780   }
        1781  
        1782   function g oAvenue(bN ext)
        1783   {
        1784       var iP aram = new  Object();
        1785       iParam .bNext = b Next;
        1786       var oP aram=new O bject();
        1787           oP aram.sAven ue=null;
        1788           va r oMsg=new  whMessage (WH_MSG_GE TCURRENTAV ENUE, iPar am, oParam );
        1789           if (isChromeL ocal())
        1790           {
        1791                //browse  sequence  selection  is not yet  implement ed fully i n webhelp,  
        1792                //so jus t ignoring  current a venue
        1793                onGetCur rentAvenue (oMsg);
        1794           }
        1795           el se    
        1796           re quest(oMsg , onGetCur rentAvenue );
        1797   }
        1798  
        1799   function c anGo(bNext )
        1800   {
        1801           fo r(var i=0; i<gaAvenue s.length;i ++)
        1802           {
        1803                    if(( gaAvenues[ i].sNext!= null&&gaAv enues[i].s Next.lengt h>0&&bNext )||
        1804                             (gaAve nues[i].sP rev!=null& &gaAvenues [i].sPrev. length>0&& !bNext))
        1805                             return  true;
        1806           }
        1807           re turn false ;
        1808   }
        1809  
        1810   function s how()
        1811   {
        1812           va r strUrl =  '';
        1813           if (gbBadUriE rror)
        1814           {
        1815                    var  strMainPag e = docume nt.locatio n.href;
        1816                    var  indx = str MainPage.t oLowerCase ().indexOf ("/mergedp rojects/") ;
        1817                    if(i ndx != -1)
        1818                             strUrl  = strMain Page.subst ring(0, in dx+1) + "w hcsh_home. htm#topicu rl=" + str MainPage.s ubstring(i ndx+1);
        1819                    else  if(gsStar tPage!="")
        1820                             strUrl  =gsStartP age+"#"+gs RelCurPage Path;
        1821           }
        1822           el se if(gsSt artPage!=" ")
        1823                             strUrl  =gsStartP age+"#"+gs RelCurPage Path;
        1824           if (isChromeL ocal())
        1825                    top. location =  strUrl;
        1826           el se
        1827                    wind ow.locatio n = strUrl ;
        1828   }
        1829  
        1830   function h ide()
        1831   {
        1832           if (isChromeL ocal())
        1833                    top. location =  window.lo cation;
        1834           el se if(goFr ame!=null)
        1835           {
        1836                    goFr ame.locati on=window. location;
        1837           }
        1838           el se
        1839           {
        1840                    var  oParam=new  Object();
        1841                    oPar am.oFrame= null;
        1842                    var  oMsg=new w hMessage(W H_MSG_GETS TARTFRAME, null,oPara m);
        1843                    requ est(oMsg);
        1844                    goFr ame=oParam .oFrame;
        1845           if (goFrame ! = null)
        1846                goFrame. location=w indow.loca tion;
        1847           }        
        1848   }
        1849  
        1850   function i sTopicOnly ()
        1851   {
        1852           if (gnTopicOn ly==-1)
        1853           {
        1854                if(isChr omeLocal() )
        1855                {
        1856                    if(w indow.name  == 'bsscm ain' || wi ndow.name  == 'topicw indow') // 'topicwind ow' is for  opening C SH with wi ndow
        1857                         gnTopicOnl y=1; //for  webhelp p ro outputs  one pane  view topic  opens in  a frame wi th name 'b sscmain'
        1858                    else  if (windo w.name ==  'bsscright ' || windo w != top)
        1859                         gnTopicOnl y=0;
        1860                    else
        1861                         gnTopicOnl y=1;
        1862                }
        1863                else
        1864                {
        1865                          var mainW nd = getSt ubPage();
        1866                          if(mainWn d != null)
        1867                                  g nTopicOnly  = 0;
        1868                          else
        1869                                  g nTopicOnly  = 1;
        1870                }
        1871           }
        1872           re turn (gnTo picOnly==1 );
        1873   }
        1874  
        1875   function w ebsearch()
        1876   {
        1877           if (gbNav4)
        1878           {
        1879                    if(d ocument.eh elpform)
        1880                             docume nt.ehelpfo rm.submit( );
        1881           }
        1882           el se
        1883           {
        1884                    if(w indow.ehel pform)
        1885                             window .ehelpform .submit();
        1886           }
        1887   }
        1888  
        1889   function a ddSearchFo rmHref(sHr ef)
        1890   {
        1891           gs SearchForm Href=sHref ;
        1892           en ableWebSea rch(true);
        1893   }
        1894  
        1895   function s earchB(nFo rm)
        1896   {
        1897           va r sValue=e val("docum ent.search Form"+nFor m+".search String.val ue");
        1898           va r oMsg=new  whMessage (WH_MSG_SE ARCHTHIS,  sValue, nu ll);
        1899           no tify(oMsg) ;
        1900   }
        1901  
        1902  
        1903   function g etSearchFo rmHTML()
        1904   {
        1905           va r sHTML="" ;
        1906           gn Form++;
        1907           va r sFormNam e="searchF orm"+gnFor m;
        1908           va r sButton= "<form nam e=\""+sFor mName+"\"  method=\"P OST\" acti on=\"javas cript:sear chB("+gnFo rm+")\">"
        1909           sB utton+="<i nput type= \"text\" n ame=\"sear chString\"  value=\"-  Full Text  search -\ " size=\"2 0\"/>";
        1910           if (""=="text ")
        1911           {
        1912                    sBut ton+="<a c lass=\"sea rchbtn\" h ref=\"java script:voi d(0);\" on click=\""+ sFormName+ ".submit() ;return fa lse;\"></a >";
        1913           }
        1914           el se if(""== "image")
        1915           {
        1916                    sBut ton+="<a c lass=\"sea rchbtn\" h ref=\"java script:voi d(0);\" on click=\""+ sFormName+ ".submit() ;return fa lse;\">"
        1917                    sBut ton+="<img  src=\"\"  border=0>< /a>";
        1918           }
        1919           sB utton+="</ form>";
        1920           sH TML="<td a lign=\"cen ter\">"+sB utton+"</t d>";
        1921           re turn sHTML ;
        1922   }
        1923  
        1924  
        1925  
        1926  
        1927   function s howHidePan e(bShow)
        1928   {
        1929           va r oMsg=nul l;
        1930           if (bShow)
        1931                    oMsg =new whMes sage(WH_MS G_SHOWPANE ,null,null );
        1932           el se
        1933                    oMsg =new whMes sage(WH_MS G_HIDEPANE ,null,null );
        1934           no tify(oMsg) ;
        1935   }
        1936  
        1937   function i sShowHideE nable()
        1938   {
        1939           if (gbIE4)
        1940                    retu rn true;
        1941           el se
        1942                    retu rn false;
        1943   }
        1944  
        1945   var gMsgSe parator =  "::";
        1946   function i nstallList erner_air( )
        1947   {
        1948       /* thi s function  will inst all msg li stener for  browser b ased air h elp */
        1949       if (is ChromeLoca l()) {
        1950           wi ndow.addEv entListene r("message ", onRecei veMsg_air,  false);
        1951       }
        1952   }
        1953  
        1954   function c reateFrame Info()
        1955   {
        1956           va r frameInf o = new Ob ject();
        1957           fr ameInfo.fr ameID = gF rameId;
        1958           fr ameInfo.ti tle = esca pe(documen t.title);
        1959           if (typeof(RH _BreadCrum bDataStrin gVariable)  != 'undef ined')
        1960                frameInf o.breadCru mbString =  escape(RH _BreadCrum bDataStrin gVariable) ;
        1961           el se
        1962                frameInf o.breadCru mbString =  "";
        1963            
        1964           if (typeof(fl ex_previou sLocation)  != 'undef ined')
        1965                frameInf o.previous  = escape( flex_previ ousLocatio n);
        1966           el se 
        1967                frameInf o.previous  = "";
        1968                
        1969           if (typeof(fl ex_nextLoc ation) !=  'undefined ')
        1970                frameInf o.next = e scape(flex _nextLocat ion);
        1971           el se 
        1972                frameInf o.next = " ";
        1973           fr ameInfo.re lativepath  = escape( gsRelCurPa gePath);
        1974           fr ameInfo.ne wLocation  = escape(w indow.loca tion.href) ;
        1975           if (isChromeL ocal())
        1976                    this .parent.po stMessage( "getFrameI nfo" + gMs gSeparator  + JSON.st ringify(fr ameInfo),  "*");
        1977                    else  if(typeof (this.pare nt.updateF rameInfo)  == 'functi on')
        1978                             this.p arent.upda teFrameInf o(frameInf o);
        1979   }
        1980  
        1981   function o nReceiveMs g_air(even t)
        1982   {
        1983       var ms g = event. data.split (gMsgSepar ator);
        1984       var ms gType = ms g[0];
        1985       var ms gData = ms g[1];
        1986       switch (msgType)
        1987       {
        1988       case " startHight light":
        1989           St artHighLig htSearch(m sgData);
        1990           br eak;
        1991       case " getFrameIn fo":
        1992                    gFra meId = msg Data;
        1993           br eak;
        1994         case  "print":
        1995                window.p rint()
        1996                break;
        1997       }
        1998   }
        1999  
        2000   if(window. gbWhUtil & & window.g bWhVer &&  (gbAIRSSL  ||(window. gbWhMsg&&w indow.gbWh Proxy)))
        2001   {
        2002           if (!gbAIRSSL )
        2003           {
        2004                    regi sterListen er("bsscri ght",WH_MS G_GETAVIAV ENUES);
        2005                    regi sterListen er("bsscri ght",WH_MS G_GETTOCPA THS);
        2006                    regi sterListen er("bsscri ght",WH_MS G_NEXT);
        2007                    regi sterListen er("bsscri ght",WH_MS G_PREV);
        2008                    regi sterListen er("bsscri ght",WH_MS G_WEBSEARC H);
        2009           }
        2010           el se
        2011           {
        2012                installL isterner_a ir();   
        2013           }
        2014           if (gbMac&&gb IE4)
        2015           {
        2016                    if(t ypeof(wind ow.onunloa d)!="unkno wn")
        2017                             if(win dow.onunlo ad.toStrin g!=unRegis terListene r.toString )
        2018                                      whtopic_ foldUnload =window.on unload;
        2019           }
        2020           el se
        2021           {
        2022                    if(w indow.onun load)
        2023                             if(win dow.onunlo ad.toStrin g!=unRegis terListene r.toString )
        2024                                      whtopic_ foldUnload =window.on unload;
        2025           }
        2026           wi ndow.onunl oad=unRegi sterListen er;
        2027           
        2028           if (!gbAIRSSL )
        2029                GetSyncE nabled();
        2030           gb WhTopic=tr ue;
        2031   }
        2032   else
        2033           do cument.loc ation.relo ad();
        2034  
        2035   function P ickupDialo g_Invoke()
        2036   {
        2037           if (gbIE4 ||  gbNav6)
        2038           {
        2039                    if(P ickupDialo g_Invoke.a rguments.l ength>2)
        2040                    {
        2041                             var sP ickup="whs kin_pickup .htm";
        2042                             var sP ickupPath= gsPPath+sP ickup;
        2043                             {
        2044                                      var sFra me=PickupD ialog_Invo ke.argumen ts[1];
        2045                                      var aTop ics=new Ar ray();
        2046                                      for(var  i=2;i<Pick upDialog_I nvoke.argu ments.leng th;i+=2)
        2047                                      {
        2048                                               var j=aTop ics.length ;
        2049                                               aTopics[j] =new Objec t();
        2050                                               aTopics[j] .m_sName=P ickupDialo g_Invoke.a rguments[i ];
        2051                                               aTopics[j] .m_sURL=Pi ckupDialog _Invoke.ar guments[i+ 1];
        2052                                      }
        2053  
        2054                                      if(aTopi cs.length> 1)
        2055                                      {
        2056                                               var nWidth =300;
        2057                                               var nHeigh t=180;
        2058                                               var     nS creenWidth =screen.wi dth;
        2059                                               var     nS creenHeigh t=screen.h eight;
        2060                                               var nLeft= (nScreenWi dth-nWidth )/2;
        2061                                               var nTop=( nScreenHei ght-nHeigh t)/2;
        2062                                               {
        2063                                                       va r vRet=win dow.showMo dalDialog( sPickupPat h,aTopics, "center:ye s;dialogHe ight:"+nHe ight+"px;d ialogWidth :"+nWidth+ "px;resiza ble:yes;st atus:no;sc roll:no;he lp:no;");
        2064                                                       if (vRet)
        2065                                                       {
        2066                                                                var  sURL=vRet. m_url;
        2067                                                                if(s Frame)
        2068                                                                         window .open(sURL ,sFrame);
        2069                                                                else
        2070                                                                         window .open(sURL ,"_self");
        2071                                                       }
        2072                                               }
        2073                                      }
        2074                                      else if( aTopics.le ngth==1)
        2075                                      {
        2076                                               var sURL=a Topics[0]. m_sURL
        2077                                               if(sFrame)
        2078                                                       wi ndow.open( sURL,sFram e);
        2079                                               else
        2080                                                       wi ndow.open( sURL,"_sel f");
        2081                                      }
        2082                             }
        2083                    }
        2084           }
        2085           el se
        2086           {
        2087                    if(t ypeof(_Pop upMenu_Inv oke)=="fun ction")
        2088                             return  _PopupMen u_Invoke(P ickupDialo g_Invoke.a rguments);
        2089           }
        2090   }
        2091  
        2092   function e scapeRegEx p(str)
        2093   {
        2094           va r specials  = new Reg Exp("[.*+? |()\\^\\$\ \[\\]{}\\\ \]", "g");  // .*+?|( )^$[]{}\
        2095           re turn str.r eplace(spe cials, "\\ $&");
        2096   }