
var lastUpdated = new Date("Tue, 28 Dec 2010");

function getCookieValue(cookieName)
{
   var cookieValue = document.cookie;
   var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");

   if (cookieStartsAt == -1)
   {
      cookieStartsAt = cookieValue.indexOf(cookieName + "=");
   }

   if (cookieStartsAt == -1)
   {
      cookieValue = null;
   }
   else
   {
      cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
      var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
      if (cookieEndsAt == -1)
      {
         cookieEndsAt = cookieValue.length;
      }
      cookieValue = unescape(cookieValue.substring(cookieStartsAt,
         cookieEndsAt));
   }

   return cookieValue;
}

function setCookie(cookieName, cookieValue, cookiePath, cookieExpires)
{
   cookieValue = escape(cookieValue);

   if (cookieExpires == "" | cookieExpires == null)  // check for null for netscape
   {
      var nowDate = new Date();
      nowDate.setMonth(nowDate.getMonth() + 36);
      cookieExpires = nowDate.toGMTString();
   }
   
   if (cookiePath == null) { cookiePath = "";}  // required by netscape

   if (cookiePath != "")
   {
      cookiePath = ";Path=" + cookiePath;
   }

   document.cookie = cookieName + "=" + cookieValue + 
      ";expires=" + cookieExpires + cookiePath;
   return true;
}


