
function SetCookie(strName, strValue, strExpires, strPath, strDomain, strSecure)
{
  document.cookie = strName + "=" + escape(strValue) +
    ( (strExpires) ? ";expires=" + strExpires.toGMTString() : "") +
    ( (strPath)    ? ";path="    + strPath                  : "") +
    ( (strDomain)  ? ";domain="  + strDomain                : "") +
    ( (strSecure)  ? ";secure"                              : "");
}

function GetCookie(strName)
{
  var iStart = document.cookie.indexOf(strName + "=");
  var iLen   = iStart + strName.length + 1;
  if ((!iStart) && (strName != document.cookie.substring(0, strName.length))) { return null; }
  if (iStart == -1) { return null; }
  var iEnd = document.cookie.indexOf(";", iLen);
  if (iEnd == -1) { iEnd = document.cookie.length; }
  return(unescape(document.cookie.substring(iLen, iEnd)));
}


