function SupportsCookies() {
   var sCookie = new String("");
   var bRC = false;

   SetCookie("CookieTest", "True");            
   sCookie = GetCookie("CookieTest");

   if("True" == sCookie) 
   { 
     bRC = true;
   }

   delete sCookie;   
   return bRC;
}

function GetCookie(name) {

   if(typeof document.cookie == "string"){
      var start = document.cookie.indexOf(name+"=");
      var len = start+name.length+1;

      if ((!start)&& (name != document.cookie.substring(0,name.length))){
         return null;
      }

      if (start == -1) return null;

      var end = document.cookie.indexOf(";",len);

      if (end == -1) end = document.cookie.length;

      return unescape(document.cookie.substring(len,end));
   }else{
      /* document.cookie is not a string so return an
         empty string. When tested this will type-convert to
         boolean false (accurately) giving the impression that
         client-side cookies are not available on this system:-
      */
      return "";
   }

}

function SetCookie(name,value,expires,path,domain,secure) {
   if(typeof document.cookie == "string"){
      document.cookie = name + "=" +escape(value) +
         ( (expires) ? ";expires=" + expires.toGMTString() : "") +
         ( (path) ? ";path=" + path : "") +
         ( (domain) ? ";domain=" + domain : "") +
         ( (secure) ? ";secure" : "");
   }//else document.cookie is not a string so do not write to it.
}

function DeleteCookie(name,path,domain) {

   if (Get_Cookie(name)) {
      document.cookie = name + "=" +
         ( (path) ? ";path=" + path : "") +
         ( (domain) ? ";domain=" + domain : "") +
         ";expires=Thu, 01-Jan-70 00:00:01 GMT";
   }
}

