function CookieManager() {
	this.get = function(key) {
		var cookieList = document.cookie.split(";");
		
		for(var i=0; i<cookieList.length; i++) {
			var cookie = cookieList[i];
			while(cookie.charAt(0) == " ") {
				cookie = cookie.substr(1);
			}
			
			if(cookie.indexOf(key + "=") == 0) {
				return cookie.substr(key.length + 1);
			}
		}
		
		return null;
	}
	
	this.set = function(key, value, days) {
		var date = new Date();
		if(!days) {
			days = 730;
		}
		date.setTime(date.getTime() + 1000 * 60 * 60 * 24 * days);
		date = date.toGMTString();
		
		document.cookie = key + "=" + value + "; expires=" + date + "; path=/";
	}
	
	this.erase = function(key) {
		this.set(key, "", -1);
	}
}