function readCookie()
{
  var the_cookie = WM_readCookie("wm_javascript");
  var broken_cookie = the_cookie.split(":");
  var the_name_part = broken_cookie[1];
  var broken_name = the_name_part.split(";");
  var the_name = broken_name[0];
  frmLogon.strLogon.value = the_name;
 
}


function WM_readCookie(name) {

  // if there's no cookie, return false else get the value and return it

  if(document.cookie == '') return false;
  else return unescape(WM_getCookieValue(name));

}

function WM_getCookieValue(name)
{
  // Declare variables.
  var firstChar, lastChar;

  // Get the entire cookie string. (This may have other name=value pairs in it.)
  var theBigCookie = document.cookie;

  // Grab just this cookie from theBigCookie string.

  // Find the start of 'name'.
  firstChar = theBigCookie.indexOf(name);

  // If you found it,
  if(firstChar != -1)
{
  // skip 'name' and '='.
  firstChar += name.length + 1;

// Find the end of the value string (i.e. the next ';').
    lastChar = theBigCookie.indexOf(';', firstChar);

    if(lastChar == -1) lastChar = theBigCookie.length;

    // Return the value.
    return theBigCookie.substring(firstChar, lastChar);

  } else {
    // If there was no cookie, return false.
    return false;
  }
}


