// var ElServidor =  new String(window.location.host); 
var ElServidor = new String('http://pcjvd.mx');
var lbIE;
var ConAll;
var winModalWindow;
var MiMensaje;
var sArregloChecks = '';
var gsMostrarDatos="";

lbIE = (navigator.appName.toUpperCase().indexOf('MICROSOFT') < 0)?false:true;
ConAll = (document.all) ? true : false;
/* -----------------------------------------------------------------------------------*/ 
function IgnoreEvents(e)
	{
		return (false);
	};
/* -----------------------------------------------------------------------------------*/ 
function ShowWindow()
	{
	};
/* -----------------------------------------------------------------------------------*/ 
function HandleFocus()
	{
		if (winModalWindow)
			{
				if (!winModalWindow.closed)
					{
						winModalWindow.focus();
					}
				else
					{
						window.top.releaseEvents (Event.CLICK|Event.FOCUS);
						window.top.onclick = "";
					};
			};
		return (false);
	};
/* -----------------------------------------------------------------------------------*/ 
function fCerrar()
	{
		// window.opener.location.reload(true);
		window.close();
	};
/* -----------------------------------------------------------------------------------*/ 
function fCerrarYRefrescar()
	{
		// window.opener.location.reload(true);
		if (lbIE == true)
			{
				window.opener.document.forms[0].submit();			
			}
		else
			{
				window.opener.location.reload(true);
			};
		window.close();
	};
/* -----------------------------------------------------------------------------------*/ 
function trimString(str) 
	{
		str = this != window? this : str;
		return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
	};	
// Esta funcion busca que elemento fue seleccionado y de un conjunto de radios y nos devuelve el valor.
/* -----------------------------------------------------------------------------------*/ 
function fCualSelecciono(pLista)
	{
		var lnDevuelve;
		lnDevuelve = -1;
		for ( i = 0; i < pLista.length; i++)
			{
				if (pLista[i].checked)
					{
						lnDevuelve = pLista[i].value;
					};
			};
		return (lnDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function fConfirma(mensaje)
	{
		return window.confirm(mensaje);
	};	
/* -----------------------------------------------------------------------------------*/ 
function GraficaHorizontal(pNombres, pValores, pTitulo)
	{
		var lsDevuelve;
		var aNombres;
		var aValores;
		var lnLargo;
		var MaximoGrafica;
		aNombres = pNombres.split(',');
		aValores = pValores.split(',');
		lsDevuelve = '';
		lsDevuelve = lsDevuelve + '<div align=center class=TituloLeader><b><font size=4mm>' + pTitulo + '</font></b></div>';
		lsDevuelve = lsDevuelve + '<table align=center border=1 cellpadding=18 cellspacing=0><tr><td>';
		lsDevuelve = lsDevuelve + '<table align=center border=0 cellpadding=0 cellspacing=0>';
		for (i=0; i < aNombres.length; i++)
			{
				lnLargo = (228 * aValores[i]) / 5
				lsDevuelve = lsDevuelve + '<tr><td align=right>' + aNombres[i] + '&nbsp;&nbsp;&nbsp;</td><td width=300px valign=middle><img src=' + ElServidor + '/images/GHAzul.jpg width=' + lnLargo + ' height=13px></td><td>' + aValores[i] + '</td></tr>';
			};
		lsDevuelve = lsDevuelve + '</table></td></tr></table><font size=1mm><br></font>';
		return (lsDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function GraficaHorizontal1(pNombres, pValores, pTitulo)
	{
		var lsDevuelve;
		var aNombres;
		var aValores;
		var aColores;
		var lnLargo;
		var MaximoGrafica;
		var TotalValores;
		var lnPT;
		aNombres = pNombres.split(',');
		aValores = pValores.split(',');
		aColores  = 'GHRojo.jpg;GHAmarillo.jpg;GHVerde.jpg;GHAzul.jpg;GHLila.jpg;GHCafe.jpg;GHPlata.jpg;GHCian.jpg'.split(';');
		lsDevuelve = '';
		lsDevuelve = lsDevuelve + '<div align=center class=TituloLeader><b><font size=4mm>' + pTitulo + '</font></b></div>';
		lsDevuelve = lsDevuelve + '<table align=center border=1 cellpadding=4 cellspacing=0><tr><td>';
		lsDevuelve = lsDevuelve + '<font size=1mm><br>&nbsp;</font><table align=center border=0 cellpadding=0 cellspacing=0 width=500px>';
		TotalValores = 0;
		for (i=0; i < aValores.length; i++)
			{
				TotalValores = TotalValores + parseFloat(aValores[i]);
			};
		lnPT = 0;
		for (i=0; i < aNombres.length; i++)
			{
				lnLargo = (228 * aValores[i]) / 30
				lnPT = lnPT + parseFloat(('' + (100 * parseFloat(aValores[i])) / TotalValores).substring(0,4));
				lsDevuelve = lsDevuelve + '<tr><td align=right><font size=2mm>' + aNombres[i] + '&nbsp;&nbsp;&nbsp;</font></td><td width=300px valign=middle><img src=' + ElServidor + '/images/' + aColores[i] + ' width=' + lnLargo + ' height=13px></td><td  align=right><font size=2mm> ' +('' +  (100 * parseFloat(aValores[i])) / TotalValores).substring(0,4) + ' %</td></td></tr>';
			};
		lsDevuelve = lsDevuelve + '<tr><td colspan=3 align=right><table border=0 cellpadding=0 cellspacing=0><tr><td class=TituloNegro>' + ('' + lnPT ) + ' %</td></tr></table></td></tr></table>' + '</td></tr></table>';
		return (lsDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function JVDGH(pNombres, pValores, pEtiquetas, pTitulo)
	{
		var lsDevuelve;
		var aNombres;
		var aValores;
		var aJerarquia;
		var aEtiqueta;
		var aColores;
		var lnLargo;
		lsDevuelve = '';
		aNombres  = pNombres.split(',');
		aValores  = pValores.split(';');
		aEtiqueta = pEtiquetas.split(',');
		aColores  = 'GHAzul.jpg;GHLila.jpg;GHCafe.jpg;GHPlata.jpg;GHCian.jpg;GHRojo.jpg;GHAmarillo.jpg;GHVerde.jpg'.split(';');
		lnLargo = 0;
		lsDevuelve = lsDevuelve + '<div align=center class=TituloLeader><b><font size=4mm>' + pTitulo + '</font></b></div>';
		lsDevuelve = lsDevuelve + '<table border=1 cellpadding=4 cellspacing=0 align=center width=50%>'
		for (a = 0; a < aNombres.length; a++)
			{
				aJerarquia = aValores[a].split(',');
				lsDevuelve = lsDevuelve  + '<tr><td width=50%>' + aNombres[a] + '</td><td valign=middle><table border=0 cellpadding=0 cellspacing=0 width=300px>'; 
				for (b=0; b < aJerarquia.length; b++)
					{
						lnLargo = (228 * aJerarquia[b] ) / 5;
						lsDevuelve = lsDevuelve + '<tr><td valign=middle><img src=' + ElServidor + '/images/' + aColores[b] + ' width=' + lnLargo + ' height=13px></td>';
						lsDevuelve = lsDevuelve + '<td align=right valign=middle><font size=2mm>' + ('' + aJerarquia[b].substring(0,4)) + '</font></td></tr>';
					};
					lsDevuelve = lsDevuelve  + '</table></td></tr>'; 
			};
		lsDevuelve = lsDevuelve + '</table>'
		lsDevuelve = lsDevuelve + '<font size=1mm><br></font><div align=center>'
		for (c=0; c<aEtiqueta.length; c++)
			{
				lsDevuelve = lsDevuelve  + '<img src=' + ElServidor + '/images/' + aColores[c] + ' width=20px height=13px><font size=2mm> ' + aEtiqueta[c] + ' </font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; 
			};
		lsDevuelve = lsDevuelve + '</div>'
		return (lsDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function TextoSelecionado(pQueLista)
	{
		var lsTextoSeleccionado = '';
		for (var c=0; c<pQueLista.length; c++)
			{
				if (pQueLista[c].selected)
					{
						lsTextoSeleccionado = pQueLista[c].text;
					};
			};
		return (lsTextoSeleccionado);
	};		
/* -----------------------------------------------------------------------------------*/ 
function fValidarJerarquia(pIdioma, pAccion)
	{
		var lbDevuelve = false;
		var Campo0;
		var Campo1;
		var Campo2;
		var lsEvaluado;
		var lsMensajeAlta;
		
		if (pIdioma == 0)
			{
				lsEvaluado = "Por favor escoga la relación laboral que desea modificar.|Por favor escoga la relación laboral que desea borrar.".split("|");
				lsMensajeAlta = "Por favor proporcione el nombre de la relación laboral.|Por favor indique si el evaluador, es la persona evaluada.".split("|");
			}
		else
			{
				lsEvaluado = "Please pick the relationship that you want to change.|Please pick the relationship that you want to delete.".split("|");
				lsMensajeAlta = "Please input the organizational relationship name.|Please indicate if the rater is the respondent.".split("|");
			};
		if (ConAll == true)
			{
				Campo0 = trimString(document.all("Jerarquia").value);
				Campo1 = document.all("rbUnoMismo");
				Campo2 = trimString(document.all("valor").value);
			}
		else
			{
				Campo0 = trimString(document.getElementById("Jerarquia").value);
				Campo1 = document.getElementById("rbUnoMismo");
				Campo2 = trimString(document.getElementById("valor").value);
			};		
		if (pAccion == 1)
			{
				if (Campo0.length == 0)
					{
						alert(lsMensajeAlta[0]);
					}
				else
					{
						if (fCualSelecciono(Campo1) == 0 || fCualSelecciono(Campo1) == 1)
							{
								lbDevuelve = true;
							}
						else
							{
								alert(lsMensajeAlta[1]);
							};
					};
			}
		else
			{
				if (pAccion == 2)
					{
						if (Campo2.length == 0)
							{
								alert(lsEvaluado[0]);
							}
						else
							{
								if (Campo0.length == 0)
									{
										alert(lsMensajeAlta[0]);
									}
								else
									{
										lbDevuelve = true;
									};
							};
					}
				else
					{
						if (Campo2.length == 0)
							{
								alert(lsEvaluado[1]);
							}
						else
							{
								if (Campo0.length == 0)
									{
										alert(lsMensajeAlta[0]);
									}
								else
									{
										lbDevuelve = true;
									};
							};
					};
			};
		return (lbDevuelve);
	};

/* -----------------------------------------------------------------------------------*/ 
function ValidarElementos(pIdioma,pAccion)
   {
	var lbDevuelve2 = false;
      if (pIdioma == 0) 
            {
               switch (pAccion)
						{
						   case 1:
								MiMensaje = "Por favor proporcione la información requerida.";
								break; 
							case 2:
								MiMensaje = "Por favor seleccione el elemento que desea modificar.";
								break; 
							case 3:
								MiMensaje = "Por favor seleccione el elemento que desea borrar.";
								break; 
						};
            }
         else
            {
                switch (pAccion)
						{
						   case 1:
								MiMensaje = "Please type the required information.";
								break; 
							case 2:
								MiMensaje = "Please select the item that you want to change.";
								break; 
							case 3:
								MiMensaje = "Please select the item that you want to delete.";
								break; 
							
						};
            };
         if (document.frmABCElemento.Nombre.value.length == 0)
            {
                alert(MiMensaje);
				if (lbIE == true)
					{
						document.all("Nombre").focus();
					}
				else
					{
						document.getElementById("Nombre").focus();
					};
						
			}
		else
			{
				if (document.frmABCElemento.Comentario.value.length == 0)
					{
						alert(MiMensaje);
						if (lbIE == true)
							{
								document.all("Comentario").focus();
							}
						else
							{
								document.getElementById("Comentario").focus();
							};
					}
				else
					{
						lbDevuelve2 = true;
						document.frmABCElemento.submit();
					};
			}
		return (lbDevuelve2);		  
	};
/* -----------------------------------------------------------------------------------*/ 
function fPuede(pIdioma, pValor, pAccion)
	{
		var lbDevuelve;
		var lsPuede;
		var lsCuidado;
		var lsValorCampo;
		switch (pIdioma)
			{
			  case 0:
			     	switch (pAccion)
						{
						   case 'A':
						   
								lsCuidado = 'El elemento [' + pValor + '] será agregado.\n¿Es lo que desea?'; 
								lsPuede = 'Por favor proporcione toda la información requerida para poderla agregar.';
								break; 
							case 'B':
								lsCuidado = 'Si borra este puesto, afectará a todos los perfiles que lo tengan incluído.\n¿Es lo que desea hacer?'; 
								lsPuede = 'Por favor escoga el puesto que desea borrar.';
								break; 
							case 'E':
								lsCuidado = 'Al editar un puesto afectará a todos los perfiles que lo incluyan. \n ¿Esta seguro de efectuar esta operación?'; 
								lsPuede = 'Por favor escoga el puesto que desea modificar.';
								break; 
							case 'I':
								lsCuidado = ''; 
								lsPuede = 'Por favor escoga el puesto que desea ver en un reporte.';
								break; 
						};				
					break;
			 case 1:
			    	switch (pAccion)
						{
							case 'A':
								lsCuidado = 'The item [ ' + pValor + ' ] will be added.\nIs what you want?'; 
								lsPuede = 'Please enter all the requested information to be able for adding.';
								break; 
							case 'B':
								lsCuidado = 'If you delete this position, all the related profiles will be affected. \n Is what you want?'; 
								lsPuede = 'Please choose the position that you want to delete.'; 
								break; 
							case 'E':
								lsCuidado = 'If you change this position, all the related profiles will be affected. Is what you want?'; 
								lsPuede = 'Please choose the position that you want to change.'; 
								break; 
							case 'I':
								lsCuidado = ''; 
								lsPuede = 'Please choose the position that you want to report.';
								break; 
						};				
						break;
			case 2:
			     	switch (pAccion)
						{
							case 'A':
								lsCuidado = 'The item [ ' + pValor + ' ] will be added.\nIs what you want?'; 
								lsPuede = 'Please enter all the requested information to be able for adding.';
								break; 
							case 'B':
								lsCuidado = 'If you delete this position, all the related profiles will be affected. \n Is what you want?'; 
								lsPuede = 'Please choose the position that you want to delete.'; 
								break; 
							case 'E':
								lsCuidado = 'If you change this position, all the related profiles will be affected. Is what you want?'; 
								lsPuede = 'Please choose the position that you want to change.'; 
								break; 
							case 'I':
								lsCuidado = ''; 
								lsPuede = 'Please choose the position that you want to report.';
								break; 
						};				
				break;
			case 3:
			     	switch (pAccion)
						{
							case 'A':
								lsCuidado = 'The item [ ' + pValor + ' ] will be added.\nIs what you want?'; 
								lsPuede = 'Please enter all the requested information to be able for adding.';
								break; 
							case 'B':
								lsCuidado = 'If you delete this position, all the related profiles will be affected. \n Is what you want?'; 
								lsPuede = 'Please choose the position that you want to delete.'; 
								break; 
							case 'E':
								lsCuidado = 'If you change this position, all the related profiles will be affected. Is what you want?'; 
								lsPuede = 'Please choose the position that you want to change.'; 
								break; 
							case 'I':
								lsCuidado = ''; 
								lsPuede = 'Please choose the position that you want to report.';
								break; 
						};				
				break;			
			};
		lsValorCampo = trimString(pValor);
		if (lsValorCampo.length == 0 || lsValorCampo == '0') 
			{ 
				lbDevuelve = false; 
				alert(lsPuede); 
			}
		else
			{
				lbDevuelve = true;
			};
		return(lbDevuelve);			
	};		
/* -----------------------------------------------------------------------------------*/ 
function fPuedeImprimir(pIdioma)
	{
		var lbDevuelve=true;
		if (document.getElementById('opcElPuesto').value  == 0) 
			{ 
				switch (pIdioma)
				{
					case 0:
						alert('No ha elegido un puesto para esta acción, o se encuentra agregando.'); 
						break;
					case 1:					
						alert('You need to choose a position for this feature or perhaps you are trying to add.'); 
						break;
					case 2:
						alert('You need to choose a position for this feature or perhaps you are trying to add.'); 
						break;
					case 3:
						alert('You need to choose a position for this feature or perhaps you are trying to add.'); 
						break;
				};
				lbDevuelve = false; 
			}
		else
			{
				AbreVentana(10);
			};
		return lbDevuelve;						
	};		
/* -----------------------------------------------------------------------------------*/ 
function fValidaRespuestas(pCategoria, pIdioma, pAlMenos2)
	{
		var lbDevuelve = true;
		var lnFin      = 0;
		var lsMensaje = '';
		var ln21 = 0;
		var ln22 = 0;
		var ln23 = 0;
		var ln24 = 0;
		var ln25 = 0;
		var lnValor = 0;
		switch (pIdioma)
			{
			case 0:
				lsMensaje21 = 'No ha seleccionado al menos 2 veces "Criticamente importante". Por favor utilice 2 veces cada respuesta de la escala.';
				lsMensaje22 = 'No ha seleccionado al menos 2 veces "Importante la mayor parte del tiempo". Por favor utilice 2 veces cada respuesta de la escala.';
				lsMensaje23 = 'No ha seleccionado al menos 2 veces "De importancia promedio". Por favor utilice 2 veces cada respuesta de la escala.';
				lsMensaje24 = 'No ha seleccionado al menos 2 veces "De importancia ocasional". Por favor utilice 2 veces cada respuesta de la escala.';
				lsMensaje25 = 'No ha seleccionado al menos 2 veces "Sin importancia". Por favor utilice 2 veces cada respuesta de la escala.';
				break;
			case 1:
				lsMensaje21 = 'You have not scored "critically important" option two times. Please use each element of the scale at least twice.';
				lsMensaje22 = 'You have not scored "important most of the time" option two times. Please use each element of the scale at least twice.';
				lsMensaje23 = 'You have not scored "of average importance" option two times. Please use each element of the scale at least twice.';
				lsMensaje24 = 'You have not scored "import occasionally" option two times. Please use each element of the scale at least twice.';
				lsMensaje25 = 'You have not scored "seldom important" option two times. Please use each element of the scale at least twice.';
				break;
			case 2:
				lsMensaje21 = 'Não selecionou a 2 vezes "extremamente importante" ao menos';
				lsMensaje22 = 'Não selecionou a 2 vezes "importante a maioria do tempo" ao menos';
				lsMensaje23 = 'Não selecionou a 2 vezes "de importância comum" ao menos';
				lsMensaje24 = 'Não selecionou a 2 vezes "importante ocasionalmente" ao menos';
				lsMensaje25 = 'Não selecionou a 2 vezes "raramente importante" ao menos';
				break;
			case 3:
				lsMensaje21 = 'Il valore “di fondamentale importanza” è stato assegnato una sola volta. I valori della scala vanno utilizzati almeno 2 volte.';
				lsMensaje22 = 'Il valore  “spesso importante” è stato assegnato una sola volta. I valori della scala vanno utilizzati almeno 2 volte.';
				lsMensaje23 = 'Il valore “mediamente importante” è assegnato una sola volta. I valori della scala vanno utilizzati almeno 2 volte.';
				lsMensaje24 = 'Il valore “qualche volta importante” è stato assegnato una sola volta. I valori della scala vanno utilizzati almeno 2 volte.';
				lsMensaje25 = 'il valore “raramente o mai importante” è stato assegnato una sola volta. I valori della scala vanno utilizzati almeno 2 volte.';
				break;

			};
		switch (pCategoria)
			{
				case 1:
					lnFin = 28;
					break; 
				case 2:
					lnFin = 28;
					break; 
				case 3:
					lnFin = 28;
					break; 
				case 4:
					lnFin = 30;
					break; 
				case 5:
					lnFin = 24;
					break; 
			};		
		for (var C=1; C<=lnFin; C++)
			{
				switch(pIdioma)
					{
						case 0:
							lsMensaje = 'No ha calificado la sentencia #' + C + '. Por favor seleccione una opción de la escala';
							break;
						case 1:
							lsMensaje = 'You have not scored sentence #' + C + '. Please select an option from the scale';
							break;
						case 2:
							lsMensaje = 'A pergunta # ' + C + ' não pode ser espaço em branco';
							break;
						case 3:
							lsMensaje = 'Occorre assegnare un valore alla frase #' + C + '';
							break;

					};
				lnValor = document.all('q'+C).value;
				if (lnValor == '') 
					{
						lbDevuelve = false;
						alert(lsMensaje);
						break;
					}
				else
					{
						if (lnValor == 1)
								ln21 = ln21 + 1;
						else
							if (lnValor == 2)
									ln22 = ln22 + 1;
							else	
								if (lnValor == 3)
										ln23 = ln23 + 1;
								else
									if (lnValor == 4)
											ln24 = ln24 + 1;
									else
										if (lnValor == 5)
												ln25 = ln25 + 1;
					};
			};					
		if (lbDevuelve==true)
			{
				if (ln21<2)
					{
						lbDevuelve = false;
						alert(lsMensaje21);
					}
				else
					if (ln22<2)
						{
							lbDevuelve = false;
							alert(lsMensaje22);
						}
					else	
						if (ln23<2)
							{
								lbDevuelve = false;
								alert(lsMensaje23);
							}
						else
							if (ln24<2)
								{
									lbDevuelve = false;
									alert(lsMensaje24);
								}
							else
								if (ln25<2)
									{
										lbDevuelve = false;
										alert(lsMensaje25);
									}
			};
		return (lbDevuelve);
	};




/*
A partir de aqui falta traduccion
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
*/
/* -----------------------------------------------------------------------------------*/ 
function fContestaTodoLeader(pIdioma, pCuestionario)
	{
		var lbOk;
		var Nombres;
		var aLosNombres;
		var lsMensajes;
		var Respuesta;
		var i;
		var lnSuma;
		lbOk = true;
		LosNombres='';
		lsMensajes = "Por favor evalúe la frase # |Please score the sentence # |Please score the sentence # ".split("|");
		switch (pCuestionario)
			{
				case 1:
						lnSuma = 0;
						break; 
				case 2:
						lnSuma = 16;
						break; 
				case 3:
						lnSuma = 32;
						break; 
				case 4:
						lnSuma = 48;
						break; 
			};
		i=0;
		for (i=0;i<frmLeader.elements.length;i++)
			{
				if (frmLeader.elements[i].type=="radio")
					{
						LosNombres = LosNombres + '|' + frmLeader.elements[i].name;
						i+=4;
					};
			};
		aLosNombres = LosNombres.split("|");
		i=0;
		for (i=1; i<aLosNombres.length; i++)
			{
				if (ConAll == true)
					{
						Respuesta = fCualSelecciono(document.all(aLosNombres[i]));
					}
				else
					{
						Respuesta = fCualSelecciono(document.getElementById(aLosNombres[i]));
					};	
				if (Respuesta == -1)
					{
						alert(lsMensajes[pIdioma] + (lnSuma + i));
						lbOk = false;
						break;
					};
			};
		return(lbOk);
	};
/* -----------------------------------------------------------------------------------*/ 
function fContestaTodoLeader1(pIdioma)
	{
		var lbOk;
		var lsMensajes;
		var lsPregunta1;
		var lsPregunta2;
		var lsPregunta3;
		lbOk = false;
		lsMensajes = "Por favor evalúe la frase # |Please score the sentence # |Please score the sentence # ".split("|");
		if (ConAll == true)
			{
				lsPregunta1 = trimString(document.all("txtPregunta1").value);
				lsPregunta2 = trimString(document.all("txtPregunta2").value);
				lsPregunta3 = trimString(document.all("txtPregunta3").value);
			}
		else
			{
				lsPregunta1 = trimString(document.getElementById("txtPregunta1").value);
				lsPregunta2 = trimString(document.getElementById("txtPregunta2").value);
				lsPregunta3 = trimString(document.getElementById("txtPregunta3").value);
			};
		if ( lsPregunta1.length == 0 )
			{
				alert(lsMensajes[pIdioma] + ' 1');
			}
		else
			{
				if ( lsPregunta2.length == 0 )
					{
						alert(lsMensajes[pIdioma] + ' 2');
					}
				else
					{
						if ( lsPregunta3.length == 0 )
							{
								alert(lsMensajes[pIdioma] + ' 3');
							}
						else
							{
								lbOk = true;								
							};
					};
			};
		return(lbOk);
	};
/* -----------------------------------------------------------------------------------*/ 
function fContestaTodoLeader2(pIdioma)
	{
		var lbOk;
		var lsMensajes;
		var lsPregunta1;
		var lsPregunta2;
		var lsPregunta3;
		lbOk = false;
		lsMensajes = "Por favor evalúe la frase # |Please score the sentence # |Please score the sentence # ".split("|");
		if (ConAll == true)
			{
				lsPregunta1 = trimString(document.all("txtPregunta4").value);
				lsPregunta2 = trimString(document.all("txtPregunta5").value);
			}
		else
			{
				lsPregunta1 = trimString(document.getElementById("txtPregunta4").value);
				lsPregunta2 = trimString(document.getElementById("txtPregunta5").value);
			};
		if ( lsPregunta1.length == 0 )
			{
				alert(lsMensajes[pIdioma] + ' 4');
			}
		else
			{
				if ( lsPregunta2.length == 0 )
					{
						alert(lsMensajes[pIdioma] + ' 5');
					}
				else
					{
						lbOk = true;								
					};
			};
		return(lbOk);
	};
/* -----------------------------------------------------------------------------------*/ 
function fAccesoHCI360(pIdioma)
	{
		var lbDevuelve;
		var lsMensajes = new Array();
		lbDevuelve = false;
		switch (pIdioma)
			{
				case 0:
						lsMensajes = "Por favor proporcione el usuario|Por favor proporcione la contraseña|El acceso debe realizarse como Evaluador".split("|");
						break; 
				case 1:
						lsMensajes = "Please it provides the user|Please it provides the password|The access must be made like Evaluator".split("|");
						break; 
				case 2:
						lsMensajes = "Please it provides the user|Please it provides the password|The access must be made like Evaluator".split("|");
						break; 
			};
		if (ConAll == true)
			{
				usuario  = trimString(document.all("usuario").value);
				password = trimString(document.all("password").value);
			}
		else
			{
				usuario  = trimString(document.ValidarAcceso.usuario.value);
				password = trimString(document.ValidarAcceso.password.value);
			};
		if ( usuario.length == 0 )
			{
				alert(lsMensajes[0]);
			}
		else
			{
				if ( password.length == 0 )
					{
						alert(lsMensajes[1]);
					}
				else
					{
						alert(lsMensajes[2]);
					};
			};
		return(lbDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function fValidaAccesoRespondent(pIdioma)
	{
		var usuario; 
		var password;       
		var lbDevuelve = false;
		var lsMensajes;
		switch (pIdioma)
			{
				case 0:
						lsMensajes = "Por favor proporcione el usuario|Por favor proporcione la contraseña".split("|");
						break; 
				case 1:
						lsMensajes = "Please enter the user|Please enter the password".split("|");
						break; 
				case 2:
						lsMensajes = "Please enter the user|Please enter the password".split("|");
						break; 
			};	
		usuario  = trimString(document.frmLoginRespondent.usuario.value);
		password = trimString(document.frmLoginRespondent.password.value);
		if ( usuario.length == 0 )
			{
				alert(lsMensajes[0]);
			}
		else
			{
				if ( password.length == 0 )
					{
						alert(lsMensajes[1]);
					}
				else
					{
						lbDevuelve = true;
					};
			};
		return (lbDevuelve);		
	};
/* -----------------------------------------------------------------------------------*/ 
function fValidaAccesoEvalInt2(pIdioma)
	{
		var usuario; 
		var password;       
		var lbDevuelve = false;
		var lsMensajes;
		switch (pIdioma)
			{
				case 0:
						lsMensajes = "Por favor proporcione el usuario|Por favor proporcione la contraseña".split("|");
						break; 
				case 1:
						lsMensajes = "Please enter the user|Please enter the password".split("|");
						break; 
				case 2:
						lsMensajes = "Please enter the user|Please enter the password".split("|");
						break; 
			};	
		usuario  = trimString(document.frmLoginEvalInt2.usuario.value);
		password = trimString(document.frmLoginEvalInt2.password.value);
		if ( usuario.length == 0 )
			{
				alert(lsMensajes[0]);
			}
		else
			{
				if ( password.length == 0 )
					{
						alert(lsMensajes[1]);
					}
				else
					{
						lbDevuelve = true;
					};
			};
		return (lbDevuelve);		
	};
/* -----------------------------------------------------------------------------------*/ 
function fCualenJerarquia(pJerarquia, pUnoMismo, pIdJerarquia)
	{
		if (lbIE == true)
			{
				document.all("Jerarquia").value = pJerarquia; 
				document.all("valor").value     = pIdJerarquia; 
			}
		else
			{
				document.getElementById("Jerarquia").value = pJerarquia;
				document.getElementById("valor").value     = pIdJerarquia; 
			};
		document.frmJerarquia.rbUnoMismo[pUnoMismo].checked = true;
	};
/* -----------------------------------------------------------------------------------*/ 
function ValidaJerarquiaOdl(pIdioma,pAccion)
	{
		var lbDevuelve2 = false;
		if (pIdioma == 0) 
			{
				switch (pAccion)
					{
						case 1:
								MiMensaje = "Campo Requerido";
								break; 
						case 2:
								MiMensaje = "Seleccione la Jerarquía que desea Modificar";
								break; 
						case 3:
								MiMensaje = "Seleccione la Jerarquía a Eliminar";
								break; 
					};
			}
		else
			{
				switch (pAccion)
					{
						case 1:
								MiMensaje = "Required field";
								break; 
						case 2:
								MiMensaje = "Select the Hierarchy you want to modify";
								break; 
						case 3:
								MiMensaje = "Select the Hierarchy you want to eliminate";
								break; 
					};
			};
		if (document.frmJerarquia.Jerarquia.value.length == 0)
			{
				alert(MiMensaje);
				if (lbIE == true)
					{
						document.all("Jerarquia").focus();
					}
				else
					{
						document.getElementById("Jerarquia").focus();
					};
			}
		else
			{
				lbDevuelve2 = true;
				document.frmJerarquia.submit();
			};
		return (lbDevuelve2);		  
	};
/* -----------------------------------------------------------------------------------*/ 
function fCualenCategoriaH(pNombreCategoria,pIdCategoria,pPromedioMax)
	{
		if (lbIE == true)
			{
				document.all("NombreCategoria").value =pNombreCategoria; 
				document.all("Valor").value= pIdCategoria;
				document.all("PromedioMax").value =pPromedioMax; 
			}
		else
			{
				document.getElementById("NombreCategoria").value= pNombreCategoria;
				document.getElementById("ProemdioMax").value= pPromedioMax;
				document.getElementById("Valor").value= pIdCategoria;
			};
	};
/* -----------------------------------------------------------------------------------*/ 
function fCualenHabilidades(pNombreHabilidad,pDescripcion,pIdHabilidad)
	{
		if (lbIE == true)
			{
				document.all("NombreHabilidad").value =pNombreHabilidad; 
				document.all("Descripcion").value =pDescripcion; 
				document.all("Valor").value= pIdHabilidad;
			}
		else
			{
				document.getElementById("NombreHabilidad").value= pNombreHabilidad;
				document.getElementById("Descripcion").value= pDescripcion;
				document.getElementById("Valor").value= pIdHabilidad;
			};
	};
/* -----------------------------------------------------------------------------------*/ 
function fCualenEvaluador(pFirstName, pLastName, pIdEvaluador, pCorreo, pEvalua)
	{
		var TieneEI;
		var TienePDP;
		var TieneLeader;
		if ( ConAll == true )
			{
				document.all("FirstName").value = pFirstName;
				document.all("LastName").value  = pLastName;
				document.all("Valor").value     = pIdEvaluador;
				document.all("correo").value    = pCorreo;
			}
		else
			{
				document.getElementById("FirstName").value = pFirstName;
				document.getElementById("LastName").value  = pLastName;
				document.getElementById("Valor").value     = pIdEvaluador;
				document.getElementById("Correo").value    = pCorreo;
			};
		pEvalua = "   " + pEvalua
		TieneEI     = (pEvalua.indexOf('1') > 0) ? true : false;
		TienePDP    = (pEvalua.indexOf('2') > 0) ? true : false;
		TieneLeader = (pEvalua.indexOf('3') > 0) ? true : false;
		document.frmAltaEvaluador.TieneEI.checked      = TieneEI;
		document.frmAltaEvaluador.TienePDP.checked     = TienePDP;
		document.frmAltaEvaluador.TieneLeader.checked  = TieneLeader;
	};
/* -----------------------------------------------------------------------------------*/ 
function fCualenElementos(pNombre, pComentario, pIdPuestoElemento)
	{
		if (lbIE == true)
			{
				document.all("Nombre").value =pNombre; 
				document.all("Comentario").value= pComentario;
				document.all("Valor").value= pIdPuestoElemento;
			}
		else
			{
				document.getElementById("Nombre").value= pNombre;
				document.getElementById("Comentario").value= pComentario;
				document.getElementById("Valor").value= pIdPuestoElemento;
			};
	};
/* -----------------------------------------------------------------------------------*/ 
function fRegresaValor(pQueRegresa) 
	{
		if (pQueRegresa.length > 0)
			{
				var lnSeccion = document.getElementById('Seccion').value;
				var laValores = pQueRegresa.split("|");
				switch (lnSeccion)
					{
						case '1':
									window.opener.document.frmCatPuesto.STYLE_D.value = laValores[0];
									window.opener.document.frmCatPuesto.STYLE_I.value = laValores[1];
									window.opener.document.frmCatPuesto.STYLE_S.value = laValores[2];
									window.opener.document.frmCatPuesto.STYLE_C.value = laValores[3];
									window.opener.document.frmCatPuesto.Tipico.value = laValores[4];
									window.opener.document.frmCatPuesto.TextoTipico.value = laValores[5];
									break; 
						case '2':
									window.opener.document.frmCatPuesto.VALUES_S.value = laValores[0];
									window.opener.document.frmCatPuesto.VALUES_T.value = laValores[1];
									window.opener.document.frmCatPuesto.VALUES_E.value = laValores[2];
									window.opener.document.frmCatPuesto.VALUES_P.value = laValores[3];
									window.opener.document.frmCatPuesto.Tipico.value = laValores[4];
									window.opener.document.frmCatPuesto.TextoTipico.value = laValores[5];
									break; 
						case '3':
									window.opener.document.frmCatPuesto.THINK_S.value = laValores[0];
									window.opener.document.frmCatPuesto.THINK_M.value = laValores[1];
									window.opener.document.frmCatPuesto.THINK_E.value = laValores[2];
									window.opener.document.frmCatPuesto.THINK_G.value = laValores[3];
									window.opener.document.frmCatPuesto.Tipico.value = laValores[4];
									window.opener.document.frmCatPuesto.TextoTipico.value = laValores[5];
									break; 
						case '4':
									window.opener.document.frmCatPuesto.EMOTI_A.value = laValores[0];
									window.opener.document.frmCatPuesto.EMOTI_M.value = laValores[1];
									window.opener.document.frmCatPuesto.EMOTI_S.value = laValores[2];
									window.opener.document.frmCatPuesto.EMOTI_E.value = laValores[3];
									window.opener.document.frmCatPuesto.EMOTI_R.value = laValores[4];
									window.opener.document.frmCatPuesto.Tipico.value  = laValores[5];
									window.opener.document.frmCatPuesto.TextoTipico.value = '';
									break; 
						case '5':
									window.opener.document.frmCatPuesto.RATIO_V.value = laValores[0];
									window.opener.document.frmCatPuesto.RATIO_S.value = laValores[1];
									window.opener.document.frmCatPuesto.RATIO_N.value = laValores[2];
									window.opener.document.frmCatPuesto.Tipico.value  = laValores[3];
									window.opener.document.frmCatPuesto.TextoTipico.value = '';
									break; 
					};
			};
		window.close();
	};		

/* ----- Organizar las funciones desde aqui -----*/
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
/* -----------------------------------------------------------------------------------*/ 
function fActualizaDato()
	{
		document.frmCatPuesto.PuestoActual.value=document.frmCatPuesto.opcElPuesto.value; 
		document.frmCatPuesto.NombrePuesto.value=TextoSelecionado(document.frmCatPuesto.opcElPuesto);
	};
/* -----------------------------------------------------------------------------------*/ 
function AbreVentana(pQuePuesto, pQueAccion, pNombrePuesto)
		{
			var CualAbro='';
			var lnAlto=500;
			var lnAncho=700;
			var lsMensaje = '';
			switch (pQueAccion)
					{
						case 1:
							CualAbro='EvaluacionIntegrada.asp?wci=Preferencias&pAccion=A&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 2:
							CualAbro='EvaluacionIntegrada.asp?wci=EduCapExp&Tipo=Edu&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 3:
							CualAbro='EvaluacionIntegrada.asp?wci=EduCapExp&Tipo=Cap&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 4:
							CualAbro='EvaluacionIntegrada.asp?wci=EduCapExp&Tipo=Exp&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 5:
							CualAbro='EvaluacionIntegrada.asp?wci=Compatibilidades&Tipo=EST&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 6:
							CualAbro='EvaluacionIntegrada.asp?wci=Compatibilidades&Tipo=VAL&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 7:
							CualAbro='EvaluacionIntegrada.asp?wci=Compatibilidades&Tipo=PEN&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 8:
							CualAbro='EvaluacionIntegrada.asp?wci=Compatibilidades&Tipo=EMO&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 9:
							CualAbro='EvaluacionIntegrada.asp?wci=Compatibilidades&Tipo=RAC&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 10:
							CualAbro='EvaluacionIntegrada.asp?wci=ReportePuesto&pPuesto=' + pQuePuesto + '&pResumen=No';
							break; 
						case 11:
							CualAbro='EvaluacionIntegrada.asp?wci=catEduCapExp&Tipo=Edu&pPuesto=' + pQuePuesto + '&pSeccion=6&pContrato=' + pNombrePuesto;		
							lnAlto=450;
							lnAncho=800;
							break; 
						case 12:
							CualAbro='EvaluacionIntegrada.asp?wci=catEduCapExp&Tipo=Cap&pPuesto=' + pQuePuesto + '&pSeccion=7&pContrato=' + pNombrePuesto;		
							lnAlto=450;
							lnAncho=800;
							break; 
						case 13:
							CualAbro='EvaluacionIntegrada.asp?wci=catEduCapExp&Tipo=Exp&pPuesto=' + pQuePuesto + '&pSeccion=10&pContrato=' + pNombrePuesto;		
							lnAlto=450;
							lnAncho=800;
							break; 
						case 14:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=1&pClasico=Si';
							lnAlto=350;
							lnAncho=800;
							break; 
						case 15:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=1&pClasico=No'; 
							lnAlto=350;
							lnAncho=800;
							break; 
						case 16:
							CualAbro='EvaluacionIntegrada.asp?wci=MuestraDefinicion&LosDatos='
							lnAlto=450;
							lnAncho=650;
							break; 
						case 17:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=2&pClasico=Si';
							lnAlto=350;
							lnAncho=800;
							break; 
						case 18:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=2&pClasico=No'; 
							lnAlto=350;
							lnAncho=800;
							break; 
						case 19:
//							CualAbro='DefineValores.htm'
							CualAbro='EvaluacionIntegrada.asp?wci=ReportePersona&pPersona=' + pQuePuesto;		
							lnAlto=450;
							lnAncho=650;
							break; 							
						case 20:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=3&pClasico=Si'; 
							lnAlto=350;
							lnAncho=800;
							break; 
						case 21:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=3&pClasico=No'; 
							lnAlto=350;
							lnAncho=800;
							break; 
						case 22:
							CualAbro='DefinePensamiento.htm'
							lnAlto=450;
							lnAncho=650;
							break; 							
						case 23:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=4&pClasico=No'; 
							lnAlto=350;
							lnAncho=800;
							break; 							
						case 24:
							CualAbro='DefineEmocional.htm'
							lnAlto=450;
							lnAncho=650;
							break; 							
						case 25:
							CualAbro='EvaluacionIntegrada.asp?wci=hlpClaAlt&pSeccion=5&pClasico=No'; 
							lnAlto=350;
							lnAncho=800;
							break; 							
						case 26:
							//CualAbro='DefineRacional.htm'
							lnAlto=450;
							lnAncho=650;
							break; 							
						case 27:
							CualAbro='../Evaluacion/Evaluacion.htm';
							lnAlto='450';
							lnAncho='800';
							break; 							
						case 28:
							CualAbro='../evalint/EvaluacionIntegrada.asp?pPuesto=0&pContrato=' + pQuePuesto + '&pManager=0';
							lnAlto='450';
							lnAncho='800';
							break; 			
						case 29:
							CualAbro='../Puesto/Educacion.htm'
							break; 
						case 30:
							CualAbro='../EvalInt/EvaluacionIntegrada.ASP?WCI=CompetenciasUsuario&WCE=frmCompUsuario&WCU=&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto + '&pSeccion=6';
							lnAlto='350';
							lnAncho='750';
							break; 
						case 31:
							CualAbro='../EvalInt/EvaluacionIntegrada.ASP?WCI=CompetenciasUsuario&WCE=frmCompUsuario&WCU=&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto + '&pSeccion=7';
							lnAlto='350';
							lnAncho='750';
							break; 
						case 32:
							CualAbro='../EvalInt/EvaluacionIntegrada.ASP?WCI=CompetenciasUsuario&WCE=frmCompUsuario&WCU=&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto + '&pSeccion=8';
							lnAlto='350';
							lnAncho='750';
							break; 
						case 33:
							CualAbro='../EvalInt/EvaluacionIntegrada.ASP?WCI=CompetenciasUsuario&WCE=frmCompUsuario&WCU=&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto + '&pSeccion=9';
							lnAlto='350';
							lnAncho='750';
							break; 
						case 34:
							CualAbro='../EvalInt/EvaluacionIntegrada.ASP?WCI=CompetenciasUsuario&WCE=frmCompUsuario&WCU=&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto + '&pSeccion=10';
							lnAlto='350';
							lnAncho='750';
							break; 
						case 35:
							CualAbro='../Puesto/Estilo.htm'
							break; 
						case 36:
							CualAbro='../Persona/Estilo.htm'
							break; 
						case 37:
							CualAbro='../Puesto/Valores.htm'
							break; 
						case 38:
							CualAbro='../Persona/Valores.htm'
							break; 
						case 39:
							CualAbro='../Puesto/Pensamiento.htm'
							break; 
						case 40:
							CualAbro='../Persona/Pensamiento.htm'
							break; 
						case 41:
							CualAbro='../Puesto/Emocional.htm'
							break; 
						case 42:
							CualAbro='../Persona/Emocional.htm'
							break; 
						case 43:
							CualAbro='../Puesto/Racional.htm'
							break; 
						case 44:
							CualAbro='../Persona/Racional.htm'
							break; 
						case 45:
							CualAbro='../evaluado/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&pUsuario=DefPos&respcode=M&pSeccion=1&pPuesto=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=350;
							lnAncho=800;
							break; 
						case 46:
							CualAbro='../evaluado/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&pUsuario=DefPos&respcode=M&pSeccion=2&pPuesto=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=350;
							lnAncho=800;
							break; 
						case 47:
							CualAbro='../evaluado/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&pUsuario=DefPos&respcode=M&pSeccion=3&pPuesto=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=350;
							lnAncho=800;
							break; 
						case 48:
							CualAbro='../evaluado/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&pUsuario=DefPos&respcode=M&pSeccion=4&pPuesto=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=350;
							lnAncho=800;
							break; 
						case 49:
							CualAbro='../evaluado/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&pUsuario=DefPos&respcode=M&pSeccion=5&pPuesto=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=350;
							lnAncho=800;
							break; 
						case 50:
							CualAbro='../Evaluacion/Evaluacion1.htm';
							lnAlto='450';
							lnAncho='800';
							break; 							
						case 51:
							CualAbro='EvaluacionIntegrada.asp?wci=EduCapExp&Tipo=GER&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 52:
							CualAbro='EvaluacionIntegrada.asp?wci=EduCapExp&Tipo=RH&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 53:
							CualAbro='EvaluacionIntegrada.asp?wci=catEduCapExp&Tipo=GER&pPuesto=' + pQuePuesto + '&pSeccion=8&pContrato=' + pNombrePuesto;		
							break; 
						case 54:
							CualAbro='EvaluacionIntegrada.asp?wci=catEduCapExp&Tipo=RH&pPuesto=' + pQuePuesto + '&pSeccion=9&pContrato=' + pNombrePuesto;		
							break; 
						case 55:
							CualAbro='EvaluacionIntegrada.asp?wci=Preferencias&pAccion=E&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 56:
							CualAbro='EvaluacionIntegrada.asp?wci=Preferencias&pAccion=B&pPuesto=' + pQuePuesto + '&pNombrePuesto=' + pNombrePuesto;
							break; 
						case 57:
							CualAbro='EvaluacionIntegrada.asp?wci=ReportePuesto&pPuesto=' + pQuePuesto + '&pResumen=Si';
							break; 							
						case 58:
							CualAbro='../EvalInt/EvaluacionIntegrada.asp?wci=Persona&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto;
							if (pQuePuesto==0) 
								{	
									lsMensaje = 'No se ha asignado un puesto';
								};
							break; 							
						case 59:
							CualAbro='../EvalInt/EvaluacionIntegrada.asp?wci=Persona&pPuesto=' + pQuePuesto + '&pPersona=' + pNombrePuesto;
							if (pQuePuesto==0) 
								{	
									lsMensaje ='A position has not been assigned';
								}
							else
								{
								};
							break; 				
						case 60:
							CualAbro='manager.ASP?WCI=AsignaEvaluados&pContrato=' + pQuePuesto + '&pEvaluador=' + pNombrePuesto;
							lnAlto=600;
							lnAncho=800;
							break; 		
					    case 61:
							CualAbro='WCEvalInt2.ASP?WCI=PantallaEvaluar&pPuesto=' + pQuePuesto + '&pEvaluado=' + pNombrePuesto;
							lnAlto=600;
							lnAncho=800;
							break; 				
						case 62:
							// CualAbro='../EvalInt2/WCEvalInt2.ASP?WCI=EvalIntCompleto&pPuesto=' + pQuePuesto + '&pEvaluado=' + pNombrePuesto;
							CualAbro='../EvalInt2/WCEvalInt2.ASP?WCI=EvalIntCompleto&pPuesto=' + pQuePuesto + '&pEvaluado=' + pNombrePuesto;
//alert(CualAbro); 
							lnAlto=600;
							lnAncho=800;
							break; 		
						case 63:
							CualAbro='manager.ASP?WCI=Jerarquia&pAgregaRelacion=N&ContId=' + pQuePuesto;
							lnAlto=600;
							lnAncho=800;
							break; 		
					    case 64:
							CualAbro='manager.ASP?WCI=Reportes&pIdioma=' + pQuePuesto + '&pPersona=' + pNombrePuesto;
							lnAlto=450;
							lnAncho=450;
							break; 		
						case 65:
							if (pQuePuesto == "")
								CualAbro='manager.ASP?WCI=AltaEvaluador&pAgregaRelacion=N&rbEvalua=0&respid=0';
							else
								CualAbro='manager.ASP?WCI=AltaEvaluador&pAgregaRelacion=S&rbEvalua=' + fCualSelecciono(pQuePuesto) + '&respid=' + pNombrePuesto;
							lnAlto=600;
							lnAncho=850;
							break; 		
					    case 66:
							CualAbro='manager.ASP?WCI=ComparaPersonaClasico&pPersona=' + pQuePuesto + '&pIdioma=' + pNombrePuesto;
							lnAlto=600;
							lnAncho=750;
							break; 		
						case 67:
							CualAbro='manager.ASP?WCI=DefinicionClasicos&pClasico=' + pQuePuesto + '&pCategoria=' + pNombrePuesto;
							lnAlto=400;
							lnAncho=550;
							break; 		
					    case 68:
							CualAbro='manager.ASP?WCI=AltaCategoriaH&amp;WCE=submit&amp;WCU';
							lnAlto=600;
							lnAncho=800;
							break; 		
						case 69:
							CualAbro='manager.ASP?WCI=AltaHabilidades&pIdCategoria=' + pNombrePuesto + '&amp;WCE=submit&amp;WCU';
							lnAlto=600;
							lnAncho=800;
							break; 		
						case 70:
							CualAbro='manager.ASP?WCI=Escala&pClasico=' + pQuePuesto + '&pCategoria=' + pNombrePuesto;
							lnAlto=400;
							lnAncho=500;
							break; 
						case 71:
							CualAbro='../EvalInt2/WCEvalInt2.ASP?WCI=PDPCompleto&pIdEvaluado=' + pQuePuesto + '&pContrato=' + pNombrePuesto;
							lnAlto=600;
							lnAncho=750;
							break; 		
						case 72:
							CualAbro= 'manager.ASP?WCI=TextoOpcional&pEvaluado=' +  pQuePuesto;
							lnAlto=300;
							lnAncho=750;
							break; 		
						case 73:
							CualAbro= '/evalint/EvaluacionIntegrada.asp?wci=CapturaDirecta&pPuesto=' +  pQuePuesto + '&pSeccion=' + pNombrePuesto;
							lnAlto=300;
							lnAncho=750;
							break; 	
						case 74:
							CualAbro='/evalint/EvaluacionIntegrada.asp?wci=ReporteEI&pRespId=' + pQuePuesto + '&pIdioma=' + pNombrePuesto;
						case 75:
							lnAlto=600;
							lnAncho=850;
							CualAbro='/respondent/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&usuario=' + pQuePuesto + '&password=' + pNombrePuesto + '&respcode=R';
					};			
			if (lsMensaje.length > 0)
				{
					alert(lsMensaje);
				}
			else
				{
					window.open(CualAbro, '', 'scrollbars=1, Width='+lnAncho+'px, Height='+lnAlto+'px, Status=0, location=0');
				};
			return (false);
		}
/* -----------------------------------------------------------------------------------*/ 
function AbreVentanaEvalInt(pQueContrato, pQueAccion, pRelacionEvalInt)
		{
			var CualAbro='';
			var lnAlto=600;
			var lnAncho=800;
			var lsMensaje = '';
			switch (pQueAccion)
					{
						case 1:
							CualAbro='./WCEvalInt2.ASP?WCI=PantallaEvaluar&pAdmin=M&pQueContrato=' + pQueContrato + '&pRelacionEvalInt=' + pRelacionEvalInt;
							lnAlto=600;
							lnAncho=800;
							break; 				
						case 2:
							CualAbro='./WCEvalInt2.ASP?WCI=PantallaEvaluarPDP&pQueContrato=' + pQueContrato + '&pRelacionEvalInt=' + pRelacionEvalInt;
							lnAlto=600;
							lnAncho=800;
							break; 		
					};	
					

			if (lsMensaje.length > 0)
				{
					alert(lsMensaje);
				} 
			else
				{
					window.open(CualAbro, 'Menu', 'scrollbars=1, Width='+lnAncho+'px, Height='+lnAlto+'px, Status=0, location=0');
				};
			return (false);
		};
/* -----------------------------------------------------------------------------------*/ 
function jsMuestraTexto(pQueTexto, pIdioma, pSeccion)
		{
			var vDefinicion;
			var lsValores;
			var i;
			switch (pSeccion)
				{
					case 1:
						for (i=0;i<document.frmCatPuesto.SelClaAltEva.length;i++)
							{ 
							   if (document.frmCatPuesto.SelClaAltEva[i].checked) 
							      break; 
							}; 
						lsValores = '1|' + document.frmCatPuesto.STYLE_D.value + '|' + document.frmCatPuesto.STYLE_I.value + '|' + document.frmCatPuesto.STYLE_S.value + '|' + document.frmCatPuesto.STYLE_C.value + '|' + document.frmCatPuesto.Tipico.value;
						break;
					case 2:
						for (i=0;i<document.frmCatPuesto.SelClaAltEva.length;i++)
							{ 
							   if (document.frmCatPuesto.SelClaAltEva[i].checked) 
							      break; 
							}; 					
						lsValores = '2|'  +  document.frmCatPuesto.VALUES_S.value + '|' + document.frmCatPuesto.VALUES_T.value + '|' + document.frmCatPuesto.VALUES_E.value + '|' + document.frmCatPuesto.VALUES_P.value + '|' + document.frmCatPuesto.Tipico.value;
						break;
					case 3:
						for (i=0;i<document.frmCatPuesto.SelClaAltEva.length;i++)
							{ 
							   if (document.frmCatPuesto.SelClaAltEva[i].checked) 
							      break; 
							};
						lsValores =  '3|'  + document.frmCatPuesto.THINK_S.value + '|' + document.frmCatPuesto.THINK_M.value + '|' + document.frmCatPuesto.THINK_E.value + '|' + document.frmCatPuesto.THINK_G.value + '|' + document.frmCatPuesto.Tipico.value;
						break;
					case 4:
						lsValores =  '4|'  + document.frmCatPuesto.EMOTI_A.value + '|' + document.frmCatPuesto.EMOTI_M.value + '|' + document.frmCatPuesto.EMOTI_S.value + '|' + document.frmCatPuesto.EMOTI_E.value + '|' + document.frmCatPuesto.Tipico.value + '|0';
						break;
					case 5:
						lsValores = '5|' + document.frmCatPuesto.RATIO_V.value + '|' + document.frmCatPuesto.RATIO_S.value + '|' + document.frmCatPuesto.RATIO_N.value + '|' + document.frmCatPuesto.Tipico.value +'|0';
						break; 
					default: 
						break; 
				};
			window.open('EvaluacionIntegrada.asp?wci=MuestraDefinicion&LosDatos='+lsValores,'Definicion','width=500,height=400,left=100,top=100,statusbar=yes,scrollbars=yes'); 
		};		
/* -----------------------------------------------------------------------------------*/ 
function fBuscaDefinicion(pValores)
	{
		window.open('EvaluacionIntegrada.asp?wci=MuestraDefinicion&LosDatos='+pValores,'Definicion','width=500,height=400,left=100,top=100,statusbar=yes,scrollbars=yes'); 
	};
/* -----------------------------------------------------------------------------------*/ 
function fVerAyuda(pSeccion, pQueTexto)
	{
		var lsValorCampo;
		var lsValores;
		var lbHayValores;
		lsValorCampo = trimString(pQueTexto);
		lbHayValores = false;
		if (lsValorCampo.length == 0) 
			{ 		
				switch(pSeccion)
					{
						case '1':
							if (document.getElementById('STYLE_D').value>0)
								lbHayValores = true;
							lsValores = '1|' + document.getElementById('STYLE_D').value + '|' + document.getElementById('STYLE_I').value + '|' + document.getElementById('STYLE_S').value + '|' + document.getElementById('STYLE_C').value;
							break; 
						case '2':
							if (document.getElementById('VALUES_S').value>0)
								lbHayValores = true;
							lsValores = '2|' + document.getElementById('VALUES_S').value + '|' + document.getElementById('VALUES_T').value + '|' + document.getElementById('VALUES_E').value + '|' + document.getElementById('VALUES_P').value;
							break; 
						case '3':
							if (document.getElementById('THINK_S').value>0)
								lbHayValores = true;
							lsValores = '3|' + document.getElementById('THINK_S').value + '|' + document.getElementById('THINK_M').value + '|' + document.getElementById('THINK_E').value + '|' + document.getElementById('THINK_M').value;
							break; 
						case '4':
							if (document.getElementById('EMOTI_A').value>0)
								lbHayValores = true;
							lsValores = '4|' + document.getElementById('EMOTI_A').value + '|' + document.getElementById('EMOTI_M').value + '|' + document.getElementById('EMOTI_S').value + '|' + document.getElementById('EMOTI_E').value + '|' + document.getElementById('EMOTI_R').value;
							break; 
						case '5':
							if (document.getElementById('RATIO_V').value>0)
								lbHayValores = true;
							lsValores = '5|' + document.getElementById('RATIO_V').value + '|' + document.getElementById('RATIO_S').value + '|' + document.getElementById('RATIO_N').value;
							break; 
					};
				if (lbHayValores) 
					{
						fBuscaDefinicion(lsValores);
					};
			}
		else
			{
						showHelpTip(event, pQueTexto, false); 
			};
		return (false);
	};
	
/* -----------------------------------------------------------------------------------*/ 
function fAsignaValor(pQuien)
				{
					var Destino;
					Destino = pQuien.name.replace('p', 'q')
					document.forms[0].elements[Destino].value = pQuien.value;
				};


	
/* -----------------------------------------------------------------------------------*/ 
function fValidaUnidad()	
	{
		return false;
	}

/* -----------------------------------------------------------------------------------*/ 
function fValidaDirecta(pIdioma)
	{
		var lbDevuelve;
		var lsValorFueraDeRango;

		if (pIdioma == 0)
			{
			     lsValorFueraDeRango = "Los valores definidos deben estar entre 5 y 95";
			}
		else
			{
			     lsValorFueraDeRango = "Defined numbers must be between 5 and 95";
			};
			
		lbDevuelve = true;
		
		if (document.frmCapturaDirecta.Valor1.value < 5 ||document.frmCapturaDirecta.Valor1.value > 95 )
			{
				alert(lsValorFueraDeRango);
				document.frmCapturaDirecta.Valor1.focus();
				lbDevuelve = false;
			}
		else
			{
				if (document.frmCapturaDirecta.Valor2.value < 5 ||document.frmCapturaDirecta.Valor2.value > 95 )
					{
						alert(lsValorFueraDeRango);
						document.frmCapturaDirecta.Valor2.focus();
						lbDevuelve = false;
					}
				else
					{
						if (document.frmCapturaDirecta.Valor3.value < 5 ||document.frmCapturaDirecta.Valor3.value > 95 )
							{
								alert(lsValorFueraDeRango);
								document.frmCapturaDirecta.Valor3.focus();
								lbDevuelve = false;
							}
						else
							{
								if (document.frmCapturaDirecta.pSeccion.value != 5)
									{
										if (document.frmCapturaDirecta.Valor4.value < 5 ||document.frmCapturaDirecta.Valor4.value > 95 )
											{
												alert(lsValorFueraDeRango);
												document.frmCapturaDirecta.Valor4.focus();
												lbDevuelve = false;
											}
										else
											{
												if (document.frmCapturaDirecta.pSeccion.value == 4)
													{										
														if (document.frmCapturaDirecta.Valor5.value < 5 ||document.frmCapturaDirecta.Valor5.value > 95 )
															{
																alert(lsValorFueraDeRango);
																document.frmCapturaDirecta.Valor5.focus();
																lbDevuelve = false;
															};
													};
											};
									};
							};
					};
			};
		return (lbDevuelve);
	}
/* -----------------------------------------------------------------------------------*/ 
function PonReadOnly(id, state) 
	{
alert ('Entro a readonly');
		var divObj = null;
		if (document.getElementById) 
			{
				divObj = document.getElementById(id);
			} 
		else if (document.all) 
			{
				divObj = document.all(id);
			} 
		else if (document.layers) 
			{
				divObj = document.layers[id];
			}
		if (state && divObj) 
			{
				divObj.removeAttribute("readonly");
			} 
		else 
			if(divObj) 
				{
					divObj.setAttribute("readonly","readonly");
				}
	}  				
	
/* -----------------------------------------------------------------------------------*/ 
function fAccionPanel(pRespId, pAcceso, pIdioma, pCorreo)
	{
		var laMensajes = "Por favor póngase en contacto con un asesor de Human Capital para poder hacer evaluaciones integradas y de 360°|Please call to a Human Capital Advisor in order to activate 360° and Integrated Evaluations|Please call to a Human Capital Advisor in order to activate 360° and Integrated Evaluations".split("|");
		var laSinCorreo = "El correo del administrador de la unidad es requerido|The email of unit´s manager is required|The email of unit´s manager is required".split("|");
		if ( trimString(pCorreo) == 0 )
			{
				alert(laSinCorreo[pIdioma]);
			}
		else
			{
				if (pAcceso == 0)
					{
						alert(laMensajes[pIdioma]);
					}
				else
					{
						document.location = 'manager.ASP?WCI=PanelDeControl&RespId=' + pRespId + '&rbEvalua=1';
					};
			};
	};
/* -----------------------------------------------------------------------------------*/ 
function fLimpiaForma()
	{
		frmControlPanel.submit();
	};	

/* -----------------------------------------------------------------------------------*/ 
function fValidaRespuestasPersona(pCategoria, pIdioma, pValida2)
	{
		var lbDevuelve = true;
		var lnFin      = 0;
		var lsMensaje = '';
		var ln21 = 0;
		var ln22 = 0;
		var ln23 = 0;
		var ln24 = 0;
		var ln25 = 0;
		var lnValor = 0;
		switch(pIdioma)
			{
				case 0:
					lsMensaje21 = 'No ha seleccionado al menos 2 veces el número 1';
					lsMensaje22 = 'No ha seleccionado al menos 2 veces el número 2';
					lsMensaje23 = 'No ha seleccionado al menos 2 veces el número 3';
					lsMensaje24 = 'No ha seleccionado al menos 2 veces el número 4';
					break;
				case 1:
					lsMensaje21 = 'You have not selected to 2 times number 1 at least';
					lsMensaje22 = 'You have not selected to 2 times number 2 at least';
					lsMensaje23 = 'You have not selected to 2 times number 3 at least';
					lsMensaje24 = 'You have not selected to 2 times number 4 at least';
					break;
				case 2:
					lsMensaje21 = 'Não selecionou a 2 vezes número 1 ao menos';
					lsMensaje22 = 'Não selecionou a 2 vezes número 2 ao menos';
					lsMensaje23 = 'Não selecionou a 2 vezes número 3 ao menos';
					lsMensaje24 = 'Não selecionou a 2 vezes número 4 ao menos';
					break;
				case 3:
					lsMensaje21 = 'Non avete selezionato almeno a 2 volte numero 1';
					lsMensaje22 = 'Non avete selezionato almeno a 2 volte numero 2';
					lsMensaje23 = 'Non avete selezionato almeno a 2 volte numero 3';
					lsMensaje24 = 'Non avete selezionato almeno a 2 volte numero 4';
					break;

			};

		switch (pCategoria)
			{
				case 6:
					lnFin = 28;
					break; 
				case 7:
					lnFin = 28;
					break; 
				case 8:
					lnFin = 28;
					break; 
				case 9:
					lnFin = 50;
					break; 
				case 10:
					lnFin = 24;
					break; 
			};		

		for (var C=1; C<=lnFin; C++)
			{
				switch (pIdioma)
					{
						case 0:
							lsMensaje = 'No ha respondido la sentencia #' + C + ' con un valor de la escala';
							break;
						case 1:
							lsMensaje = 'Sentence #' + C + ' must be answered using the scale.';
							break;
						case 2:
							lsMensaje = 'A pergunta # ' + C + ' deve ser respondida usando a escala.';
							break;
						case 3:
							lsMensaje = 'La frase #' + C + ' deve essere risposta a usando la scala.';
							break;

					};
						lnValor = document.all('q'+C).value;
				if (lnValor == '') 
					{
						lbDevuelve = false;
						alert(lsMensaje);
						break;
					}
				else
					{
						if (lnValor == 1)
								ln21 = ln21 + 1;
						else
							if (lnValor == 2)
									ln22 = ln22 + 1;
							else	
								if (lnValor == 3)
										ln23 = ln23 + 1;
								else
									if (lnValor == 4)
											ln24 = ln24 + 1;
					};
			};					
		if (lbDevuelve==true)
			{
				if (pValida2==true)
					{
						if (ln21<2)
							{
								lbDevuelve = false;
								alert(lsMensaje21);
							}
						else
							if (ln22<2)
								{
									lbDevuelve = false;
									alert(lsMensaje22);
								}
							else	
								if (ln23<2)
									{
										lbDevuelve = false;
										alert(lsMensaje23);
									}
								else
									if (ln24<2)
										{
											lbDevuelve = false;
											alert(lsMensaje24);
										}
				};
			};
		return (lbDevuelve);
	};		
/* -----------------------------------------------------------------------------------*/ 
function fResponderPuesto(pPuesto, pUsuario, pPWD, pIdioma)
	{
		var lsMensajes = new Array();
		var CualAbro;
		var lnAncho;
		var lnAlto;
		lnAncho = 800;
		lnAlto  = 600;
		lsMensajes = "No ha elegido un puesto para esta accion|It has not chosen a position for this action|It has not chosen a position for this action".split("|");
		if (pPuesto == 0)
			{
				alert(lsMensajes[pIdioma]);
			}
		else
			{
				CualAbro = '../respondent/humcap.ASP?WCI=PantallaDeAcceso&WCE=login&WCU=&usuario=' + pUsuario + '&password=' + pPWD + '&respcode=M';
				window.open(CualAbro, '', 'scrollbars=1, Width='+lnAncho+'px, Height='+lnAlto+'px, Status=0, location=0');
			};
		return(false);
	}
// Esta funcion nos ayuda a determinar que elemento fue seleccionado de un radio. 
/* -----------------------------------------------------------------------------------*/ 
function fValidaTextoOpcional()
	{
		var lbDevuelve;
		lbDevuelve = true;
		if (fCualSelecciono(document.frmTextoOpcional.rbEstilo) == -1)
			{
				lbDevuelve = false;
			}
		else
			if (fCualSelecciono(document.frmTextoOpcional.rbValores) == -1)
				{
					lbDevuelve = false;
				}
		return lbDevuelve;
	};
	
/* +----------------------+*/ 
/* | Rutinas para manager | */
/* +----------------------+*/ 

/* -----------------------------------------------------------------------------------*/ 
function fValidaAccesoManager(pIdioma)
	{
		var contrato;
		var usuario; 
		var password;       
		var lbDevuelve;
		var lsMensajes = new Array();
		lbDevuelve = false;
		switch (pIdioma)
				{
					case 0:
						lsMensajes = "Por favor proporcione el número de contrato|Por favor proporcione el usuario|Por favor proporcione la contraseña".split("|");
						break; 
					case 1:
						lsMensajes = "Please enter the number of contract|Please enter the user|Please it provides the password".split("|");
						break; 
					case 2:
						lsMensajes = "Please enter the number of contract|Please enter the user|Please it provides the password".split("|");
						break; 
				};	
		if (ConAll == true)
			{
				contrato = trimString(document.all("contrato").value);
				usuario  = trimString(document.all("usuario").value);
				password = trimString(document.all("password").value);
			}
		else
			{
				contrato = document.ValidarAcceso.contrato.value;
				usuario  = trimString(document.ValidarAcceso.usuario.value);
				password = trimString(document.ValidarAcceso.password.value);
			};

		if ( contrato.length == 0 )
			{
				alert(lsMensajes[0]);
			}
		else
			{
				if ( usuario.length == 0 )
					{
						alert(lsMensajes[1]);
					}
				else
					{
						if ( password.length == 0 )
							{
								alert(lsMensajes[2]);
							}
						else
							{
								lbDevuelve = true;
							};
					};
			};
		return (lbDevuelve);		
	};
/* -----------------------------------------------------------------------------------*/ 
function dameCheck()
      {     
      	return unescape(sArregloChecks);
      }; 	
/* -----------------------------------------------------------------------------------*/ 
function LlenatxtMoverUnidad(pIdioma, pOrigen)
      {
		var lbOk;
		var sRuta = "";
		var lvMensaje;
		switch (pOrigen)
				{
					case 0:
						lvMensaje = "Por favor seleccione los perfiles que desea mover|Please select the profiles that you wish to move|Please select the profiles that you wish to move".split("|");
						break; 
					case 1:
						lvMensaje = "Por favor seleccione los perfiles que desea enviar por correo|Please select the profiles that you wish to send by email|Please select the profiles that you wish to send by email".split("|");
						break; 
					case 2:
						lvMensaje = "Por favor seleccione por lo menos 2 Perfiles para Crear el Puesto|Please selects at least 2 Profiles to create the Position|Please selects at least 2 Profiles to create the Position".split("|");
						break; 
				};
		sRuta = dameCheck();
		sRuta  = trimString(sRuta);
		if (sRuta.length > 0)
			{
				if (pOrigen == 2)
					{
						if (sRuta.split("|").length > 2)
							{
								document.administrar.txtMoverUnidad.value = sRuta;
								lbOk = true;
							}
						else
							{
								alert(lvMensaje[pIdioma]);
								lbOk = false;
							};
					}
				else
					{
					    document.administrar.txtMoverUnidad.value = sRuta;
						lbOk = true;
					};
	      	}
		else
			{
				alert(lvMensaje[pIdioma]);
				lbOk = false;
			};
		return(lbOk);
      };
/* -----------------------------------------------------------------------------------*/ 
function abreBusquedaGeneral(sRuta, pIdioma)
      {
		var PClave;
		var OrdenBy;
		var s = document.administrar.ValorFiltro.value;
		s = trimString(s);
		if (s.length > 2)
			{
				PClave = document.administrar.ValorFiltro.value;
				if (PClave == '') 
					{
						PClave = '-';
					};
				OrdenBy = document.administrar.UsarColumna.value;
				sRuta = sRuta + '%7c' + PClave + '%7c' + OrdenBy;
				window.open(sRuta,"","top=0,left=0,scrollbars=1,height=400,width=720,status=1,toolbar=0,menubar=0,location=0");
			}
        else
			{
				if (pIdioma==0)
					{
						alert("Debe escribir al menos 3 caracteres para realizar una búsqueda de información.");
					}
				else
					{
						alert("You must type at least 3 characters in order to search information.");
					};
			};
      };
/* -----------------------------------------------------------------------------------*/ 
function fAbreFaqs(sQuien)
      {     
		window.open(sQuien,"", "width=600,height=450,status=0, menubar=0,toolbar=0, resizable=0, top=20, left=40, scrollbars=yes");
      };      
/* -----------------------------------------------------------------------------------*/ 
function agregaCheck(pDeQuien)
	{     
		var lsElimar="";
		var sNombre;
		//sArregloChecks = document.administrar.txtMoverUnidad.value;
		sArregloChecks = document.forms[0].txtMoverUnidad.value;
		sNombre = pDeQuien.name  + "|";
		if (pDeQuien.checked==true)
			{
				if(sArregloChecks == '')
					{
						sArregloChecks = sNombre;
					}
				else
					{
						sArregloChecks = sArregloChecks + sNombre; 
					}
			}
		else
			{
				lsEliminar = sNombre;
				sArregloChecks = sArregloChecks.replace(lsEliminar,"");
				if (sArregloChecks.length == 1)
					sArregloChecks = "";
			}
		document.forms[0].txtMoverUnidad.value = sArregloChecks;
		return unescape(sArregloChecks);
	};
/* -----------------------------------------------------------------------------------*/ 
function fAlCargar(pDeDonde, pCategorias)
	{
		pCategorias = " " + pCategorias;
		if (pCategorias.indexOf("1") > 0)
			document.getElementById("Estilo").style.display = "";
		if (pCategorias.indexOf("2") > 0)
			document.getElementById("Valores").style.display = "";
		if (pCategorias.indexOf("3") > 0)
			document.getElementById("Pensamiento").style.display = "";
		if (pCategorias.indexOf("4") > 0)
			document.getElementById("Emocional").style.display = "";
		if (pCategorias.indexOf("5") > 0)
			document.getElementById("Racional").style.display = "";
	};
/* -----------------------------------------------------------------------------------*/ 
function fEsParcial(pDeDonde, pCategorias)
	{
		pCategorias = " " + pCategorias;
		if (pCategorias.indexOf("1") > 0)
			document.frmEnviarMails.radio9.disabled = pDeDonde;
		if (pCategorias.indexOf("2") > 0)
			document.frmEnviarMails.radio10.disabled = pDeDonde;
		if (pCategorias.indexOf("3") > 0)
			document.frmEnviarMails.radio11.disabled = pDeDonde;
		if (pCategorias.indexOf("4") > 0)
			document.frmEnviarMails.radio12.disabled = pDeDonde;
		if (pCategorias.indexOf("5") > 0)
			document.frmEnviarMails.radio13.disabled = pDeDonde;
	};
/* -----------------------------------------------------------------------------------*/ 
function fCorreoValido(pCorreo)
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(trimString(pCorreo)))
			return (true)
		else 
			return (false)
	};
/* -----------------------------------------------------------------------------------*/ 
function validarEmail(valor) 
	{
		var correos = new Array();
		var lbDevuelve = true;
		correos = valor.split(",")
		for(var i=0; i < correos.length; i++)
			{
				lbDevuelve = lbDevuelve * fCorreoValido(correos[i]);
			};
		return(lbDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
function btnEnviar_onclick(pIdioma) 
	{
		var CorreoMal;
		var SinAsunto;
		var lbCorrecto;
		var lbDevuelve;
		lbDevuelve = true;
		if (pIdioma == 0) 
			{
				CorreoMal = "El correo electrónico no es válido.";
				SinAsunto = "El asunto no ha sido especificado.";
			}
		else
			{
				CorreoMal = "The e-mail address is not valid.";
				SinAsunto = "The subject has not been specified.";
			};
		lbCorrecto = validarEmail(document.frmEnviarMails.txtDestinatario.value);
		if (lbCorrecto == false)
			{
				alert(CorreoMal);
				document.frmEnviarMails.txtDestinatario.focus();
				lbDevuelve = false;
			}
		else
			{
				if (document.frmEnviarMails.txtCCP.value.length > 0)
					{
						lbCorrecto = validarEmail(document.frmEnviarMails.txtCCP.value);
						if (lbCorrecto == false)
							{
								alert(CorreoMal);
								document.frmEnviarMails.txtCCP.focus();
								lbDevuelve = false;
							}
						else
							{
								if (document.frmEnviarMails.ValAsunto.value.length == 0)
									{
										alert(SinAsunto);
										document.frmEnviarMails.ValAsunto.focus();
										lbDevuelve = false;
									}
								else
									lbDevuelve = true; // frmEnviarMails.submit();
							};
					}
				else
					{
						if (document.frmEnviarMails.ValAsunto.value.length == 0)
							{
								alert(SinAsunto);
								document.frmEnviarMails.ValAsunto.focus();
								lbDevuelve = false;
							};
					};
			};
		return (lbDevuelve);
	};
/* -----------------------------------------------------------------------------------*/ 
   function btnValidarAltaUnidad(pIdioma)
      {
      	var lbDevuelve;
         if (pIdioma == 0) 
            {
               MiMensaje = "Por favor proporcione la información requerida."
               CorreoMuyGrande = "La longitud máxima permitida para el correo son 60 caracteres.";
               lsCorreoInvalido = "Por favor verifique la dirección de correo electrónico proporcionada.";
            }
         else
            {
               MiMensaje = "Please type the required information.";
               CorreoMuyGrande = "The maximum allowed length  for the e-mail is 60 characters.";
               lsCorreoInvalido = "Please check the typed e-mail address.";
            }
            
         lbDevuelve = false;
         
         if (document.frmAgregarUnidad.userid.value.length == 0)
            {
               alert(MiMensaje);
               document.all.item("userid").focus();
            }
         else
            {
               if (document.frmAgregarUnidad.password.value.length == 0)
                  {
                     alert(MiMensaje);
                     document.all.item("password").focus();
                  }
               else
                  {
                     if (document.frmAgregarUnidad.description.value.length == 0)
                        {
                           alert(MiMensaje);
                           document.all.item("description").focus();
                        }
                     else
                        {
                           if (document.frmAgregarUnidad.email.value.length == 0)
                              {
                                 document.frmAgregarUnidad.submit();
						         lbDevuelve = true;
                              }
                           else
                              {
                                 if (validarEmail(document.frmAgregarUnidad.email.value)==true)
                                 	{
	                                    document.frmAgregarUnidad.submit()
								         lbDevuelve = true;
								    }
                                 else
                                    {
                                       alert(lsCorreoInvalido);
                                       document.all.item("email").focus();
                                    }
                              }
                        }
                  }
            }
            
      return (lbDevuelve);

      } // fin de btnValidar
/* -----------------------------------------------------------------------------------*/ 
   function btnValidarModificaUnidad(pIdioma)
      {
      	 var lbDevuelve;
      	 lbDevuelve = false;
         if (pIdioma == 0) 
            {
               MiMensaje = "Por favor proporcione la información requerida."
               CorreoMuyGrande = "La longitud máxima permitida para el correo electrónico es de 60 caracteres.";
               lsCorreoInvalido = "Por favor verifique el correo electrónico proporcionado.";
            }
         else
            {
               MiMensaje = "Please type the required information.";
               CorreoMuyGrande = "The maximum allowed length for the e-mail address is 60 characters.";
               lsCorreoInvalido = "Please verify the entered e-mail address.";
            }
         if (document.frmEditarUnidad.userid.value.length == 0)
            {
               alert(MiMensaje);
               document.all.item("userid").focus();
            }
         else
            {
               if (document.frmEditarUnidad.password.value.length == 0)
                  {
                     alert(MiMensaje);
                     document.all.item("password").focus();
                  }
               else
                  {
                     if (document.frmEditarUnidad.description.value.length == 0)
                        {
                           alert(MiMensaje);
                           document.all.item("description").focus();
                        }
                     else
                        {
                           if (document.frmEditarUnidad.email.value.length == 0)
                              {
                                 document.frmEditarUnidad.submit();
						      	 lbDevuelve = true;
                              }
                           else
                              {
                                 if (validarEmail(document.frmEditarUnidad.email.value)==true)
                                 	{
										document.frmEditarUnidad.submit();
								      	lbDevuelve = true;
								     }
                                 else
                                    {
                                       alert(lsCorreoInvalido);
                                       document.all.item("email").focus();
                                    }
                              }
                        }
                  }
            }
         return (lbDevuelve);
      } // fin de btnValidar
/* -----------------------------------------------------------------------------------*/ 
function ValidaEnvioChgInfoPer(pIdioma) 
	{
		var lsNombre;
		var lsApellido;
		var lsCorreo;
		var lsAdministrador;
		var lsPuesto;
		var lsopcElPuesto;
		var lsNacionalidad;
		var lsTipoPuesto;
		var lsTextoOCD;
		var lsEvaluaPuesto;
		var lsIdioma;
		var lsGenero;
		var lsNotifica;
		var lsCorreoNotifica;
		var lsAvisaTermino;
		var lsMensaje;
		
		var aInicial  = new Array();
		var aNombre   = new Array();
		var aApellido = new Array();
		var aNotifica = new Array();
		var lbOk;
		
		lbOk = false;
		
		aInicial  = "Por favor proporcione la información requerida|Please type the required information|Please type the required information".split('|');
		aNombre   = "Nombre|Firts name|First name".split('|');
		aApellido = "Apellidos|Last name|Last name".split('|');
		aNotifica = "Verifique el correo para notificación|Verify the e-mail for notification|Verify the e-mail for notification".split('|');
		
		lsNombre         = trimString(document.EfectuarCambio.Nombre.value);
		lsApellido       = trimString(document.EfectuarCambio.Apellidos.value);
		lsCorreo         = trimString(document.EfectuarCambio.correo.value);
		lsAdministrador  = trimString(document.EfectuarCambio.Administrador.value);
		lsPuesto         = trimString(document.EfectuarCambio.Puesto.value);
		lsopcElPuesto    = trimString(document.EfectuarCambio.opcElPuesto.value);
		lsNacionalidad   = trimString(document.EfectuarCambio.Nacionalidad.value);
		lsTipoPuesto     = trimString(document.EfectuarCambio.TipoPuesto.value);
		lsTextoOCD       = trimString(document.EfectuarCambio.TextoOCD.value);
		lsEvaluaPuesto   = fCualSelecciono(document.EfectuarCambio.EvaluaPuesto);
		lsIdioma         = fCualSelecciono(document.EfectuarCambio.Idioma);
		lsGenero         = fCualSelecciono(document.EfectuarCambio.Genero);
		lsNotifica       = fCualSelecciono(document.EfectuarCambio.Notifica);
		lsCorreoNotifica = trimString(document.EfectuarCambio.CorreoNotifica.value);
		lsAvisaTermino   = fCualSelecciono(document.EfectuarCambio.AvisaTermino);
/*
		alert("Valida Cambio de información personal" + 
		      "\n" + lsNombre                         + 
		      "\n" + lsApellido                       + 
		      "\n" + lsCorreo                         + 
		      "\n" + lsAdministrador                  + 
		      "\n" + lsPuesto                         +
		      "\n" + lsopcElPuesto                    +
		      "\n" + lsNacionalidad                   +
		      "\n" + lsTipoPuesto                     +
		      "\n" + lsTextoOCD                       +
		      "\n" + lsEvaluaPuesto                   +
		      "\n" + lsIdioma                         +
		      "\n" + lsGenero                         +
		      "\n" + lsNotifica                       +
		      "\n" + lsCorreoNotifica                 +
		      "\n" + lsAvisaTermino
		      );
*/
		lsMensaje = "";
		if (lsNombre.length == 0)
			{
				lsMensaje = lsMensaje + aNombre[pIdioma] + '\n'; 
			};
			
		if (lsApellido.length == 0)
			{
				lsMensaje = lsMensaje + aApellido[pIdioma] + '\n'; 
			};
		if (lsNotifica == 1)
			{
				if (validarEmail(lsCorreoNotifica) == false)
					{
						lsMensaje = lsMensaje + aNotifica[pIdioma] + '\n'; 
					};
			};
		if (trimString(lsMensaje).length > 0)
			{
				alert(aInicial[pIdioma] + "\n" + lsMensaje);
			}
		else
			{
				lbOk = true;
			}
		
		return(lbOk);
	};
/* -----------------------------------------------------------------------------------*/ 
	function ValidarEvaluador(pIdioma, pAccion)
		{
			var lbDevuelve = false;
			var Campo0;
			var Campo1;
			var Campo2;
			var Campo3;
			var Campo4;
			var Campo5;
			var Campo6;
			if (ConAll == true)
				{
					Campo0 = document.all("Valor").value;
					Campo1 = trimString(document.all("FirstName").value);
					Campo2 = trimString(document.all("LastName").value);
					Campo3 = trimString(document.all("Correo").value);
					Campo4 = document.all("TieneEI").checked;
					Campo5 = document.all("TienePDP").checked;
					Campo6 = document.all("TieneLeader").checked;
				}
			else
				{
					Campo0 = document.getElementById("Valor").value;
					Campo1 = trimString(document.getElementById("FirstName").value);
					Campo2 = trimString(document.getElementById("LastName").value);
					Campo3 = trimString(document.getElementById("Correo").value);
					Campo4 = document.getElementById("TieneEI").checked;
					Campo5 = document.getElementById("TienePDP").checked;
					Campo6 = document.getElementById("TieneLeader").checked;
				};
			var ConEvaluacion;
			ConEvaluacion = "";
			if (Campo4 == true)
				{ 
					ConEvaluacion = ConEvaluacion + '1';
				};
			if (Campo5 == true)
				{ 
					ConEvaluacion = ConEvaluacion + '2';
				};
			if (Campo6 == true)
				{ 
					ConEvaluacion = ConEvaluacion + '3';
				};
			if (pIdioma == 0) 
				{
					var lvMensajes = "Es requerido el nombre.|Son requeridos los apellidos.|Es requerido el correo electrónico.|El correo no es valido|Es requerido al menos un tipo de evaluación.".split("|");
					var lsSeleccione = "Por favor seleccione al evaluador que desea modificar.|Por favor seleccione al evaluador que desea borrar.".split("|");
				}
			else
				{
					var lvMensajes = "Please type the name.|Please type the last name.|Please type the e-mail.|Invalid E-Mail address |Please choose the evaluation type.".split("|");
					var lsSeleccione = "Please pick the rater that you want to modify.|Please pick the rater that you want to delete.".split("|");
				};
		/* 
			pAccion :
					1: Alta
					2: Cambio
					3: Baja
		*/
		if (pAccion ==1)
			{
				if (Campo1.length == 0)
					{
						alert(lvMensajes[0]);
					}
				else
					{
						if (Campo2.length == 0)
							{
								alert(lvMensajes[1]);
							}
						else
							{
								if (Campo3.length == 0)
									{
										alert(lvMensajes[2]);
									}
								else
									{
										if (fCorreoValido(Campo3) == false)
											{
												alert(lvMensajes[3]);
											}
										else
											{
												if (ConEvaluacion.length == 0) //Campo4 == false && Campo5 == false)
													{
														alert(lvMensajes[4]);
													}
												else
													{
														lbDevuelve = true;
													};
											};
									};
							};
					};
			};
		if (pAccion == 2)
			{
				if (Campo0.length == 0)
					{
						alert(lsSeleccione[0]);
					}
				else
					{
						if (Campo1.length == 0)
							{
								alert(lvMensajes[0]);
							}
						else
							{
								if (Campo2.length == 0)
									{
										alert(lvMensajes[1]);
									}
								else
									{
										if (Campo3.length == 0)
											{
												alert(lvMensajes[2]);
											}
										else
											{
												if (fCorreoValido(Campo3) == false)
													{
														alert(lvMensajes[3]);
													}
												else
													{
														if (ConEvaluacion.length == 0) //Campo4 == false && Campo5 == false)
															{
																alert(lvMensajes[4]);
															}
														else
															{
																lbDevuelve = true;
															};
													};
											};
									};
							};
					};
			};
		if (pAccion == 3)
			{	
				if (Campo1.length == 0)
					{
						alert(lsSeleccione[1]);
					}
				else
					{					
						lbDevuelve = true;
					};
			};
		 return (lbDevuelve);
      };
/* -----------------------------------------------------------------------------------*/ 
function SiguientePaginaMueve(pAQuien)
      {
		var sRuta = '';
		sRuta = pAQuien + '@' + dameCheck() + '[]' + document.administrar.selectunit.value;
		window.location.href = sRuta;
      };


function fAbreBusquedaGeneral(pIdioma)
	{
		var lsFiltro;
		var lnUnidadActual;

		lsFiltro       = trimString(document.forms[0].ValorFiltro.value);
		lnUnidadActual = trimString(document.forms[0].AdministrarUnidad.value);

		document.forms[0].ValorFiltro.value = ' ';

		if (pIdioma == 0)
			{
				lsSinCriterio = 'Por favor escriba por lo menos 3 caracteres para poder realizar la búsqueda';
			}
		else
			{
				lsSinCriterio = 'Please type at least 3 characters in order to launch the search';
			};

		if (lsFiltro.length == 0)
			{
				alert(lsSinCriterio);
			}
		else
			{
				window.open('./manager.ASP?WCI=BusquedaGeneralNva&FiltroBG=' + trimString(lsFiltro) + '&pUnidadActual=' + trimString(lnUnidadActual), '', 'scrollbars=1, Width=700px, Height=400px, Status=0, location=0');
			};
		return (false);
	};
function fMoverRegistros(pIdioma)
	{
		var lsMover;
		var lbOk;
		var aMover = new Array();		
		var lsActual;
		var lsDestino;
		var c;
		var lnEnLaMisma;
		
		if (pIdioma == 0)
			{
				lsMover     = 'Por favor seleccione los perfiles a mover.';
				lsSinCambio = 'Algunos perfiles ya estan localizados en la unidad destino';
			}
		else
			{
				lsMover     = 'Please choose profiles to move.';
				lsSinCambio = 'Some profiles already exist in the target unit';
			};

		lbOk = false;
		lsDestino = document.forms[0].cmbUnidadDestino.value;
		if (trimString(document.forms[0].txtMoverUnidad.value).length == 0)
			{
				alert(lsMover);
			}
		else
			{
				aMover = trimString(document.forms[0].txtMoverUnidad.value).substring(0,trimString(document.forms[0].txtMoverUnidad.value).length - 1).split("|");
				lnEnLaMisma = 0;
				for (c=0; c < aMover.length; c++)
					{
						if (lsDestino == document.all(aMover[c]).value)
							{
								lnEnLaMisma++;
							};
					};
				if (lnEnLaMisma > 0 )
					{
						alert(lsSinCambio);
					};
				lbOk = true;
			};
		return(lbOk);
	};