   <!-- hide code from old browsers

    //Copyright 1996.  This program was written by Nestor Siu
    //You may freely use this program as long as it's for non-comercial
    //purposes.

    // September 2, 1999
    //  - Re-wrote WriteCounterCookie so that it would
    //    write out only 1 counter image, so that it can work in
    //    Netscape 3.0.
    //  - added dbprint to print debug messages.

    Debug = 0; // debug level

  //----------------------------------------------
  // function WriteCounterCookie(CounterScript, UserNm, PageNum,
  //                             CnWidth, CnHeight, BaseUrl, 
  //                             FontName, NumWidth,
  //                             BWidth, BDepth, BColor )
  //   This function is called to write the proper
  //   <img> tag to display the proper counter.
  //   Note that it uses cookies to check if the
  //   counter has been loaded.  This function
  //   is meant to be called within the html document
  //   right where you want the counter image displayed.
  // Input: CounterScript is URL to the perl counter script.
  //        UserNm is the usernane for CounterScript, and PageNum
  //        is the page number you want to increment.
  //        CnWidth  and CnHeight are the width and height
  //        BaseUrl - the base url for the entire site.
  //        FontName - the font type to use
  //        NumWidth - the width of the counter (ie) # of characters)
  //        BWidth - the thickness of the border to add
  //        BDepth - the depth of the bevel to add to the border
  //        BColor - the color of the boder (specified in hex. RRGGBB)
  // Note- the cookie is set to expire after the browser is
  //       shut down.
  //----------------------------------------------
  function WriteCounterCookie(
             CounterScript,
             UserNm,
             PageNum,
             CnWidth, CnHeight,
             BaseUrl,
             FontName,
             NumWidth,
             BWidth, BDepth, BColor ) {

      dbprint( 2, "Writing counter image" );

      // --- generate width and height strings
      WidthStr = "";
      HeightStr = "";
      if ( CnWidth > 0 ) {
        WidthStr = "width=" + CnWidth;
      }
      if ( CnHeight > 0 ) {
        HeightStr = "height=" + CnHeight;
      }

      // --- generate border parameter string
      BorderStr = "";
      if ( ( (BWidth > 0) && (BDepth > 0) ) && ( BColor != "" ) ) {
        BorderStr = "&bwidth=" + BWidth;
        BorderStr += "&bdepth=" + BDepth;
        BorderStr += "&bcolor=" + BColor; 
      }

      // --- generate number width string
      NumWidthStr ="";
      if ( NumWidth >= 0 ) {
        NumWidthStr = '&numwidth=' + NumWidth;
      }
    
      // --- generate font parameter
      FontStr = '&font=' + ( ( FontName == "" ) ? "plain" : FontName );

      // --- extract page numbers stored in CountHit and see if it
      //     matches current page
      CountHit = new MultiStr( GetCookie( 'CountHit' ) );
      PageIsHit = false;
      while ( ( HitPage = CountHit.ExtractNext() ) != null ) {
        HitUser = HitPage.substring( 0, HitPage.indexOf( " " ) );
        HitPage = parseInt( HitPage.substring( HitPage.indexOf( " " ) + 1 ) );
        dbprint( 2, "HitPage='" + HitPage + "' HitUser='" + HitUser + "'" );

        if ( ( HitPage == PageNum )
          && ( HitUser == UserNm ) ) {
          PageIsHit = true;
          dbprint( 1, "We've been to this page! page=" + HitPage );
	}
      }

      HitStr = ""; // stores the "hit=?" value to be printed in img URL;
      RefStr = ""; // stores the "ref=?" value to be printed in img URL;

      // --- if page wasn't hit, update server count
      if ( !PageIsHit ) { // if counter hasn't been hit
        dbprint( 1, "Updating page count" );
        SetCookie( 'CountHit', CountHit.Str + ':' + UserNm + ' ' + PageNum,
                   null, BaseUrl );  // remember we've been hit

	// Check if user wanted to set cookie
        if (GetCookie('CountHit') == null) {
          dbprint( 1, 'Cookie not set!');
          HitStr = "&hit=t";        // we're increasing counter count
          RefStr = "&ref=NoCookie"; // remember user did not want cookie
                                    //   update count with generic counter
                                    //   ie) without recording referrence
        }
        else {                // else cookie was set
                              //   so update counter with record referrence

          dbprint( 2, "Cookie was set properly!" );
          HitStr = "&hit=t";        // we're increasing counter count
          RefStr = '&ref='+ escape(document.referrer);
                                    // remember where user came from
        }
      }
      else {

        dbprint( 1, "Page has already been visited" );
        // --- Page has already been hit, so just view counter
          HitStr = "&hit=f";        // we're just viewing counter

      }

      dbprint( 2, "Generating counter image!" );
      document.write('<img src="'+ CounterScript
                   + '?user=' + UserNm
                   + '&page=' + PageNum
                   + HitStr
                   + FontStr
                   + NumWidthStr
                   + BorderStr
                   + RefStr
                   +  '" ' +  WidthStr + ' ' + HeightStr
                   + '>');
  }
  
//------------------------------------------------
// function dbprint( DBLevel, TheStr )
//  This function is used to display debugging messages.
//  input: DBLevel - the debug level.  Message is print out
//                   if the variable Debug >= DBLevel
//         TheStr - the string to print
//------------------------------------------------
function dbprint( DBLevel, TheStr ) {
  if ( Debug >= DBLevel ) {
    alert( TheStr );
  }
}

//------------------------------------------------
//  Class MultiStr( Str )
//    This is a class that defines a multi-part string which is
//    separated by a ':'.
//      eg) 1:200:356
//    Each of the parts in the object can be accessed by calling
//    the ExtractNext() method.
//  Input:
//    Str - the ':' separated list 
//------------------------------------------------
function MultiStr( Str ) {
  this.Str = ( Str == null ) ? "" : Str;
                        // our ':' separated list
  this.Pos = 0;		// start at beginning of list
  this.Separator = ':';	// our separator symbol ':'
  this.ExtractNext = MultiStr_ExtractNext;
}

//------------------------------------------------
// method string MultiStr_ExtractNext()
//   This method will return the next field in our
//   ':' separated list.  If the list is empty, it return null.
//------------------------------------------------
function MultiStr_ExtractNext() {

  var NextStr = "";	// the string to return

  if ( this.Pos < this.Str.length ) {

    // --- find first non ':' character
    while ( ( this.Str.charAt( this.Pos ) == this.Separator )
         && ( this.Pos < this.Str.length ) ) {
      this.Pos ++;
    }

    // --- extract characters into NextStr until we encounter separator
    while ( ( this.Str.charAt( this.Pos ) != this.Separator )
         && ( this.Pos < this.Str.length ) ) {
      NextStr += this.Str.charAt( this.Pos );
      this.Pos ++;
    }

    return NextStr;
  }

  else return null;

}


//finished hiding -->
