	function getexpirydate( nodays){
		var UTCstring;
		Today = new Date();
		nomilli=Date.parse(Today);
		Today.setTime(nomilli+nodays*24*60*60*1000);
		UTCstring = Today.toUTCString();
		return UTCstring;
	}


   function isCookiesEnabled() {
      var cookieEnabled=(navigator.cookieEnabled)? true : false;
      //if navigator,cookieEnabled is not supported
      if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){
          document.cookie="testcookie";
          cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false;
      }
      return cookieEnabled;      
   }

   function setPersistendCookie(name, value) {
      var expire = new Date();
      //add 50 years - kind of making it persistend
      var dateBuffy = expire.getTime() + (50 * 365 * 24 * 60 * 60 * 1000);
      expire.setTime(dateBuffy);
      setCookie(name, value, expire);
   }

   //Made especially for Remember Me    - It needs the PATH
   function setFixedCookie(name, value, path) {
      var expire = new Date();
      //add 50 years - kind of making it persistend
      var dateBuffy = expire.getTime() + (50 * 365 * 24 * 60 * 60 * 1000);
      expire.setTime(dateBuffy);
      setCookie(name, value, expire, path);  
   }

   var setPersistentCookie=setPersistendCookie;

   function getCookie(name) {
    var dasCookie = document.cookie;
    var index = dasCookie.indexOf(name + "=");
    if (index == -1) return null;
    index = dasCookie.indexOf("=", index) + 1; // first character
    var endstr = dasCookie.indexOf(";", index);
    if (endstr == -1) endstr = dasCookie.length; // last character
    return unescape(dasCookie.substring(index, endstr));
   }


   function setCookie (name, value) {  
      var argv = setCookie.arguments;  
      var argc = setCookie.arguments.length;  
      var expires = (argc > 2) ? argv[2] : null;  
      var path = (argc > 3) ? argv[3] : null;  
      var domain = (argc > 4) ? argv[4] : null;  
      var secure = (argc > 5) ? argv[5] : false;  
      document.cookie = name + "=" + escape (value) + 
      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
      ((path == null) ? "" : ("; path=" + path)) +  
      ((domain == null) ? "" : ("; domain=" + domain)) +    
      ((secure == true) ? "; secure" : "");
   }

   
   function deleteCookie (name) { 
      var exp = new Date();  
      exp.setTime (exp.getTime() - 100000);  

      var argv = deleteCookie.arguments;  
      var argc = deleteCookie.arguments.length;  
      var path = (argc > 1) ? argv[1] : null;  
      var domain = (argc > 2) ? argv[2] : null;  
      var secure = (argc > 3) ? argv[3] : false;  

      var cval = getCookie (name);
      document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() +
	      ((path == null) ? "" : ("; path=" + path)) +  
	      ((domain == null) ? "" : ("; domain=" + domain)) +    
	      ((secure == true) ? "; secure" : "");
   } 