function OnFormSubmit(){
  
function validarEmail(valor) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    return true;
  } else {
    return false
  }  
}

//Validation for the fields

function validarEmail(valor) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    return true;
  } else {
    return false
  }  
}

//Validation for the fields
 
//nombre
  if (document.RegForm.nombre.value == "") {
    alert("Ingresa tu nombre");
    document.RegForm.nombre.focus();
	return false;
	}
	
//apellido
  if (document.RegForm.apellido.value == "") {
    alert("Ingresa tu apellido");
    document.RegForm.apellido.focus();
	return false;
	}	
	
	
 //tipo documento 
    if (document.RegForm.ve.selectedIndex==0){ 
       alert("Ingresa el tipo de documento (C.I. V. E. / Rif)") 
       document.RegForm.ve.focus() 
      return false;
    }	


//cedula	
 if (document.RegForm.id.value == "") {
    alert("Ingresa tu numero de cedula o Rif");
    document.RegForm.id.focus();
   return false;
    } else {
	if(isNaN(document.RegForm.id.value)){
	alert("El numero de cedula o Rif no debe contener ningun caracter alfabetico ");
    document.RegForm.id.focus();
	 return false;
	}    
    }
	


//edad
 if (document.RegForm.edad.value == "") {
    alert("Ingresa tu edad");
    document.RegForm.edad.focus();
   return false;
    } else {
	if(isNaN(document.RegForm.edad.value)){
	alert("El campo edad no debe contener Letras ni signos de puntuacio�n");
    document.RegForm.edad.focus();
	 return false;
	}    
    }


//empleado
if ((document.RegForm.empleado[0].checked == false) && (document.RegForm.empleado[1].checked == false))	{
	alert("Debe seleccionar la opcion de empleado");
	  return false;	
}

//negocio propio
if ((document.RegForm.negocio[0].checked == false) && (document.RegForm.negocio[1].checked == false))	{
	alert("Debe seleccionar la opcion de negocio propio");
	  return false;	
}

//tipo negocio
	  if (document.RegForm.tipo_negocio.value == "") {
		  alert("Ingresa el tipo de negocio");
		  document.RegForm.tipo_negocio.focus();
		  return false;
	 }	
	 
//visitado
if ((document.RegForm.visita[0].checked == false) && (document.RegForm.visita[1].checked == false))	{
	alert("Debe seleccionar la opcion de visita de ejecutivo");
	  return false;	
}	 


 //tipo documento 
    if (document.RegForm.zona.selectedIndex==0){ 
       alert("Ingresa la zona donde vive") 
       document.RegForm.zona.focus() 
      return false;
    }	
	
//direccion
  if (document.RegForm.direccion.value == "") {
    alert("Ingresa tu direccion");
    document.RegForm.direccion.focus();
     return false;
	 }	

//celular
 if (document.RegForm.telefono.value == "") {
    alert("Ingresa tu numero de habitacion");
    document.RegForm.telefono.focus();
       return false;
    } else {
	if (((document.RegForm.telefono.value.length) != 11) || (document.RegForm.telefono.value.substring(0,3).length != 3) || (document.RegForm.telefono.value.substring(3,4) != '-') || (document.RegForm.telefono.value.substring(4,11).length != 7) ||  (isNaN(document.RegForm.telefono.value.substring(0,3))) || (isNaN(document.RegForm.telefono.value.substring(4,11)))){
	      alert("El campo numero de habitacion no tiene el formato correcto");
              document.RegForm.telefono.focus();
	     return false;
	}    
    }

//telefono
 if (document.RegForm.tel_ofi.value == "") {

    } else {
	if (((document.RegForm.tel_ofi.value.length) != 11) || (document.RegForm.tel_ofi.value.substring(0,3).length != 3) || (document.RegForm.tel_ofi.value.substring(3,4) != '-') || (document.RegForm.tel_ofi.value.substring(4,11).length != 7) ||  (isNaN(document.RegForm.tel_ofi.value.substring(0,3))) || (isNaN(document.RegForm.tel_ofi.value.substring(4,11)))){
	      alert("El campo numero de oficina no tiene el formato correcto");
              document.RegForm.tel_ofi.focus();
	     return false;
	}    
    }
//otro
 if (document.RegForm.tel_otro.value == "") {

    } else {
	if (((document.RegForm.tel_otro.value.length) != 11) || (document.RegForm.tel_otro.value.substring(0,3).length != 3) || (document.RegForm.tel_otro.value.substring(3,4) != '-') || (document.RegForm.tel_otro.value.substring(4,11).length != 7) ||  (isNaN(document.RegForm.tel_otro.value.substring(0,3))) || (isNaN(document.RegForm.tel_otro.value.substring(4,11)))){
	      alert("El campo otro numero no tiene el formato correcto");
              document.RegForm.tel_otro.focus();
	     return false;
	}     
    }
//correo	 
if (document.RegForm.correo.value != ''){
    if (!validarEmail(document.RegForm.correo.value)){
        alert("La direccion del E-mail es incorrecta");
        document.RegForm.correo.focus();
        return false;    
    }
}
	
if ((document.RegForm.interes1.checked == false) && (document.RegForm.interes2.checked == false) && (document.RegForm.interes3.checked == false) && (document.RegForm.interes4.checked == false)      ) {
	 alert("Debe Seleccionar un producto de interes");
	  return false;
	}	

//fin funcion

}
