function Cookie() {
   this.values = [];
   var allCookies = document.cookie.split(";");
   for (i=0; i < allCookies.length; ++i) {
      var _c = allCookies[i].split("=");
      this.values[_c[0]] = _c[1];
   }
   this.Get = function(_name, _default) {
      return (_name in this.values) ? this.values[_name] : _default;
   }
   this.Put = function(_name, _new) {
      var _old = this.values[_name];
      this.values[_name] = _new;
      return _old;
   }
   this.Save = function() {
      var _cookies = "";
      for (var _key in this.values) {
         if (_cookies.length) _cookies += ";";
         _cookies += (_key + "=" + this.values[_key]);
      }
      document.cookie = _cookies;
   }
}
