// JavaScript Document


function abreFotos(foto)
{
	var janela = '_blank';
	var larg   = 568;
	var alt    = 500;
	var scroll = 'yes';
	var pos1   = 10;
	var pos2   = 0;
	window.open(foto,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,top="+pos1+",left="+pos2+",screenY="+pos1+",screenX="+pos2+",width="+larg+",height="+alt);
}

function abreJanela(url)
{
	var janela = '_blank';
	var larg   = 420;
	var alt    = 317;
	var scroll = 'yes';
	var pos1   = 10;
	var pos2   = 0;
	window.open(url,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,top="+pos1+",left="+pos2+",screenY="+pos1+",screenX="+pos2+",width="+larg+",height="+alt);
}

function resultadoEnquete(id)
{
	var janela = '_blank';
	var larg   = 300;
	var alt    = 250;
	var scroll = 'yes';
	var pos1   = 300;
	var pos2   = 500;
	window.open("resultado.php5?id="+id,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,top="+pos1+",left="+pos2+",screenY="+pos1+",screenX="+pos2+",width="+larg+",height="+alt);
}


function validarMural () {

    var formulario = document.forms[0];
	var erro = 0;
	
	if (formulario.nome.value == "") {
	     alert ("Por favor, o campo Nome deve ser preenchido corretamente.");
		 erro = 1;
		 return;
	}
	if (formulario.titulo.value == "") {
	    alert ("Por favor, o campo Título deve ser preenchido corretamente.");
		erro = 1;
		return;
	}
	if (formulario.bairro.value == "") {
	    alert ("Por favor, o campo Bairro deve ser preenchido corretamente.");
		erro = 1;
		return;
	}
	if (formulario.mensagem.value == "") {
	    alert ("Por favor, o campo Mensagem deve ser preenchido corretamente.");
		erro = 1;
		return;
	}
	if (erro == 0) {
		alert ("Sua mensagem foi enviada com Sucesso. Em breve estaremos respondendo-a")
	    document.formulario.action="processa.php5";
		document.formulario.submit();
	}

}
function remover (url, i) {
    var confirma = confirm("Deseja Realmente Apagar?");

	if (confirma == true) {
	    alert("Remoção efetuada com sucesso");
		document.forms[i].action=url;
	    document.forms[i].submit();
	}
}