      function setCookie(name, value, days) { 
		//alert("SET");
		expiration = new Date(); 
        expiration.setTime(expiration.getTime() + (86400000*days)); 

        document.cookie = name+"="+escape(value)+";expires="+expiration.toGMTString(); 
      } 

      function getCookie(name) { 
		//alert("GET");
        cookielength = document.cookie.length; 
        pos = 0; 
        res = ""; 

        while (pos < cookielength) { 
          entryEnd = document.cookie.indexOf(";", pos); 
          if (entryEnd == -1) entryEnd = cookielength; 
          part = document.cookie.substring(pos, entryEnd); 
          sepPos = part.indexOf("=", 0); 
          key = part.substring(0,sepPos); 
          val = part.substring(sepPos+1); 
          if (key == name) { 
            res = unescape(val); 
            break; 
          } 
          pos = entryEnd+2; 
        } 
        return (res); 
      } 