CookieManager = Class.create();
CookieManager.prototype = {

initialize: function(option) {
	this.props = { path: '/', expire: 0 };
	if(option) for(var key in option) this.props[key] = option[key];
},

getCookie: function(cookieName) {
	var cookies = document.cookie.split('; ');
	var cookieVal = null;
	for (var i = 0; i < cookies.length; i++) {
		var names = cookies[i].split('=');
		if (names[0] == cookieName) {
			cookieVal = names[1];
			break;
		}
	}
	return cookieVal;
},

setCookie: function(cookieName, cookieVal) {
	var expires = '';
	if (this.props.expire > 0) {
		var date = new Date();
		date.setTime(date.getTime() + (this.props.expire * 24*60*60*1000));
		expires = '; expires=' + date.toGMTString();
	}
	document.cookie = cookieName + '=' + cookieVal + expires + '; path=' + this.props.path;
},

removeCookie: function(cookieName) {
	document.cookie = cookieName + '=; path=' + this.props.path;
}
}//prototype
