
function mMz()
{
 var mPz = "";
 for(var prop in this) {
 if ((prop.charAt(0) == '_' && prop.charAt(prop.length-1)=='_')
		      || ((typeof this[prop]) == 'function')) 
 continue;
 if (mPz != "") mPz += '&';
 mPz += prop + ':' + escape(this[prop]);
 }
 var cookie = this._name_ + '=' + mPz;
 if (this._expiration_)
 cookie += '; expires=' + this._expiration_.toGMTString();
 if (this._path_) cookie += '; path=' + this._path_;
 if (this._domain_) cookie += '; domain=' + this._domain_;
 if (this._secure_) cookie += '; secure';
 
 this._document_.cookie = cookie;
}

function mQz()
{
 var mOz = this._document_.cookie;
 if (mOz == "") return false;
 
 var start = mOz.indexOf(this._name_ + '=');
 if (start == -1) return false;   
 start += this._name_.length + 1;  
 var end = mOz.indexOf(';', start);
 if (end == -1) end = mOz.length;
 var mPz = mOz.substring(start, end);

 var a = mPz.split('&'); 
 for(var i=0; i < a.length; i++)  
 a[i] = a[i].split(':');

 for(var i = 0; i < a.length; i++) {
 this[a[i][0]] = unescape(a[i][1]);
 }
 return true;
}

function Cookie(document, name, hours, path, domain, secure)
{
 this._document_ = document;
 this._name_ = name;
 if (hours)
 this._expiration_ = new Date((new Date()).getTime() + hours*3600000);
 else this._expiration_ = null;
 if (path) this._path_ = path; else this._path_ = null;
 if (domain) this._domain_ = domain; else this._domain_ = null;
 if (secure) this._secure_ = true; else this._secure_ = false;
 this.store = mMz;
 this.load = mQz;
}
