function OnFormSubmit(){
  
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;
	}    
    }
	
//sexo
if ((document.RegForm.sexo[0].checked == false) && (document.RegForm.sexo[1].checked == false))	{
	alert("Debes seleccionar el sexo");
	  return false;	
}

//celular
 if (document.RegForm.tel_hab.value == "") {
    alert("Ingresa tu numero de habitacion");
    document.RegForm.tel_hab.focus();
       return false;
    } else {
	if (((document.RegForm.tel_hab.value.length) != 11) || (document.RegForm.tel_hab.value.substring(0,3).length != 3) || (document.RegForm.tel_hab.value.substring(3,4) != '-') || (document.RegForm.tel_hab.value.substring(4,11).length != 7) ||  (isNaN(document.RegForm.tel_hab.value.substring(0,3))) || (isNaN(document.RegForm.tel_hab.value.substring(4,11)))){
	      alert("El campo numero de habitacion no tiene el formato correcto");
              document.RegForm.tel_hab.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;    
    }
}
 
 //tipo documento 
    if (document.RegForm.zona.selectedIndex==0){ 
       alert("Ingresa la zona donde vive") 
       document.RegForm.zona.focus() 
      return false;
    }

//inquietud
	  if (document.RegForm.inquietud.value == "") {
		  alert("Ingresa tu sugerencia o inquietud");
		  document.RegForm.inquietud.focus();
		  return false;
	 }	

}
