//#### Feito por Leandro Lopes de Oliveira #### Todos direitos Reservados #### leandro@w3vision.com.br
function valcontato() {
		
			
		if ( document.contato.nome.value == "" ) {
			alert("Por favor, informe o seu Nome");
			document.contato.nome.focus();
			return false;
		}
		else if ( !valida_mail(document.contato.email.value) ) {
			alert("Por favor, digite seu e-mail corretamente");
			document.contato.email.focus();
			return false;
		}
		if ( document.contato.assunto.value == "" ) {
			alert("Por favor, informe o assunto");
			document.contato.assunto.focus();
			return false;
		}
		if ( document.contato.mensagem.value == "" ) {
			alert("Por favor, informe a Mensagem");
			document.contato.mensagem.focus();
			return false;
		}
			
		document.news.action = "index.php";
		document.news.method = "post";
		document.news.submit();	
	
	}
function valida_mail(valor) {
	prim = valor.indexOf("@")
	if(prim < 2) return false;
	if(valor.indexOf("@",prim + 1) != -1) return false
	if(valor.indexOf(".") < 1) return false;
	if(valor.indexOf(".@") > 0) return false;
	if(valor.indexOf("@.") > 0) return false;
	if(valor.indexOf(".com.br.") > 0) return false;
	if(valor.indexOf("/") > 0) return false;
	if(valor.indexOf("[") > 0) return false;
	if(valor.indexOf("]") > 0) return false;
	if(valor.indexOf("(") > 0) return false;
	if(valor.indexOf(")") > 0) return false;
	if(valor.indexOf("..") > 0) return false;
	if(valor.indexOf(",") > 0) return false;
	return true;
		
}

function validaenq(qo) {
		
	 if ( !validaop(qo) ) {
		
		alert("Por favor, selecione uma opcao para seu voto.");
		document.vot.R1[0].focus();
		return false;
	}
	
	return true;
	
}
function validaop(qo)
	{
		var r=document.vot.R1
		
			for (i = 0;i < qo ;i++)
				{
					if( (r[i].checked))
						{
							return true;
						}
					
				}
		return false;	
				
	}

function votar(qtdop) {
		
		if (validaenq(qtdop))
			{
				document.vot.action = "enquete_vota.php";
				document.vot.method = "post";
				document.vot.submit();	
			}

		
	}
function resultadoenq() {
				
				document.res.action = "index.php?idenq=resultado";
				document.res.method = "post";
				document.res.submit();	
			
	}
function numerico(field) {

				  expr = field.value;
  
				  if (isNaN(expr)) {
						 //alert('Campo '+ field.name +'aceita somente Números.');
						 field.value = '';
						 field.focus();
						 return false;
					} 
				  else {
						 return true;
					}
}