function Cookie(name, value)
{
	this.name 		= name,
	this.value 		= value,
	this.expires 	= null,
	this.path 		= null,
	this.domain 	= null,
	this.secure 	= false,
	
	this.save = function(){
		if(this.name!=null && this.value!=null){
			document.cookie = 
				this.name + "=" + escape(this.value) +
				((this.expires!=null)?"; expires="+this.expires.toGMTString():"") +
				((this.path!=null)?"; path="+this.path:"") +
				((this.domain!=null)?"; domain="+this.domain:"") +
				((this.secure)?"; secure":"");
			return true;
		}
		return false;
	},
	
	this.read = function(){
		if(document.cookie.length==0 || this.name==null)
			return false;
		var cookieList=document.cookie.split('; ');
		for(var i=0; i<cookieList.length; i++){
			var cookie = cookieList[i].split('=');
			if(cookie[0]==this.name){
				if(typeof(cookie[1])=='undefined')
					return false;
				this.value = unescape(cookie[1]);
				return true;
			}
		}
	}, 
	
	this.remove = function(){
		var expires = new Date();
		expires.setDate(-1);
		this.value = '';
		this.expires = expires;
		return this.save();
	}
}
