/*
 * http://intranet.mmcafe.com.br/folder/class_cookie_getcookie.mmp
 */
document.cookie=window.location.pathname+"=";

var Cookie = Class.create();

Cookie.prototype = {
	//construtor padrão
	initialize: function(id, object, options, answerNameStart) {
		 
	},
	/*
	 * salva cookie
	 */
	setCookie: function(key, value) {
		var the_cookie = key + "=" + value + ";" ;
		document.cookie = the_cookie;
	},
	
	/*
	 * retorna valor do cookie
	 */
	getCookie: function (key) { 
		var search = key + "="
		var returnvalue = "";
		if (document.cookie.length > 0) {
			offset = document.cookie.indexOf(search)
			if (offset != -1) { 
				offset += search.length
				end = document.cookie.indexOf(";", offset);
				if (end == -1)
					end = document.cookie.length;
				returnvalue=unescape(document.cookie.substring(offset, end))
			}
		}
		return returnvalue;
	}
}