//----------------------------------------------------------------------------
// Set a cookie given a name, value and expiration date.
//----------------------------------------------------------------------------
function setCookie (name, value,len) {
var date = new Date ();
len = len || 86400 * 1000 * 2;
date.setTime (date.getTime() + len * 1000);
//----------------------------------------------------------------------------
// Returns the value of the named cookie.
//----------------------------------------------------------------------------
function getCookie(name) {
var search;
search = name + "=";
offset = document.cookie.indexOf(search) ;
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.substring(offset, end));
}
else
return "";
}