function guardaCookieHome(estado)
{
	var _estado			 = estado;
	document.cookie		 = 'estadg='+_estado+';expires=Thu, 31 Dec 2099 23:59:59 GMT;path=/';
	guardaCookieInterna(estado);
	window.location.href = window.location.pathname;
	//ocultaDiv();
}
function guardaCookie(estado)
{
	var _estado		= estado;
	document.cookie	= 'estad='+_estado+';path=/';
	//ocultaDiv();
}
function guardaCookieInterna(estado)
{
	var _estado		= estado;
	document.cookie	= 'estad='+_estado+';path=/';
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		//alert(document.cookie);
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start != -1)
		{
			c_start = c_start + c_name.length+1;
			c_end = document.cookie.indexOf(";",c_start);
			if (c_end == -1)
				c_end = document.cookie.length;
			//alert(document.cookie.substring(c_start,c_end));
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}
function deleteCookie(name, path, domain)
{
	//alert(location.href);
	if (getCookie(name)) {
		//alert('saiu');
		document.cookie = name + "=" + 
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		//alert(document.cookie);
		history.go(0);
	}
}
