function limpaForm()
{
	document.getElementById("nome").value="";
	document.getElementById("email").value="";
	document.getElementById("telefone").value="";
	document.getElementById("departamento").value="0";
	document.getElementById("assunto").value="";
	document.getElementById("mensagem").value="";
	document.getElementById("nome").focus();
}

function enviarForm()
{
	if (document.getElementById("nome").value == "")
	{
		alert("É necessário o preenchimento de seu NOME!");
		document.getElementById("nome").focus();
		return false;
	}
	if (document.getElementById("email")!="")
	{
		qtdArroba = document.getElementById("email").value.split('@');
		if (document.getElementById("email").value.search("@") == -1 || document.getElementById("email").value.search("[.]") == -1 || document.getElementById("email").value.search(" ") != -1 || qtdArroba.length !=2 || qtdArroba[0] == "" || qtdArroba[1] == "" || qtdArroba[1] == ".")
		{
			alert("O preenchimento do E-Mail está incorreto!");
			document.getElementById("email").focus();
			return false;
		}
	} else {
		alert("É necessário o preenchimento do seu E-Mail!");
		document.getElementeById("email").focus();
		return false;
	}
	if (document.getElementById("departamento").value == "0")
	{
		alert("É necessário a escolha de um Departamento!");
		document.getElementById("departamento").focus();
		return false;
	}
	if (document.getElementById("assunto").value == "")
	{
		alert("É necessário o preenchimento do Assunto!");
		document.getElementById("assunto").focus();
		return false;
	}
	if (document.getElementById("mensagem").value == "")
	{
		alert("É necessário o preenchimento da Mensagem!");
		document.getElementById("mensagem").focus();
		return false;
	}
	
		document.getElementById("formularioContato").submit();
		return true;
}


function limpaFormIndique()
{
	document.getElementById("seunome").value="";
	document.getElementById("seuemail").value="";
	document.getElementById("amigonome").value="";
	document.getElementById("amigoemail").value="";
	document.getElementById("mensagem").value="";
	document.getElementById("seunome").focus();
}

function enviarFormIndique()
{
	if (document.getElementById("seunome").value == "")
	{
		alert("É necessário o preenchimento de seu NOME!");
		document.getElementById("seunome").focus();
		return false;
	}
	if (document.getElementById("seuemail")!="")
	{
		qtdArroba = document.getElementById("seuemail").value.split('@');
		if (document.getElementById("seuemail").value.search("@") == -1 || document.getElementById("seuemail").value.search("[.]") == -1 || document.getElementById("seuemail").value.search(" ") != -1 || qtdArroba.length !=2 || qtdArroba[0] == "" || qtdArroba[1] == "" || qtdArroba[1] == ".")
		{
			alert("O preenchimento do seu E-MAIL está incorreto!");
			document.getElementById("seuemail").focus();
			return false;
		}
	} else {
		alert("É necessário o preenchimento do seu E-MAIL!");
		document.getElementeById("seuemail").focus();
		return false;
	}
	if (document.getElementById("amigonome").value == "")
	{
		alert("É necessário o preenchimento do NOME do SEU AMIGO!");
		document.getElementById("amigonome").focus();
		return false;
	}
	if (document.getElementById("amigoemail")=="")
	{
		alert("É necessário o preenchimento do E-MAIL do SEU AMIGO!");
		document.getElementeById("amigoemail").focus();
		return false;
	} else {
		qtdArroba = document.getElementById("amigoemail").value.split('@');
		if (document.getElementById("amigoemail").value.search("@") == -1 || document.getElementById("amigoemail").value.search("[.]") == -1 || document.getElementById("amigoemail").value.search(" ") != -1 || qtdArroba.length !=2 || qtdArroba[0] == "" || qtdArroba[1] == "" || qtdArroba[1] == ".")
		{
			alert("O preenchimento do E-MAIL do SEU AMIGO está incorreto!");
			document.getElementById("amigoemail").focus();
			return false;
		}
	}
	document.forms[0].submit();
}

function limpaFormBercario()
{
	document.getElementById("nome").value="";
	document.getElementById("email").value="";
	document.getElementById("mensagem").value="";
	document.getElementById("nome").focus();
}

function validaFrmEnviaRecado(){
	var txtNome = document.getElementById("txtNome")
	var txtEmail = document.getElementById("txtEmail")
	var txtMensagem = document.getElementById("txtMensagem")
	
	if(txtNome.value == ""){
		alert("O Campo NOME é de Preenchimento Obrigatório");
		txtNome.focus();
		return false;
	}
	else{
		if(txtEmail.value == ""){
			alert("O Campo E-MAIL é de Preenchimento Obrigatório");
			txtEmail.focus();
			return false;
		}
		else{
			qtdArroba = txtEmail.value.split('@');
			if(txtEmail.value.search("@") == -1 || txtEmail.value.search("[.]") == -1 || txtEmail.value.search(" ") != -1 || qtdArroba.length !=2 || qtdArroba[0] == "" || qtdArroba[1] == "" || qtdArroba[1] == "."){ 
				alert("O Preenchimento do Campo E-MAIL Está Incorreto!"); 
				txtEmail.value = "";
				txtEmail.focus();
				return false;
			}
			else{
				if(txtMensagem.value == ""){
					alert("O Campo MENSAGEM é de Preenchimento Obrigatório!");
					txtMensagem.focus();
					return false;
				}
			}
		}
		document.getElementById("frmEnviaRecado").submit();
		return true;
	}
}
function linkNoticia()
{
	var args = arguments;
	window.location="../noticias/noticia.asp?idNoticia="+args[0]
}

function linkMudaPagina()
{
	var args = arguments;
	window.location="../noticias/index.asp?nPagina="+args[0]
}

function linkInformativo()
{
	var args = arguments;
	window.open(args[0])
}
function linkInformativoCampanha()
{
	var args = arguments;
	window.location=args[0]
}
function foto(foto)
{
	cyber=window.open(foto, 'janela1', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=480,top=20,left=50')
}
function changeSize()
{
	var args = arguments;
	if (document.getElementById("img"+args[0]).width=="87"){
		document.getElementById("img"+args[0]).height="46"
		document.getElementById("img"+args[0]).width="90"
	}else if (document.getElementById("img"+args[0]).width=="90"){
		document.getElementById("img"+args[0]).height="46"
		document.getElementById("img"+args[0]).width="87"
	}
}
function mudaCorDeFundo()
{
	var args = arguments;
	//alert(args[0]);
	if (args[0]==1){
		document.getElementById("link").style.backgroundColor='#EEF6F9';
		document.getElementById("quina").style.backgroundColor='#EEF6F9';
	} else if (args[0]==2){
		document.getElementById("link").style.backgroundColor='#DCEBF1';
		document.getElementById("quina").style.backgroundColor='#DCEBF1';
	}
}
//
function abrePopUp(pagina,width,height){	
	popUp = window.open(pagina,'AbrePopUp','status=no,resizable=no,scrollbars=no,menubar=no,width='+width+',height='+height+',left=20,top=20');
	popUp.focus();
}
//
function isNum(caractere)
{ 
  var strValidos = "0123456789.-" 

  if (strValidos.indexOf(caractere) == -1)
  {
    return false; 
  }
  else
  {
    return true;  
  }
} 

function validaTecla(campo, event) 
{ 
	var key; 
	var tecla; 

	CheckTAB = true; 
	
	if(navigator.appName.indexOf("Netscape")!= -1)
	{
		tecla = event.which; 
	}
	else 
	{
		if (event.keyCode == 44)
		{
			event.keyCode = 46;
		}
		
		tecla = event.keyCode;
	}
	
	key = String.fromCharCode(tecla); 
	//alert( 'key: ' + tecla + ' -> campo: ' + campo.value); 
	if (tecla == 13)
	{
		return false; 
	}
	
	if (tecla == 8 || tecla == 0 || tecla == 9)
	{
		return true; 
	}
	
	return (isNum(key));
} 
