// FUNCAO ALERT ESTILIZADO
function alertar(msg,redireciona) {
	document.body.style.overflow='hidden';
	var altLar = getPageSize();
	var fundoLightBox = document.getElementById("divAlertar");

	fundoLightBox.style.height = altLar[1]+"px";
	fundoLightBox.style.width = altLar[0]+"px";
	fundoLightBox.style.display = "";

	if (document.documentElement.scrollTop!=0){
		document.getElementById("alerta").style.marginTop = -150 + document.documentElement.scrollTop+"px";
		document.getElementById("alerta").style.marginLeft = -120 + document.documentElement.scrollLeft+"px";
	} else {
		document.getElementById("alerta").style.marginTop = -150 + document.body.scrollTop+"px";
		document.getElementById("alerta").style.marginLeft = -120 + document.body.scrollLeft+"px";
	}

	document.getElementById("divAlertar2").style.display = "";
	document.getElementById("alerta").innerHTML = msg;
	setTimeout("fechar_alerta('"+redireciona+"')", 3000);
}

function fechar_alerta(redireciona) { 
	document.getElementById("divAlertar").style.display="none";
	document.getElementById("divAlertar2").style.display="none";
	document.body.style.overflow = "";
	if( redireciona!='#' ){
		location.href = redireciona;
	}
}

function alertarSemTempo(msg) {
	document.body.style.overflow='hidden';
	var altLar = getPageSize();
	var fundoLightBox = document.getElementById("divAlertar");

	fundoLightBox.style.height = altLar[1]+"px";
	fundoLightBox.style.width = altLar[0]+"px";
	fundoLightBox.style.display = "";

	if (document.documentElement.scrollTop!=0){
		document.getElementById("alerta").style.marginTop = -150 + document.documentElement.scrollTop+"px";
		document.getElementById("alerta").style.marginLeft = -120 + document.documentElement.scrollLeft+"px";
	} else {
		document.getElementById("alerta").style.marginTop = -150 + document.body.scrollTop+"px";
		document.getElementById("alerta").style.marginLeft = -120 + document.body.scrollLeft+"px";
	}

	document.getElementById("divAlertar2").style.display = "";
	document.getElementById("alerta").innerHTML = msg;
}