
      function GetCookieVal (offset) {
         var endstr = document.cookie.indexOf (";", offset);
         if (endstr == -1)
            endstr = document.cookie.length;

         //alert("The value of the cookie to be deleted is " + unescape(document.cookie.substring(offset, endstr))); //remove this on deployment
         return unescape(document.cookie.substring(offset, endstr));
      }

      function GetCookie(name)
      {
         var argName = name + "=";
         var argLen = argName.length;
         var cookieLen = document.cookie.length;
         var i = 0;
         while (i < cookieLen)
         {
            var offset = i + argLen;
            if (document.cookie.substring(i,offset) == argName) return GetCookieVal(offset);
               i = document.cookie.indexOf(" ",i) + 1;
               if (i==0) break;
         }
         return null;
      }

      function DeleteCookie (name,path,domain) {
         if (GetCookie(name)) {
            document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
         }
      }

      function SetCookie (name,value,expires,path,domain,secure) {
         document.cookie = name + "=" + escape (value) +
         ((expires) ? "; expires=" + expires.toGMTString() : "") +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         ((secure) ? "; secure" : "");
      }

      function checktester(unit,name,value) {
         if (unit.checked) {
	         SetCookie(name,value);
         }
         else {
            DeleteCookie(name);
         }
     
      }
