
	function Enviar(){
		if (ValidaFrm()){
			window.document.getElementById('contactar_form').submit()
		}
	}
	

	function ValidaFrm(){
		var Obj = window.document.getElementById("nombre");
		if (Obj.value==''){ 
			alert('No olvide ingresar el Nombre.'); 
			Obj.focus(); 
			return false;
		}else{
			a = Obj.value.match(/([a-zA-ZáéíóúüÁÉÍÓÚÜÑñ\' -]+)/gi);
			if (a != Obj.value) 
			 { 
				alert('Existen caracteres no permitidos en el Nombre.'); 
				Obj.focus(); 
				return false;
			 }  
		}

		/*
		var Obj = window.document.getElementById("apellido");
		if (Obj.value==''){ 
			alert('No olvide ingresar sus Apellidos.'); 
			Obj.focus(); 
			return false;
		}else{
			a = Obj.value.match(/([a-zA-ZáéíóúüÁÉÍÓÚÜÑñ' -]+)/gi);
			if (a != Obj.value) 
			 { 
				alert('Existen caracteres no válidos en el Apellidos.'); 
				Obj.focus(); 
				return false;
			 }  
		}
		*/
        
		var Obj = window.document.getElementById("mail_usuario");
		if (Obj.value==''){ 
			alert('No olvide ingresar el Mail.'); 
			Obj.focus(); 
			return false;
		}else{
			a = Obj.value.match(/([a-zA-Z1-9\-_.]+)/gi);
			if (a != Obj.value) 
			 { 
				alert('Existen caracteres no permitidos en el Mail.'); 
				Obj.focus(); 
				return false;
			 }  
		}
		var Obj = window.document.getElementById("mail_dominio");
		if (Obj.value==''){ 
			alert('No olvide ingresar el Dominio del Mail.'); 
			Obj.focus(); 
			return false;
		}else{
			a = Obj.value.match(/([a-zA-Z1-9\-_.]+)/gi);
			if (a != Obj.value) 
			 { 
				alert('Existen caracteres no permitidos en el Dominio del Mail.'); 
				Obj.focus(); 
				return false;
			 }
		}

		if (!isEmailAddress(window.document.getElementById("mail_usuario").value + "@" + Obj.value)){
			alert("El mail no es válido")
			window.document.getElementById("mail_usuario").focus();
			return false;
		}

	   
		Obj = window.document.getElementById("fono_cod");	
	    if (Trim(Obj.value)==''){	
			alert('No olvide ingresar el Código de Area del Teléfono.');
			Obj.focus();
			return false;
		}else{	
			a = Obj.value.match(/([0-9]+)/gi);
			v = Obj.value; 
			if (a != v ){ 
				alert('Existen caracteres no permitidos en el Código de Area del Teléfono.' ); 
				Obj.focus(); 
				return false;
			}  
		}

		Obj = window.document.getElementById("fono_num");	
	    if (Trim(Obj.value)==''){	
			alert('No olvide ingresar el Teléfono.');
			Obj.focus();
			return false;
		}else{	
			a = Obj.value.match(/([0-9]+)/gi);
			v = Obj.value; 
			if (a != v ){ 
				alert('Existen caracteres no permitidos en el Teléfono.' ); 
				Obj.focus(); 
				return false;
			}  
		}
		if (Obj.value.length<6){
				alert('La cantidad de caracteres del Télefono no es válida.' ); 
				Obj.focus(); 
				return false;
		}

		Obj = window.document.getElementById("cel_cod");
	    if (Trim(Obj.value)==''){	
			alert('No olvide ingresar el Prefijo del Celular.');
			Obj.focus();
			return false;
		}else{	
			a = Obj.value.match(/([0-9]+)/gi);
			v = Obj.value; 
			if (a != v ){ 
				alert('Existen caracteres no permitidos en el Prefijo del Celular.' ); 
				Obj.focus(); 
				return false;
			}  
		}
		Obj = window.document.getElementById("cel_num");
	    if (Trim(Obj.value)==''){	
			alert('No olvide ingresar el Celular.');
			Obj.focus();
			return false;
		}else{	
			a = Obj.value.match(/([0-9]+)/gi);
			v = Obj.value; 
			if (a != v ){ 
				alert('Existen caracteres no permitidos en el Celular.' ); 
				Obj.focus(); 
				return false;
			}  
		}
		if (Obj.value.length<7){
				alert('La cantidad de caracteres del Celular no es válida.' ); 
				Obj.focus(); 
				return false;
		}
		return true;
	}

	function Trim(str){
	   var c, i, ini, fin;

		if (str == null)
		  return "";

		fin = str.length;
		if (fin*0 != 0) 
		{
		  fin=0;
		  str = "";
		}
		ini = 0;
		for(i=0; i<fin; i++) 
		{
		  c = str.charAt(i);
		  if ( c == ' ')
		ini = i + 1;
		  else
		break;
		}
		
		for(i=fin - 1; i>=ini; i--) 
		{
		  c = str.charAt(i);
		  if ( c == ' ')
		fin = i;
		  else
		break;
		}
		return str.substring(ini, fin);
	}


	function isEmailAddress(theElement){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(theElement)){
		   return (true)
		} else {
	  	   return (false);
		}
	}


