<!-- Hide the script from browsers that don't support it

function GetCookie(name) {
  var fields = '';
  var cookiecontent = '';
  if (document.cookie.length > 0) {
    var cookiename = 'user=';
    var cookiebegin = document.cookie.indexOf(cookiename);
    var cookieend = 0;
    if (cookiebegin > -1) {
      cookiebegin += cookiename.length;
      cookieend = document.cookie.indexOf(";",cookiebegin);
      if (cookieend < cookiebegin) { cookieend = document.cookie.length; }
      fields = document.cookie.substring(cookiebegin,cookieend);
      cookiename = name + '^';
      cookiebegin = fields.indexOf(cookiename);
      cookieend = 0;
      if (cookiebegin > -1) {
        cookiebegin += cookiename.length;
        cookieend = fields.indexOf("|",cookiebegin);
        if ( cookieend < cookiebegin) { cookieend = fields.length; }
        cookiecontent = fields.substring(cookiebegin,cookieend);
        cookiecontent = unescape(cookiecontent);
      }
    }
  }
return cookiecontent;
}

// Replace the name/value pair. If it does not exist, add it.
function ReplaceCookie(name,value) {
  DeleteCookie(name);
  AddCookie(name,value);
}

// Remove the name/value pair.
function DeleteCookie(name) {
  var fields = '';
  var cookiecontent = '';
  if (document.cookie.length > 0) {
    var cookiename = 'user=';
    var cookiebegin = document.cookie.indexOf(cookiename);
    var cookieend = 0;
    if (cookiebegin > -1) {
      cookiebegin += cookiename.length;
      cookieend = document.cookie.indexOf(";",cookiebegin);
      if (cookieend < cookiebegin) { cookieend = document.cookie.length; }
      fields = document.cookie.substring(cookiebegin,cookieend);
      cookiename = name + '^';
      cookiebegin = fields.indexOf(cookiename);
      cookieend   = 0;
      if (cookiebegin > -1) { // Verify that the cookie is present
                // find the end of the cookie
        cookieend = fields.indexOf('|',cookiebegin);
                // if the end is not found, assume the end of the string
        if (cookieend < cookiebegin) { cookieend = fields.length; }
                // extract the beginning fields
        cookiecontent = fields.substring(0,cookiebegin);
                // if the end is before the end of the string,
                // extract the ending fields
        if (cookieend < fields.length) { 
          cookiecontent += fields.substring(cookieend + 1); 
        }
                // store the new cookie contents back
        fields = cookiecontent;
      }
    }
  }
  // update the cookie
  var exp = new Date();
  exp.setTime(exp.getTime() + (365 * 24 * 60 * 60 * 1000));
  fields += "; expires=" + exp.toGMTString() + "; path=/;";
  document.cookie = 'user=' + fields;
  return;
}

// Add the name/value pair.
function AddCookie(name,value) {
  var fields = '';
  if (document.cookie.length > 0) {
    var cookiename = 'user=';
    var cookiebegin = document.cookie.indexOf(cookiename);
    var cookieend = 0;
    if (cookiebegin > -1) {
      cookiebegin += cookiename.length;
      cookieend = document.cookie.indexOf(";",cookiebegin);
      if (cookieend < cookiebegin) { cookieend = document.cookie.length; }
      fields = document.cookie.substring(cookiebegin,cookieend);
    }
  }
  // update the cookie
  fields += name + '^' + escape(value,1) + '|';
  var exp = new Date();
  exp.setTime(exp.getTime() + (365 * 24 * 60 * 60 * 1000));
  document.cookie = 'user=' + fields + "; expires=" + exp.toGMTString() + "; path=/;";
  return;
}
// End of hiding -->
