function verificaMail(email) {
	var campo = email;
	if (campo.indexOf("@")<1) {
		return false;
	}
	if (campo.charAt(campo.indexOf("@")-1) == ".") {
		return false;
	}
	if (campo.lastIndexOf(".")<=campo.indexOf("@")) {
		return false;
	}
	if (campo.lastIndexOf(".") == (campo.length-1)) {
		return false;
	}
	return true;
}
function valida() {
		submitform();
}
function submitform() {
  document.formContato.submit();
}
function trocaImagem(img, leg){
	document.getElementById("imgFotoGrande").src = img;
	document.getElementById("legendaFotoGaleria").innerHTML = "bbb";
}
//
var myTime;
function scrollUp(){
	window.frameGal.scrollBy(-5,0);//sobe a barra de rolagem
	myTime = setTimeout('scrollUp()', 5);//myTime objeto q mantém a recursividade
}

function scrollDown(){
	window.frameGal.scrollBy(5,0);//desce a barra de rolagem
	myTime = setTimeout('scrollDown()', 5);//myTime objeto q mantém a recursividade
}
function apareceSubMenu(id) {
	document.getElementById(id).style.display='block';
}
function someSubMenu(id) {
	document.getElementById(id).style.display='none';	
}
function abrirVideo(id, leg) {
	window.open('popVideo.php?idvideo='+id+'&legenda='+leg,'Video','width=425, height=425');
}
function abrirGaleria(id) {
	window.open('popGaleria.php?id='+id,'Galeria','width=665, height=635');
}
function abrirRadio() {
	window.open('playerDigital','Radio','width=380, height=180');
}
function verFoto(imagem,titulo){
	window.open('verFoto.php?foto='+imagem+'&titulo='+titulo, 'popup', 'width=600,height=450');void(0);
}
function validaNews(chave) {
	texto="Favor preencher o e-mail corretamente!";
	if(verificaMail(document.getElementById('email').value)){
		submitformNews();
	}else{
		alert(texto);		
	}
}
function submitformNews() {
	document.formNews.submit();
}
function validaRecado() {
	texto="Falta preencher o(s) segunte(s) campo(os):\n\n";
	erro=0;
	if (document.getElementById('nome').value == ""){
		erro=erro+1;
		texto=texto+erro+") Nome\n";
		if(erro==1){
			document.getElementById('nome').focus();
		}
	}
			if (document.getElementById('email').value == ""){
		erro=erro+1;
		texto=texto+erro+") Email\n";
		if(erro==1){
			document.getElementById('email').focus();
		}
	}
	if (document.getElementById('mensagem').value == ""){
		erro=erro+1;
		texto=texto+erro+") Mensagem\n";
		if(erro==1){
			document.getElementById('mensagem').focus();
		}
	}
	if(erro!=0){
		alert(texto);
	}else{
		submitformRecado();
	}
}
function submitformRecado() {
  document.form1.submit();
}
function printNoticia(id) {
	window.open('imprimeNoticia.php?id='+id,'Noticias','width=680, height=600, scrollbars');
}
function validaPromo() {
	//
	a1 = document.getElementById("campoNome").value;
	a2 = document.getElementById("campoEmail2").value;
	a3 = document.getElementById("campoEnde").value;
	a4 = document.getElementById("campoCidade").value;
	a5 = document.getElementById("campoUF").value;
	a6 = document.getElementById("campoTel").value;
	a7 = document.getElementById("campoPerf").value;
	if(verificaMail(a2)==false) {
		alert("Digite um e-mail correto.");
	} else if (a1 == '' || a2 == '' || a3 == '' || a4 == '' || a5 == 'escolha' || a6 == '' || a7 == '') {
		alert("Preencha todos os campos.");
	} else {
		document.getElementById("formPromocao").submit();
	}
}













