// Create a cookie with the specified name and value.
// The cookie expires at the end of the 20th century.
function SetCookie(sName, sValue){
  document.cookie = sName + "=" + escape(sValue) + ";expires=Fri, 31 Dec 2010 23:59:59 UTC;path="+escape("/")+";";
}
// Create a temporary cookie with the specified name and value.
// The cookie is deleted automatically when all Web browser windows are closed
function SetSessionCookie(sName, sValue){
  document.cookie = sName + "=" + escape(sValue) + ";path="+escape("/")+";";
}
// Delete a cookie with the specified name
function DeleteCookie(sName){
  document.cookie = sName + "=" + escape("") + ";expires=Mon, 01 Jan 1990 23:59:59 UTC;path="+escape("/")+";";
}
// Retrieve the value of the cookie with the specified name.
function GetCookie(sName){
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    var name=aCrumb[0];
    var val=(typeof(aCrumb[1])=='undefined'?'':aCrumb[1]);
    
    if (sName==name){ return unescape(val);}
  }
  // a cookie with the requested name does not exist
  return null;
}
jsLoaded++;
