// only for IE browsers
// highlight the first instance of each word listed in the glossary
// only applies to innerHTML content of a tag with 'PageContent' as id
// the css awcGlossaryCSS class used here should be defined in the web's css file
function DoHighlights(){
  if(document.all.item("PageContent")){
    if(navigator.appName.indexOf("Microsoft")!=-1 && navigator.userAgent.indexOf("Mozilla/4")!=-1){
      var _iLoop;
      var _objReg;
      var _sBody;
      var _objColl;    //tag collection
    
      // retrieve the content of the page, tags and all
      _sBody=PageContent.innerHTML;

      /*
       -for each term in the sTermsAry(provided by a separate include), find every occurence of the term in the _sBody string and 
        insert a span tag around that contains the styling class attribute for glossary terms
       -however, skip any occurence found inside a tag 
      */

      for(_iLoop=0;_iLoop<sTermsAry.length;_iLoop++){
        _objReg=new RegExp("(^[^<>]*|<[^(textarea)(a)(h):x][^>]*>[^<]*?)(\\b)("+sTermsAry[_iLoop]+")(\\b)","im")
        _sBody=_sBody.replace(_objReg,"$1$2<a href='javascript:DefineTerm(\"$3\");' class='awcGlossaryCSS'>"+"$3"+"</a>$4");
        }

      // replace the page content with the revised version
      PageContent.innerHTML=_sBody;
      }
    }
  }
document.body.onload=function(){DoHighlights();};