<!--Begin
// NOTE:  These are really more elaborate than we need here but they are 
//        useful, generecized functions for writing & reading any cookie's value.
function write_cookie(cookieName,cookieValue,cookiePath,cookieExpires)
{
    cookieValue = escape(cookieValue);
    if(cookieExpires != "") cookieExpires = ";expires="+cookieExpires;
    if(cookiePath      !="") cookiePath      = ";Path="    +cookiePath;
    document.cookie = cookieName + "=" + cookieValue + cookieExpires + cookiePath;
}    
function read_cookie(cookieName)
{
    var cookieValue = document.cookie;
    var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");  // Will work if cookie is not first in string
    if (cookieStartsAt == -1){
        cookieStartsAt = cookieValue.indexOf(cookieName + "=");  // Will work if cookie is first in string
    }
    if (cookieStartsAt == -1){
          cookieStartsAt = null;  // Land here if cookieName is not in cookie list
      }else{
        cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;   // Find where value starts
        var cookieEndsAt = cookieValue.indexOf(";",cookieStartsAt);
        if (cookieEndsAt == -1){
            cookieEndsAt = cookieValue.length;
        }
        cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));
    }
    return cookieValue;
}
// End -->
