// bump-cookie  invoke via < script src=bump-cookie.js >  just after  <BODY  and
// let user know about View; text size
// 10/04/04 do NOT log it here as it is best to  
//	1) bump and have LastVisit available early and 
//	2) not have doc.write earily as it causes white space in the viewed document
//     re: path, allow default, do NOT force it. Default allows each page to have it's own Lastvisit
//   There is NOT a document.write here ( so it's safe to put this at the top)

// This function writes or replaces the cookie Name/Value  (browser decides if only update or new)

function setCookie (name, value) {   // 6 months =24 * 7 *26 = 4368
//                                 . --now---.                                   .- 6months in minutes
//                                |                  |                             |          |  
var expDate  =  (   new Date( (new Date())  .getTime() + 4368*3600000 )  ).toGMTString();
//                             '---------now in minutes              + 6Months -----'
// GMT string   of   "=========================================="
 document.cookie = name + "=" + value +	";expires=" + expDate  ;         //cookie string has no training semi 
// did he accept a persistant cookie?   : nope a try session cookie (i.e. date=0)
if ( document.cookie == null ) document.cookie = name + "=" + value; 
}
// get a SINGLE value from the cookie   or  .FALSE.
function WM_getCookieValue(name) {
  var firstChar, lastChar;
  var theBigCookie = document.cookie;   
  firstChar = theBigCookie.indexOf(name);  if(firstChar == -1) return false;
  firstChar += name.length + 1;  //advance pointer past name and "=" to VALUE
  lastChar = theBigCookie.indexOf(";", firstChar);  if(lastChar == -1) lastChar = theBigCookie.length;   // no ending ";" for last n=v pair
  return theBigCookie.substring(firstChar, lastChar);  // returns string  or false
}

//------------- set up cookies        
var User, Cnt, LastVisit, PriorVisit ;
LastVisit = new Date().getTime(); 
if( !( WM_getCookieValue("U") ) ){  User = LastVisit; setCookie("U",User+ ""); 
				                    setCookie("C","0" );  };
User=  WM_getCookieValue("U"); 
 User=parseInt( User ); if(isNaN(User) )User = LastVisit;
Cnt =  WM_getCookieValue("C"); 
 Cnt =parseInt( Cnt  ); if(isNaN(Cnt ) )Cnt =800;   
 if(Cnt>999) Cnt%=900;   
Cnt++; 

setCookie("U",User     + "" );
setCookie("C",Cnt      + "" ); 
setCookie("L",LastVisit+ "" );
//                             ////  end of bc.js ///                    ////// 
