/*===================================================================
Función. Validacion del formulario Personas
===================================================================*/
function validadorPersonas(formulario)
{  
    var formulario = document.frmPersonas;
   	 if (!valComboBox(formulario.objPersonas_ddlTipo, "Seleccione un tipo de documento", "|Seleccione|"))
		return false;  

     if(formulario.objPersonas_ddlTipo.value == "Tarjeta Identidad" || formulario.objPersonas_ddlTipo.value == "CC")
       { 
		if (!ValDNumero(formulario.objPersonas_txtNumDcto, "N\u00Famero de Documento", true, "El n\u00Famero de documento debe ser un dato num\u00E9rico."))
			return false;
	   }
	 else
	   {
	     if (!SonRequeridos(formulario.objPersonas_txtNumDcto, "N\u00Famero de Documento"))
		   return false;
	   }
		
     if (!SonRequeridos(formulario.objPersonas_txtNombre, "Nombre"))
		return false;
		
	if (!SonRequeridos(formulario.objPersonas_txtApellido, "Apellido"))
		return false;
	
		
	if(!formulario.objPersonas_rblGenero_0.checked & !formulario.objPersonas_rblGenero_1.checked)
		{
		alert("Seleccione una opci\u00F3n para G\u00E9nero");
		return false;
		}    
 		
 	// Nuevos campos requeridos
	
	if (!SonRequeridos(formulario.objPersonas_txtMedioEmpresa, "Medio para el cual trabaja"))
		return false;
		
	// Medios **********************	
	  if(formulario.objPersonas_ddlTipoMedio.value == 4)
       {              
	     if (!SonRequeridos(formulario.objPersonas_txtOtroMedio, "tipo de medio"))
			return false;   
	   }
	  else
	   {
	     if (!valComboBox(formulario.objPersonas_ddlTipoMedio, "Seleccione un tipo de medio", "|Seleccione un tipo de medio|"))
		    return false;		      
	   }
	
	// Cargos ****************************	
	if(formulario.objPersonas_ddlCargo.value != 5)
       {
	    if (!valComboBox(formulario.objPersonas_ddlCargo, "Seleccione un cargo", "|Seleccione un cargo|"))
		    return false;
	   }
    else
       {
         if (!SonRequeridos(formulario.objPersonas_txtOtroCargo, "el cargo"))
			return false; 
       }
	
	// Areas ****************************	
   	if(formulario.objPersonas_ddlArea.value != 24)
       {
	    if (!valComboBox(formulario.objPersonas_ddlArea, "Seleccione un \u00E1rea", "|Seleccione un area|"))
		    return false;	
	   }
	 else
       {
         if (!SonRequeridos(formulario.objPersonas_txtOtraArea, "el \u00E1rea"))
			return false; 
       }
	
	//************************		
 		
	if (!valComboBox(formulario.objPersonas_ddlPais, "Seleccione un pa\u00EDs", "|Seleccione un pais|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlDepartamento, "Seleccione un departamento", "|Seleccione un departamento|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlDepartamento, "El pa\u00EDs seleccionado no tiene departamentos ", "|No hay departamentos para ese pais|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlCiudad, "Seleccione una ciudad", "|Seleccione una ciudad|"))
		return false;
		
	if (!valComboBox(formulario.objPersonas_ddlCiudad, "El departamento no tiene ciudades", "|No hay ciudades para ese departamento|"))
		return false;

    if (!SonRequeridos(formulario.objPersonas_txtCodOperador, "Operador"))
        return false;

    if (!SonRequeridos(formulario.objPersonas_txtCelular, "Celular"))
        return false;			
		
	if (!ValDNumero(formulario.objPersonas_txtCodOperador, "Operador celular", false, "El operador celular debe ser un dato num\u00E9rico"))
			return false;
	
	if (!ValDNumero(formulario.objPersonas_txtCelular, "Celular", false, "El celular debe ser un dato num\u00E9rico"))
			return false;
			
	if (!valCorreo(formulario.objPersonas_txtEmail,"Correo no v\u00E1lido",true))
	    return false;
	    
	if (!SonRequeridos(formulario.objPersonas_txtDirOfi, "Direcci\u00F3n"))
			return false;
			
	if (!SonRequeridos(formulario.objPersonas_txtTelOfi, "Tel\u00E9fono"))
	    return false;

	if (!SonRequeridos(formulario.objPersonas_txtPaginaWeb, "P\u00E1gina web"))
	    return false;
						
return true;
}

/*===================================================================
Función. Validacion del formulario Personas
===================================================================*/
function validadorPersonasEnglish(formulario)
{  
    var formulario = document.frmPersonas;
   	 if (!valComboBox(formulario.objPersonas_ddlTipo, "Select a type of document", "|Select|"))
		return false;  

     if(formulario.objPersonas_ddlTipo.value == "CC")
       { 
		if (!ValDNumero(formulario.objPersonas_txtNumDcto, "ID number", true, "The ID number must be a numeric data."))
			return false;
	   }
	 else
	   {
	     if (!SonRequeridos(formulario.objPersonas_txtNumDcto, "Id number"))
		   return false;
	   }
		
     if (!SonRequeridos(formulario.objPersonas_txtNombre, "Name"))
		return false;
		
	if (!SonRequeridos(formulario.objPersonas_txtApellido, "Last name"))
		return false;
	
		
	if(!formulario.objPersonas_rblGenero_0.checked & !formulario.objPersonas_rblGenero_1.checked)
		{
		alert("Select an option to gender");
		return false;
		}    
 		
 	// Nuevos campos requeridos
	
	if (!SonRequeridos(formulario.objPersonas_txtMedioEmpresa, "Media for which he works"))
		return false;
		
	// Nuevos combos **********************
	
	if (!valComboBox(formulario.objPersonas_ddlTipoMedio, "Select a type of media", "|Select a type of media|"))
		return false;
		
	if (!valComboBox(formulario.objPersonas_ddlCargo, "Select a job", "|Select a job|"))
		return false;
		
	//*************************************
	if (!SonRequeridos(formulario.objPersonas_ddlCargo, "Job"))
			return false;
	
	if (!valComboBox(formulario.objPersonas_ddlArea, "Select an area", "|Select an area|"))
		return false;	
	
	//************************		
 		
	if (!valComboBox(formulario.objPersonas_ddlPais, "Select a country", "|Select a country|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlDepartamento, "Select a providence/state", "|Select a providence/state|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlDepartamento, "There are no providence/state for this country", "|There are no providence/state for this country|"))
		return false; 
		
	if (!valComboBox(formulario.objPersonas_ddlCiudad, "Select a city", "|Select a city|"))
		return false;
		
	if (!valComboBox(formulario.objPersonas_ddlCiudad, "There are no city for this providence/state", "|There are no city for this providence/state|"))
		return false;  
		
	if (!ValDNumero(formulario.objPersonas_txtCodOperador, "Cell operator ", false, "The operator cell must be a numeric data"))
			return false;
	
	if (!ValDNumero(formulario.objPersonas_txtCelular, "Cell phone", false, "The cell must be a numeric data"))
			return false;
			
	if (!valCorreo(formulario.objPersonas_txtEmail,"Incorrect email",true))
	    return false;
	    
	if (!SonRequeridos(formulario.objPersonas_txtDirOfi, "Adress"))
			return false;
			
	if (!SonRequeridos(formulario.objPersonas_txtTelOfi, "Phone"))
			return false;
						
return true;
}






