var value = new Date();
var caldate = new Date();

value = value.toGMTString();
caldate = caldate.toGMTString();
<!--
function writeCookie(name, value, path)
{
// Delete old cookie
delete_cookie("CAARDATE");

// Build the expiration date string:
var expiration_date = new Date();
expiration_date.setYear(expiration_date.getYear() + 1);
expiration_date = expiration_date.toGMTString();

// Making the date received into variable value a text string
caldate = value.value;

// Build the set-cookie string:
var cookie_string = escape(name) + "=" + escape(caldate) + "; expires=" + expiration_date;
if (path != null)
cookie_string += "; path=" + path;

// Create/update the cookie:
document.cookie = cookie_string;
}

function readCookie(key, skips) {
// Set skips to 0 if parameter was omitted:
if (skips == null)
  skips = 0;

// Get cookie string and separate into individual cookie phrases:
var cookie_string = "" + document.cookie;
var cookie_array = cookie_string.split("; ");

// Scan for desired cookie:
for (var i = 0; i < cookie_array.length; ++ i) {
  var single_cookie = cookie_array[i].split("=");
  if (single_cookie.length != 2)
    continue;
  var name  = unescape(single_cookie[0]);
  value = unescape(single_cookie[1]);

  // Return cookie if found:
  if (key == name && skips -- == 0) {
    curmth = parseFloat(value.toString().substring(0,2)-1);
    curdte = parseFloat(value.toString().substring(3,5));
    mthbeg = new Date(today.getFullYear(), curmth, 1);
    mthend = new Date(today.getFullYear(), curmth+1, 1);
    mthend.setDate(mthend.getDate()-1);
    strpos = mthbeg.getDay();
    return value;
  }
}

// Cookie was not found:
value = ((((today.getMonth()+1) < 10) ? ("0" + "" + (today.getMonth()+1).toString()) : (today.getMonth()+1).toString()) 
	   + "/" + 
	   ((today.getDate() < 10) ? ("0" + "" + today.getDate().toString()) : (today.getDate().toString())) 
	   + "/" + 
	   today.getFullYear().toString());
curmth = parseFloat(value.toString().substring(0,2)-1);
curdte = parseFloat(value.toString().substring(3,5));
mthbeg = new Date(today.getFullYear(), curmth, 1);
mthend = new Date(today.getFullYear(), curmth+1, 1);
mthend.setDate(mthend.getDate()-1);
strpos = mthbeg.getDay();
return value;
}

function delete_cookie(name, path)
{
// Build expiration date string:
var expiration_date = new Date();
expiration_date.setYear(expiration_date.getYear() - 1);
expiration_date = expiration_date.toGMTString();

// Build set-cookie string:
var cookie_string = escape(name) + "=; expires=" + expiration_date;
if (path != null)
cookie_string += "; path=" + path;

// Delete the cookie:
document.cookie=cookie_string;
}
//-->