 function verificar () {

var nombres = document.forma3.nombres.value.length;
var apellidos = document.forma3.apellidos.value.length;
var direccion = document.forma3.direccion.value.length;
var pais = document.forma3.pais.value.length;
var ciudad = document.forma3.ciudad.value.length;
var telefono = document.forma3.telefono.value.length;
var empresa = document.forma3.empresa.value.length;
var email = document.forma3.email.value.length;
var comentarios = document.forma3.comentarios.value.length;

if (nombres > 1 && apellidos > 1 && email > 3 ){
    document.forma3.enviar.disabled=false;
	} else {
	document.forma3.enviar.disabled=true;
	}

	if ( nombres > 1 ){
		document.getElementById("nombres_rojo").style.display = 'none';
		document.getElementById("nombres_negro").style.display = 'block';
	} else {
		document.getElementById("nombres_rojo").style.display = 'block';
		document.getElementById("nombres_negro").style.display = 'none';
	}

	if ( apellidos > 1 ){
		document.getElementById("apellidos_rojo").style.display = 'none';
		document.getElementById("apellidos_negro").style.display = 'block';
	}else {
		document.getElementById("apellidos_rojo").style.display = 'block';
		document.getElementById("apellidos_negro").style.display = 'none';
	}

	if ( email > 3 ){
		document.getElementById("email_rojo").style.display = 'none';
		document.getElementById("email_negro").style.display = 'block';
	}else {
		document.getElementById("email_rojo").style.display = 'block';
		document.getElementById("email_negro").style.display = 'none';
	}

	if ( comentarios > 5 ){
		document.getElementById("comentarios_rojo").style.display = 'none';
		document.getElementById("comentarios_negro").style.display = 'block';
	}else {
		document.getElementById("comentarios_rojo").style.display = 'block';
		document.getElementById("comentarios_negro").style.display = 'none';
	}
	}
	
function borrar() {
location.href='contactenos.php';
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("E-mail INVALIDO")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("E-mail INVALIDO")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("E-mail INVALIDO")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("E-mail INVALIDO")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("E-mail INVALIDO")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("E-mail INVALIDO")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("E-mail INVALIDO")
		    return false
		 }

 		 return true					
	}
	

function ValidateForm(){
	var emailID=document.forma3.email
	var comentariosID=document.forma3.comentarios
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Ingrese su E-mail")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	if ((comentariosID.value==null)||(comentariosID.value=="")){
		alert("Ingrese sus comentarios")
		comentariosID.focus()
		return false
	}
		
		return true
 	}
 
 var nav4 = window.Event ? true : false;
function acceptNum(evt)
{	
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
var key = nav4 ? evt.which : evt.keyCode;	
return (key <= 13 || (key >= 48 && key <= 57));
}
 
 
 


		
	
 