
var cookie = {
  write : function (theName__,theValue__){
    if ((theName__ != null) && (theValue__ != null)){
      var expDay__ = "Wed, 01 Jan 2020 18:56:35 GMT"; // default
      var setDay = new Date();
      //setDay.setTime(setDay.getTime()+(theDay__*1000*60*60*24));
      setDay.setTime(setDay.getTime()+(1000*60*60));	// make experation time = 1 hour away
      expDay__ = setDay.toGMTString();
      document.cookie = theName__ + "="+escape(theValue__)+";expires="+expDay__;
      return true;
    }
    return false;
  },

  read : function (theName__){
    theName__ += "="; // =??????????????
    theCookie__ = document.cookie+";"; // ????????-1???????
    start__ = theCookie__.indexOf(theName__); // ????????????
    if (start__ != -1){
      end__ = theCookie__.indexOf(";",start__);
      return unescape(theCookie__.substring(start__+theName__.length,end__));
    }
    return false;
  }
}
