var bGoogleAnalytics = false;

var cSvrPath = "";

var cCountTimeOut = 1000;

var oDiv;
var iNav = navigator.appName;
var cValorAlpha = 100;
var cConteo = 5;

var cAJAXNoValido = "Su navegador no soporta AJAX.";

var xmlHttpSQLMunicipios;
var xmlHttpSQLClavesLada;
var xmlHttpSQLClavesLadaRes;
var xmlHttpSQLNoSocio;
var xmlHttpCalendario;
var xmlHttpCalendarioResultados;
var xmlHttpEncuesta;

var xmlHttpDifusionContenido;

if ( iNav == "Netscape" )
{
	var iContNav = 0;
	var cUserAgent = navigator.userAgent;
	
	iNav = "NS";
	
	while ( iContNav < cUserAgent.length )
	{
		if ( cUserAgent.substring(iContNav, iContNav + 7) == "Firefox" )
			iNav = "FX";
		
		iContNav ++;
	}
}
else
	if ( iNav == "Microsoft Internet Explorer" )
		iNav = "IE";

function GetXmlHttpObject()
{
	var xmlHttp = null;
		
	try
	{
		//Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	return xmlHttp;
}

function f_filterResults(n_win, n_docel, n_body)
{
	var n_result = n_win ? n_win : 0;
		
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
		
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function f_clientWidth()
{
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}

function f_clientHeight()
{
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_scrollLeft()
{
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

function f_scrollTop()
{
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function f_scrollWidth()
{
	return f_filterResults (
		window.pageXOffsetOOO ? window.pageXOffsetOOO : 0,
		document.documentElement ? document.documentElement.scrollWidth : 0,
		document.body ? document.body.scrollWidth : 0
	);
}

function f_scrollHeight()
{
	return f_filterResults (
		window.pageYOffsetOOO ? window.pageYOffsetOOO : 0,
		document.documentElement ? document.documentElement.scrollHeight : 0,
		document.body ? document.body.scrollHeight : 0
	);
}

function fncQuitaPixel(cNumber)
{
	var cX = 0;
	var cReturn = "";
	
	while (cX < cNumber.length)
	{
		if ( cNumber.substring(cX, cX + 1) != "p" && cNumber.substring(cX, cX + 1) != "x" )
			cReturn = cReturn + cNumber.substring(cX, cX + 1);
	
		cX = cX + 1;
	}
	
	return cReturn;
}

function fncTrim( cTexto )
{
	var cConteo = 0, cNuevo = "", cVerifica;
	
	cVerifica = cTexto;
	
	var cLongitud = cVerifica.length;
	
	bBandera = 0;
	
	while ( cConteo < cLongitud && cVerifica.substring ( cConteo, cConteo + 1 ) == " ")
		 cConteo++;
	
	while ( cLongitud > 0 && cVerifica.substring ( cLongitud, cLongitud - 1 ) == " ")
		 cLongitud--;
	
	while ( cConteo < cLongitud )
	{
		if ( cVerifica.substring ( cConteo, cConteo + 1 ) == " " )
		{
			if (bBandera == 0)
			{
				cNuevo += cVerifica.substring ( cConteo, cConteo + 1 );
				bBandera = 1;
			}
		}
		else
		{
			cNuevo += cVerifica.substring ( cConteo, cConteo + 1 );
			bBandera = 0;
		}
		
		cConteo++;
	}
	return cNuevo;
}

function fncEsEmail( cEMail )
{
	var cLongitud, cNum;
	
	cLongitud = cEMail.length;
	
	var bArroba = false;
	var bPunto = false;
	var bEspacio = false;
	
	for ( var cConteo = 0; cConteo < cLongitud; cConteo++ )
	{
		cNum = cEMail.substring ( cConteo, cConteo + 1 );
		
		if ( ( cNum == "@" ) && ( bArroba == false ) )
			bArroba = true;
		else if ( ( cNum == "@" ) && ( bArroba == true ) )
			bArroba = false;
		else if ( cNum == "." )
			bPunto = true;
		else if ( cNum == " " )
			bEspacio = true;
	}
	
	if ( bArroba && bPunto && ( cLongitud >= 6 ) && ( ! ( bEspacio ) ) )
		return true;
	else
		return false;
}

function fncValidaPassword( cPwd1, cPwd2 )
{
	if (cPwd1 != cPwd2)
		return false;
	else
		return true;
}

function fncLenString(cCadenaWebSite, cLen, cRellena)
{
	var cCadena = cCadenaWebSite + "";
	var cX = cCadena.length;
	
	while ( cX < cLen)
	{
		cCadena = cRellena + cCadena;
		cX = cCadena.length;
	}
	
	return cCadena;
}

function createCookie(name, value, days)
{
	if ( days )
	{
		var date = new Date();
		date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
		var expires = "; expires=" + date.toGMTString();
	}
	else
		var expires = "";
	
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for( var i = 0; i < ca.length; i++ )
	{
		var c = ca[i];
		while ( c.charAt(0) == ' ' )
			c = c.substring( 1, c.length );
		
		if (c.indexOf(nameEQ) == 0)
			return c.substring( nameEQ.length, c.length );
	}
	return null;
}

function eraseCookie(name)
{
	createCookie( name, "", -1 );
}

function fncIgnoraCaracteres( string )
{
	var temp = "";
	var tempp = "";
	var i;
	var string = "" + string;
	
	var splitstring = string.split('"');
	
	for( i = 0; i < splitstring.length; i++ )
		temp += splitstring[i];
	
	var splitstringc = temp.split("'");
	
	for( i = 0; i < splitstringc.length; i++ )
		tempp += splitstringc[i];
	
	return tempp;
}

function fncValidaFecha( oDia, oMes, oAnio )
{
	var cMaxDays;
	var bResult = true;
	
	var iDia = oDia.value * 1;
	var iMes = oMes.value * 1;
	var iAnio = oAnio.value * 1;
	
	if ( iMes == 2 )
	{
		if ( iAnio % 4 == 0 )
			cMaxDays = 29;
		else
			cMaxDays = 28;
		
		if ( iDia > cMaxDays )
			bResult = false;
	}
	
	if ( ( iMes == 4 || iMes == 6 || iMes == 9 || iMes == 11 ) && ( iDia > 30 ) )
		bResult = false;
	
	return bResult;
}

function IsNumeric( sText )
{
	var ValidChars = "0123456789.";
	var IsNumber = true;
	var Char;
	
	for (i = 0; i < sText.length && IsNumber == true; i++)
	{
		Char = sText.charAt(i);
		
		if (ValidChars.indexOf(Char) == -1)
		{
			IsNumber = false;
		}
	}
	
	return IsNumber;
}

function fncFormatCommas( cValor )
{
	cValor += '';
	
	var splitStr = cValor.split('.');
	var splitLeft = splitStr[0];
	var splitRight = splitStr.length > 1 ? '.' + splitStr[1] : '';
	var regx = /(\d+)(\d{3})/;
	
	while (regx.test(splitLeft))
	{
		splitLeft = splitLeft.replace(regx, '$1' + ',' + '$2');
	}
	
	return splitLeft + splitRight;
}

function fncFormatNumber(cValor, cNoDecimales)
{
	cPunto = Math.pow(10, cNoDecimales);
	cNumero = parseInt(cValor * cPunto) / cPunto;
	aPartesNumero = cNumero.toString().split('.');
	
	cNEntero = aPartesNumero[0];
	cNDecimal = aPartesNumero[1];
	
	if ( cNDecimal != undefined )
		cFin = cNoDecimales - cNDecimal.length;
	else
	{
		cNDecimal = '';
		cFin = cNoDecimales;
	}
	
	for( i = 0; i < cFin; i++ )
		cNDecimal += String.fromCharCode(48);
	
	if ( cNoDecimales == 0 )
		cNumero = fncFormatCommas(cNEntero);
	else
		cNumero = fncFormatCommas(cNEntero) + '.' + cNDecimal;
	
	return cNumero;
}

function fncMenuOver(cMenuOpcion)
{
	fncApagaTodo(cMenuOpcion);
	fncMenuOverTable(cMenuOpcion);
	
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenuOn";
}

function fncMenuOutFinal(cMenuOpcion)
{
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenu";
}

function fncSubMenuOver(cMenuOpcion)
{
	fncApagaTodoSub(cMenuOpcion);
	fncSubMenuOverTable(cMenuOpcion);
	
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenuOn";
}

function fncSubMenuOutFinal(cMenuOpcion)
{
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenu";
}

function fncSubMenuInternoOver(cMenuOpcion)
{
	fncApagaTodoSubInterno(cMenuOpcion);
	fncSubMenuInternoOverTable(cMenuOpcion);
	
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenuOn";
}

function fncSubMenuInternoOutFinal(cMenuOpcion)
{
	if ( document.getElementById("divMenu" + cMenuOpcion) )
		document.getElementById("divMenu" + cMenuOpcion).className = "CDivMenu";
}

function fncCargaPagina(cLiga)
{
	var aPagina = cLiga.split("?");
	
	if ( aPagina.length > 1 )
	{
		var aParametros = aPagina[1].split("&");
		var cX = 0;
		
		while ( cX < aParametros.length )
		{
			var aValues = aParametros[cX].split("=");
			
			switch ( aValues[0].toLowerCase() )
			{
				case "is":
					document.frmMenusIS.action = aPagina[0];
					document.frmMenusIS.IS.value = aValues[1];
					document.frmMenusIS.submit();
					break;
				case "it":
					document.frmMenusIT.action = aPagina[0];
					document.frmMenusIT.IT.value = aValues[1];
					document.frmMenusIT.submit();
					break;
				case "cid":
					document.frmMenusID.action = aPagina[0];
					document.frmMenusID.cId.value = aValues[1];
					document.frmMenusID.submit();
					break;
			}
			
			cX++;
		}
	}
	else
	{
		document.frmMenus.action = aPagina[0];
		document.frmMenus.submit();
	}
}

function fncBusqueda()
{
	if ( fncTrim(document.frmBusqueda.IB.value) != "" )
	{
		document.frmBusqueda.action = "busqueda.asp";
		document.frmBusqueda.submit();
	}
}

function fncClickTipoEnvio(cTipoEnvio)
{
	document.frmCuestionarioAfiliacion.cTipoEnvio.value = cTipoEnvio;
}

function fncSetFocus( bUp )
{
	if ( bUp == true )
	{
		if ( document.getElementById("cUpFocus") )
		{
			document.getElementById("cUpFocus").className = "CInputFocusOn";
			document.getElementById("cUpFocus").focus();
			document.getElementById("cUpFocus").className = "CInputFocusOff";
		}
	}
	else
	{
		if ( document.getElementById("cDownFocus") )
		{
			document.getElementById("cDownFocus").className = "CInputFocusOn";
			document.getElementById("cDownFocus").focus();
			document.getElementById("cDownFocus").className = "CInputFocusOff";
		}
	}
}

function fncIrACampoError( cCampoOpcion, oCampoNombre )
{
	var oFieldObj = "document.frmCuestionarioAfiliacion." + oCampoNombre;
	oFieldObj = eval(oFieldObj);
	
	fncSetFocus( false );
	
	if ( document.getElementById("td" + cCampoOpcion) )
		document.getElementById("td" + cCampoOpcion).focus();
	
	oFieldObj.focus();
}
function fncDatosInvalidos( cCampoOpcion, oCampoNombre )
{
	switch ( cCampoOpcion )
	{
		case "Usuario":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Usuario\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Password":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Contraseña\" es requerido y el valor actual no es válido.<br>Deberá ser mínimo de 5 dígitos y máximo de 20.<br>Los campos Contraseña y Confirma Contraseña deberán ser iguales.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ConfirmaPassword":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Confirma Contraseña\" es requerido y el valor actual no es válido.<br>Deberá ser mínimo de 5 dígitos y máximo de 20.<br>Los campos Contraseña y Confirma Contraseña deberán ser iguales.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "TipoSucursal":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Empresa\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "RFC":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"RFC\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "TipoEmpresa":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Tipo de Persona\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Nombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre (s)\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ApellidoP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Paterno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ApellidoM":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Materno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "NombreComercialF":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre Comercial\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "RazonSocial":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre de la Empresa\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "NombreComercialM":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre Comercial\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "TipoUbicacion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Ubicación\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Calle":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Domicilio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "NoExterior":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Número Exterior\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Colindantes":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Calles Colindantes\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Posterior":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Calle posterior\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Colonia":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Colonia o Localidad\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "TipoAGEB":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"AGEB (Área Geoestadística Básica)\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Estado":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Entidad Federativa\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Municipio":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Delegación o Municipio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "CP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Codigo Postal\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "WebPage":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Página de Internet\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "DirectorGeneral":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Director General\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "EMailDirectorGeneral":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico del Director General\" es requerido y el valor actual no es válido.<br><br>En caso de que la persona ocupe los tres puestos:<br>&nbsp;&nbsp;&nbsp;Representante Legal<br>&nbsp;&nbsp;&nbsp;Director General<br>&nbsp;&nbsp;&nbsp;Contador / Administrador<br>Se puede repetir el nombre y el correo electrónico.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Representante":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Representante Legal\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "EMailRepresentante":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico del Representante Legal\" es requerido y el valor actual no es válido.<br><br>En caso de que la persona ocupe los tres puestos:<br>&nbsp;&nbsp;&nbsp;Representante Legal<br>&nbsp;&nbsp;&nbsp;Director General<br>&nbsp;&nbsp;&nbsp;Contador / Administrador<br>Se puede repetir el nombre y el correo electrónico.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Contador":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Contador / Administrador\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "EMailContador":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico del Contador / Administrador\" es requerido y el valor actual no es válido.<br><br>En caso de que la persona ocupe los tres puestos:<br>&nbsp;&nbsp;&nbsp;Representante Legal<br>&nbsp;&nbsp;&nbsp;Director General<br>&nbsp;&nbsp;&nbsp;Contador / Administrador<br>Se puede repetir el nombre y el correo electrónico.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "TelLinea":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfonos\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Fax":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Fax\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "IdActividad":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Giro ó actividad principal del establecimiento\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ActividadOtro":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Giro ó actividad principal del establecimiento\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "FechaOperaciones":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Fecha de inicio de operaciones del establecimiento\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Empleados":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Número de personas que laboran en el establecimiento\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "IngresosNetos":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Defina su cuota de afiliación / ingresos netos\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "VentasNetas":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Rango de ventas netas\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "IdTipoOperacion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Ámbito de Operación\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ServiciosOfrecidos":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Principales productos o servicios que ofrece\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "ServiciosDemanda":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Principales insumos que demanda\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "AreaAtencion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Área de atención\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "InformacionAdicional":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Tipo de Publicación\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFNombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre (s)\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFApellidoP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Paterno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFApellidoM":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Materno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFTelefono01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFEMail":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMEmpresa":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre de la empresa o institución\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMTelefono":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMEMail":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMNombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre (s)\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMApellidoP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Paterno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMApellidoM":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Apellido Materno\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMTelefonoRes":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMEMailRes":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "FeriaInteres":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Feria de su interés\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFRFC":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"RFC\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMRFC":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"RFC\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFDomicilio":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Domicilio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFNoExterior":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Número Exterior\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFColonia":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Colonia o Localidad\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFEstado":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Entidad Federativa\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFMunicipio":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Delegación o Municipio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFCP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Codigo Postal\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMDomicilio":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Domicilio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMNoExterior":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Número Exterior\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMColonia":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Colonia o Localidad\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMEstado":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Entidad Federativa\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMMunicipio":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Delegación o Municipio\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMCP":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Codigo Postal\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PFTelLinea01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfonos\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMTelLinea01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfonos\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMResClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMResClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PMResTelLinea01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfonos\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "SiAfiliado":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Es usted afiliado\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "SiAfiliadoNumero":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Número de afiliado\" es requerido y el valor actual no es válido.<br>En caso de no recordarlo deberá llenar el campo RFC y dar clic en el botón \"Buscar\".<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "EMail":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Correo Electrónico\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Edad":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Edad\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Sexo":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Sexo\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "EstadoCivil":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Estado Civil\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "GradoEstudios":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Grado máximo de estudios\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PuestoActual":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Ocupación ó puesto actual\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Empresa":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre de empresa en la que labora actualmente\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Responsabilidades":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Responsabilidades actuales\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PorQueAsistir":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"¿Por qué desea asistir a este seminario?\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "PlanDesarrollo":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Plan de desarrollo laboral a dos años\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01Nombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01Prefesion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Profesión\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01Tiempo":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Años de conocerlo\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01ClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01ClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref01Telefono01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02Nombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02Prefesion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Profesión\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02Tiempo":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Años de conocerlo\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02ClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02ClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref02Telefono01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03Nombre":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nombre\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03Prefesion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Profesión\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03Tiempo":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Años de conocerlo\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03ClaveLargaDI":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Internacional\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03ClaveLargaD":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Clave Larga Distancia\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Ref03Telefono01":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Teléfono\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "Curriculum":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Curriculum\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "CartaRecomendacion":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Cartas de recomendación\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "CursoRequerido":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Curso Requerido\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "NivelEspecificar":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Nivel - Especificar\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "NoPersonas":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Curso impartido para\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		case "CargoContacto":
			document.getElementById("tdMensajeError").innerHTML = "El campo \"Cargo\" es requerido y el valor actual no es válido.<br><br><a href=\"javascript:fncIrACampoError('" + cCampoOpcion + "', '" + oCampoNombre + "');\" class=\"CTdMensajeErrorRojo\">ir al campo</a>";
			break;
		default:
			document.getElementById("tdMensajeError").innerHTML = "El campo \"" + cCampoOpcion + "\" no es válido.";
			break;
	}
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOn";
	fncSetFocus( true );
}

function fncPintaDatosInvalidos( oCampoNombre, bCorrecto )
{
	if ( bCorrecto == true )
	{
		oCampoNombre.style.backgroundColor = "";
		oCampoNombre.style.color = "";
	}
	else
	{
		oCampoNombre.style.backgroundColor = "#CC0000";
		oCampoNombre.style.color = "#FFFFFF";
	}
}

function fncValidaAfiliacion()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cTipoSucursal.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoSucursal";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoSucursal";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoSucursal, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "RFC";
		if ( oCampoNombre == "" ) oCampoNombre = "cRFC";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRFC, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cRFC.value );
	
	if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoEmpresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoEmpresa, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "Nombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialF.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "NombreComercialF";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombreComercialF";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombreComercialF, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombreComercialF.value = fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialF.value );
		}
		else if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "2" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cRazonSocial.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "RazonSocial";
				if ( oCampoNombre == "" ) oCampoNombre = "cRazonSocial";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRazonSocial, false );
			}
			else
				document.frmCuestionarioAfiliacion.cRazonSocial.value = fncTrim( document.frmCuestionarioAfiliacion.cRazonSocial.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "NombreComercialM";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombreComercialM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombreComercialM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombreComercialM.value = fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialM.value );
		}
	}
	
	if ( document.frmCuestionarioAfiliacion.cTipoUbicacion.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoUbicacion";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoUbicacion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoUbicacion, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCalle.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Calle";
		if ( oCampoNombre == "" ) oCampoNombre = "cCalle";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCalle, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim( document.frmCuestionarioAfiliacion.cCalle.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoExterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoExterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoExterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColindantes01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colindantes";
		if ( oCampoNombre == "" ) oCampoNombre = "cColindantes01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColindantes01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColindantes01.value = fncTrim( document.frmCuestionarioAfiliacion.cColindantes01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColindantes02.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colindantes";
		if ( oCampoNombre == "" ) oCampoNombre = "cColindantes02";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColindantes02, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColindantes02.value = fncTrim( document.frmCuestionarioAfiliacion.cColindantes02.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cPosterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Posterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cPosterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPosterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cPosterior.value = fncTrim( document.frmCuestionarioAfiliacion.cPosterior.value );
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Estado";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstado, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Municipio";
		if ( oCampoNombre == "" ) oCampoNombre = "cMunicipio";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cMunicipio, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColonia.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colonia";
		if ( oCampoNombre == "" ) oCampoNombre = "cColonia";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColonia, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cColonia.value );
	
	if ( document.frmCuestionarioAfiliacion.cTipoAGEB.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoAGEB";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoAGEB";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoAGEB, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CP";
		if ( oCampoNombre == "" ) oCampoNombre = "cCP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim( document.frmCuestionarioAfiliacion.cCP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cDirectorGeneral.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "DirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cDirectorGeneral, false );
	}
	else
		document.frmCuestionarioAfiliacion.cDirectorGeneral.value = fncTrim( document.frmCuestionarioAfiliacion.cDirectorGeneral.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailDirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailDirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRepresentante.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Representante";
		if ( oCampoNombre == "" ) oCampoNombre = "cRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRepresentante, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRepresentante.value = fncTrim( document.frmCuestionarioAfiliacion.cRepresentante.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailRepresentante.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailRepresentante";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailRepresentante, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailRepresentante.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailRepresentante";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailRepresentante, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailRepresentante.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailRepresentante.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cContador.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Contador";
		if ( oCampoNombre == "" ) oCampoNombre = "cContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cContador, false );
	}
	else
		document.frmCuestionarioAfiliacion.cContador.value = fncTrim( document.frmCuestionarioAfiliacion.cContador.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailContador.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailContador";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailContador, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailContador.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailContador";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailContador, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailContador.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailContador.value );
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaDI.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaDI, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TelLinea";
		if ( oCampoNombre == "" ) oCampoNombre = "cTelLinea01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTelLinea01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value );
	
	if ( document.frmCuestionarioAfiliacion.cIdActividad.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "IdActividad";
		if ( oCampoNombre == "" ) oCampoNombre = "cIdActividad";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cIdActividad, false );
	}
	else if ( document.frmCuestionarioAfiliacion.cIdActividad.value == "0" )
	{
		if ( fncTrim( document.frmCuestionarioAfiliacion.cActividadOtro.value ) == "" )
		{
			if ( cCampoOpcion == "" ) cCampoOpcion = "ActividadOtro";
			if ( oCampoNombre == "" ) oCampoNombre = "cActividadOtro";
			
			fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cActividadOtro, false );
		}
		else
			document.frmCuestionarioAfiliacion.cActividadOtro.value = fncTrim( document.frmCuestionarioAfiliacion.cActividadOtro.value );
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaOperacionesD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "FechaOperaciones";
		if ( oCampoNombre == "" ) oCampoNombre = "cFechaOperacionesD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesD, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaOperacionesM.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "FechaOperaciones";
		if ( oCampoNombre == "" ) oCampoNombre = "cFechaOperacionesM";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesM, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaOperacionesA.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "FechaOperaciones";
		if ( oCampoNombre == "" ) oCampoNombre = "cFechaOperacionesA";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesA, false );
	}
	
	if ( fncValidaFecha( document.frmCuestionarioAfiliacion.cFechaOperacionesD,document.frmCuestionarioAfiliacion.cFechaOperacionesM, document.frmCuestionarioAfiliacion.cFechaOperacionesA ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "FechaOperaciones";
		if ( oCampoNombre == "" ) oCampoNombre = "cFechaOperacionesD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesD, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesM, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFechaOperacionesA, false );
	}
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosE.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosE.value = document.frmCuestionarioAfiliacion.cEmpleadosE.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosE.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosE.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosE.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosE.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosO.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosO.value = document.frmCuestionarioAfiliacion.cEmpleadosO.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosO.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosO";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosO.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosO";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosO.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosO.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosS.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosS.value = document.frmCuestionarioAfiliacion.cEmpleadosS.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosS.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosS";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosS.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosS";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosS.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosS.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosTotal.value = document.frmCuestionarioAfiliacion.cEmpleadosTotal.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( Number( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) <= 0 )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cIngresosNetos.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "IngresosNetos";
		if ( oCampoNombre == "" ) oCampoNombre = "cIngresosNetos";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cIngresosNetos, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cIdTipoOperacion.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "IdTipoOperacion";
		if ( oCampoNombre == "" ) oCampoNombre = "cIdTipoOperacion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cIdTipoOperacion, false );
	}
	
	var oServicios = "";
	var oCKNacional = "";
	var oCKExtranjero = "";
	var cCountServicios = 1;
	var bServicios = false;
	
	while ( cCountServicios <= 5 )
	{
		oServicios = "document.frmCuestionarioAfiliacion.cServiciosOfrecidos" + cCountServicios;
		oCKNacional = "document.frmCuestionarioAfiliacion.ckServiciosOfrecidosNal" + cCountServicios;
		oCKExtranjero = "document.frmCuestionarioAfiliacion.ckServiciosOfrecidosExt" + cCountServicios;
		
		oServicios = eval(oServicios);
		oCKNacional = eval(oCKNacional);
		oCKExtranjero = eval(oCKExtranjero);
		
		if ( fncTrim( oServicios.value ) != "" && ( oCKNacional.checked == true || oCKExtranjero.checked == true ) )
			bServicios = true;
		
		cCountServicios = cCountServicios + 1;
	}
	
	if ( bServicios == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ServiciosOfrecidos";
		if ( oCampoNombre == "" ) oCampoNombre = "cServiciosOfrecidos1";
		
		fncPintaDatosInvalidos( document.getElementById("tdServiciosOfrecidos"), false );
		fncPintaDatosInvalidos( document.getElementById("tdServiciosOfrecidosNE"), false );
	}
	
	cCountServicios = 1;
	bServicios = false;
	
	while ( cCountServicios <= 5 )
	{
		oServicios = "document.frmCuestionarioAfiliacion.cServiciosDemanda" + cCountServicios;
		oCKNacional = "document.frmCuestionarioAfiliacion.ckServiciosDemandaNal" + cCountServicios;
		oCKExtranjero = "document.frmCuestionarioAfiliacion.ckServiciosDemandaExt" + cCountServicios;
		
		oServicios = eval(oServicios);
		oCKNacional = eval(oCKNacional);
		oCKExtranjero = eval(oCKExtranjero);
		
		if ( fncTrim( oServicios.value ) != "" && ( oCKNacional.checked == true || oCKExtranjero.checked == true ) )
			bServicios = true;
		
		cCountServicios = cCountServicios + 1;
	}
	
	if ( bServicios == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ServiciosDemanda";
		if ( oCampoNombre == "" ) oCampoNombre = "cServiciosDemanda1";
		
		fncPintaDatosInvalidos( document.getElementById("tdServiciosDemanda"), false );
		fncPintaDatosInvalidos( document.getElementById("tdServiciosDemandaNE"), false );
	}
	
	var oTipoAtencion = "";
	var bTipoAtencion = false;
	var cConteoTipoAtencion = 0;
	
	while ( cConteoTipoAtencion < document.frmCuestionarioAfiliacion.ckAreaAtencion.length )
	{
		oTipoAtencion = "document.frmCuestionarioAfiliacion.ckAreaAtencion[" + cConteoTipoAtencion + "]";
		oTipoAtencion = eval(oTipoAtencion);
		
		if ( oTipoAtencion.checked == true )
		{
			bTipoAtencion = true;
			cConteoTipoAtencion = document.frmCuestionarioAfiliacion.ckAreaAtencion.length;
		}
		
		cConteoTipoAtencion = cConteoTipoAtencion + 1
	}
	
	if ( bTipoAtencion == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "AreaAtencion";
		if ( oCampoNombre == "" ) oCampoNombre = "ckAreaAtencion(0)";
		
		fncPintaDatosInvalidos( document.getElementById("tdAreaAtencion"), false );
	}
	
	
	var oInformacionAdicional = "";
	var bInformacionAdicional = false;
	var cConteoInformacionAdicional = 0;
	
	while ( cConteoInformacionAdicional < document.frmCuestionarioAfiliacion.ckInformacionAdicional.length )
	{
		oInformacionAdicional = "document.frmCuestionarioAfiliacion.ckInformacionAdicional[" + cConteoInformacionAdicional + "]";
		oInformacionAdicional = eval(oInformacionAdicional);
		
		if ( oInformacionAdicional.checked == true )
		{
			bInformacionAdicional = true;
			cConteoInformacionAdicional = document.frmCuestionarioAfiliacion.ckInformacionAdicional.length;
		}
		
		cConteoInformacionAdicional = cConteoInformacionAdicional + 1
	}
	
	if ( bInformacionAdicional == false )
	{
		cConteoInformacionAdicional = 0;
		while ( cConteoInformacionAdicional < document.frmCuestionarioAfiliacion.ckInformacionAdicionalOtros.length )
		{
			oInformacionAdicional = "document.frmCuestionarioAfiliacion.ckInformacionAdicionalOtros[" + cConteoInformacionAdicional + "]";
			oInformacionAdicional = eval(oInformacionAdicional);
			
			if ( oInformacionAdicional.checked == true )
			{
				oInformacionAdicional = "document.frmCuestionarioAfiliacion.cInformacionAdicionalOtros" + oInformacionAdicional.value;
				oInformacionAdicional = eval(oInformacionAdicional);
				
				if ( oInformacionAdicional.value != "" )
				{
					bInformacionAdicional = true;
					cConteoInformacionAdicional = document.frmCuestionarioAfiliacion.ckInformacionAdicionalOtros.length;
				}
			}
			
			cConteoInformacionAdicional = cConteoInformacionAdicional + 1
		}
	}
	
	if ( bInformacionAdicional == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "InformacionAdicional";
		if ( oCampoNombre == "" ) oCampoNombre = "ckInformacionAdicional(0)";
		
		fncPintaDatosInvalidos( document.getElementById("tdInformacionAdicional"), false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		document.frmCuestionarioAfiliacion.action = "xRegistroAfiliados.asp";
		document.frmCuestionarioAfiliacion.submit();
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncValidaAfiliacionEdicion()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoEmpresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoEmpresa, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "Nombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialF.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "NombreComercialF";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombreComercialF";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombreComercialF, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombreComercialF.value = fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialF.value );
		}
		else if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "2" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cRazonSocial.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "RazonSocial";
				if ( oCampoNombre == "" ) oCampoNombre = "cRazonSocial";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRazonSocial, false );
			}
			else
				document.frmCuestionarioAfiliacion.cRazonSocial.value = fncTrim( document.frmCuestionarioAfiliacion.cRazonSocial.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "NombreComercialM";
				if ( oCampoNombre == "" ) oCampoNombre = "cNombreComercialM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombreComercialM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cNombreComercialM.value = fncTrim( document.frmCuestionarioAfiliacion.cNombreComercialM.value );
		}
	}
	
	if ( document.frmCuestionarioAfiliacion.cTipoUbicacion.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoUbicacion";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoUbicacion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoUbicacion, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCalle.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Calle";
		if ( oCampoNombre == "" ) oCampoNombre = "cCalle";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCalle, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim( document.frmCuestionarioAfiliacion.cCalle.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoExterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoExterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoExterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColindantes01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colindantes";
		if ( oCampoNombre == "" ) oCampoNombre = "cColindantes01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColindantes01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColindantes01.value = fncTrim( document.frmCuestionarioAfiliacion.cColindantes01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColindantes02.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colindantes";
		if ( oCampoNombre == "" ) oCampoNombre = "cColindantes02";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColindantes02, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColindantes02.value = fncTrim( document.frmCuestionarioAfiliacion.cColindantes02.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cPosterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Posterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cPosterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPosterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cPosterior.value = fncTrim( document.frmCuestionarioAfiliacion.cPosterior.value );
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Estado";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstado, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Municipio";
		if ( oCampoNombre == "" ) oCampoNombre = "cMunicipio";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cMunicipio, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColonia.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colonia";
		if ( oCampoNombre == "" ) oCampoNombre = "cColonia";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColonia, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cColonia.value );
	
	if ( document.frmCuestionarioAfiliacion.cTipoAGEB.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoAGEB";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoAGEB";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoAGEB, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CP";
		if ( oCampoNombre == "" ) oCampoNombre = "cCP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim( document.frmCuestionarioAfiliacion.cCP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cDirectorGeneral.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "DirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cDirectorGeneral, false );
	}
	else
		document.frmCuestionarioAfiliacion.cDirectorGeneral.value = fncTrim( document.frmCuestionarioAfiliacion.cDirectorGeneral.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailDirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailDirectorGeneral";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailDirectorGeneral";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRepresentante.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Representante";
		if ( oCampoNombre == "" ) oCampoNombre = "cRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRepresentante, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRepresentante.value = fncTrim( document.frmCuestionarioAfiliacion.cRepresentante.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailRepresentante.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailRepresentante";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailRepresentante, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailRepresentante.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailRepresentante";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailRepresentante";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailRepresentante, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailRepresentante.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailRepresentante.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cContador.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Contador";
		if ( oCampoNombre == "" ) oCampoNombre = "cContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cContador, false );
	}
	else
		document.frmCuestionarioAfiliacion.cContador.value = fncTrim( document.frmCuestionarioAfiliacion.cContador.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMailContador.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailContador";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailContador, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMailContador.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMailContador";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMailContador";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMailContador, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMailContador.value = fncTrim( document.frmCuestionarioAfiliacion.cEMailContador.value );
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaDI.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaDI, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TelLinea";
		if ( oCampoNombre == "" ) oCampoNombre = "cTelLinea01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTelLinea01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value );
	
	if ( document.frmCuestionarioAfiliacion.cIdActividad.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "IdActividad";
		if ( oCampoNombre == "" ) oCampoNombre = "cIdActividad";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cIdActividad, false );
	}
	else if ( document.frmCuestionarioAfiliacion.cIdActividad.value == "0" )
	{
		if ( fncTrim( document.frmCuestionarioAfiliacion.cActividadOtro.value ) == "" )
		{
			if ( cCampoOpcion == "" ) cCampoOpcion = "ActividadOtro";
			if ( oCampoNombre == "" ) oCampoNombre = "cActividadOtro";
			
			fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cActividadOtro, false );
		}
		else
			document.frmCuestionarioAfiliacion.cActividadOtro.value = fncTrim( document.frmCuestionarioAfiliacion.cActividadOtro.value );
	}
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosE.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosE.value = document.frmCuestionarioAfiliacion.cEmpleadosE.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosE.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosE.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosE.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosE.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosO.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosO.value = document.frmCuestionarioAfiliacion.cEmpleadosO.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosO.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosO";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosO.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosO";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosO.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosO.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosS.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosS.value = document.frmCuestionarioAfiliacion.cEmpleadosS.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosS.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosS";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosS.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosS";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpleadosS.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosS.value );
	
	while ( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value.indexOf(",") != -1 )
		document.frmCuestionarioAfiliacion.cEmpleadosTotal.value = document.frmCuestionarioAfiliacion.cEmpleadosTotal.value.replace(",", "");
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( IsNumeric( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	else if ( Number( document.frmCuestionarioAfiliacion.cEmpleadosTotal.value ) <= 0 )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empleados";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpleadosE";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosE, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosO, false );
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpleadosS, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cIdTipoOperacion.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "IdTipoOperacion";
		if ( oCampoNombre == "" ) oCampoNombre = "cIdTipoOperacion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cIdTipoOperacion, false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		document.frmCuestionarioAfiliacion.cTipoEmpresa.disabled = false;
		
		document.frmCuestionarioAfiliacion.action = "xRegistroAfiliadosEdicion.asp";
		document.frmCuestionarioAfiliacion.submit();
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncMuestraTipoPersona(cIdTipoPersona)
{
	if ( document.getElementById("divPersonaFisica") )
		document.getElementById("divPersonaFisica").className = "CDivTipoPersonaOff";
	
	if ( document.getElementById("divPersonaMoral") )
		document.getElementById("divPersonaMoral").className = "CDivTipoPersonaOff";
	
	if ( cIdTipoPersona.value == 1 )
	{
		if ( document.getElementById("divPersonaFisica") )
			document.getElementById("divPersonaFisica").className = "CDivTipoPersonaOn";
	}
	else if ( cIdTipoPersona.value == 2 )
	{
		if ( document.getElementById("divPersonaMoral") )
			document.getElementById("divPersonaMoral").className = "CDivTipoPersonaOn";
	}
}

function fncMuestraAfiliadoSiNo(cSiAfiliado)
{
	if ( document.getElementById("divSiAfiliado") )
		document.getElementById("divSiAfiliado").className = "CDivTipoPersonaOff";
	
	if ( cSiAfiliado.value == 1 )
	{
		if ( document.getElementById("divSiAfiliado") )
			document.getElementById("divSiAfiliado").className = "CDivTipoPersonaOn";
	}
}

function fncMuestraOtroGiro(cIdTipoPersona)
{
	if ( document.getElementById("divGiroOtro") )
	{
		if ( cIdTipoPersona.value == "" || cIdTipoPersona.value != 0 )
			document.getElementById("divGiroOtro").className = "CDivTipoPersonaOff";
		else
			document.getElementById("divGiroOtro").className = "CDivTipoPersonaOn";
	}
}

function fncCalculaTotalEmpleados()
{
	var cTotal = 0;
	var cEmpleadosE = document.frmCuestionarioAfiliacion.cEmpleadosE.value;
	var cEmpleadosO = document.frmCuestionarioAfiliacion.cEmpleadosO.value;
	var cEmpleadosS = document.frmCuestionarioAfiliacion.cEmpleadosS.value;
	
	while ( cEmpleadosE.indexOf(",") != -1 )
		cEmpleadosE = cEmpleadosE.replace(",", "");
	
	while ( cEmpleadosO.indexOf(",") != -1 )
		cEmpleadosO = cEmpleadosO.replace(",", "");
	
	while ( cEmpleadosS.indexOf(",") != -1 )
		cEmpleadosS = cEmpleadosS.replace(",", "");
	
	if ( IsNumeric(cEmpleadosE) == true )
		cTotal = cTotal + Number(cEmpleadosE);
	
	if ( IsNumeric(cEmpleadosO) == true )
		cTotal = cTotal + Number(cEmpleadosO);
	
	if ( IsNumeric(cEmpleadosS) == true )
		cTotal = cTotal + Number(cEmpleadosS);
	
	document.frmCuestionarioAfiliacion.cEmpleadosTotal.value = fncFormatNumber(cTotal, 0);
	
	fncCalculaCuotaSiem();
}

function fncCalculaCuotaAfiliacion()
{
	var cTxtIngresos = document.frmCuestionarioAfiliacion.cIngresosNetos.value;
	var cIngresos = 0;
	var cCuota = 0;
	
	while ( cTxtIngresos.indexOf(",") != -1 )
		cTxtIngresos = cTxtIngresos.replace(",", "");
	
	while ( cTxtIngresos.indexOf("$") != -1 )
		cTxtIngresos = cTxtIngresos.replace("$", "");
	
	if ( IsNumeric(cTxtIngresos) == true )
		cIngresos = Number(cTxtIngresos);
	
	cCuota = fncRangosCuotaAfiliacion( cIngresos );
	
	document.frmCuestionarioAfiliacion.cCuotaAfiliacion.value = fncFormatNumber(cCuota, 2);
	document.frmCuestionarioAfiliacion.cCuotaAfiliacionT.value = fncFormatNumber(cCuota, 2);
}

function fncCalculaCuotaSiem()
{
	var cTxtEmpleados = document.frmCuestionarioAfiliacion.cEmpleadosTotal.value;
	var cEmpleados = 0;
	var cCuota = 0;
	
	while ( cTxtEmpleados.indexOf(",") != -1 )
		cTxtEmpleados = cTxtEmpleados.replace(",", "");
	
	if ( IsNumeric(cTxtEmpleados) == true )
		cEmpleados = Number(cTxtEmpleados);
	
	cCuota = fncRangosCuotaSiem( cEmpleados );
	
	document.frmCuestionarioAfiliacion.cCuotaSiem.value = fncFormatNumber(cCuota, 2);
	document.frmCuestionarioAfiliacion.cCuotaSiemT.value = fncFormatNumber(cCuota, 2);
}

function fncInformacionAdicionalOtros( oCk, cIdGrupo )
{
	var cTxtOtros = "document.frmCuestionarioAfiliacion.cInformacionAdicionalOtros" + cIdGrupo ;
	cTxtOtros = eval(cTxtOtros);
	
	if ( oCk.checked == true )
	{
		cTxtOtros.className = "CTDAfiliacionCajas";
		cTxtOtros.readOnly = false;
		cTxtOtros.focus();
	}
	else
	{
		cTxtOtros.className = "CTDAfiliacionCajasDisabled CTDAfiliacionCajas";
		cTxtOtros.readOnly = true;
		cTxtOtros.value = "";
	}
	
}

function fncMostrarDetalleAfiliado( cIdAfiliado )
{
	var aImg = document.getElementById("imgDetalleAfiliado" + cIdAfiliado).src.split("/");
	
	if ( aImg[aImg.length - 1] == "btnMenosD.png" )
	{
		document.getElementById("imgDetalleAfiliado" + cIdAfiliado).src = "images/btnMasD.png";
		document.getElementById("trDetalleAfiliado" + cIdAfiliado).className = "CInputFocusOff";
	}
	else if ( aImg[aImg.length - 1] == "btnMasD.png" )
	{
		document.getElementById("imgDetalleAfiliado" + cIdAfiliado).src = "images/btnMenosD.png";
		document.getElementById("trDetalleAfiliado" + cIdAfiliado).className = "CInputFocusOn";
	}
}

function fncChangeEstadosPF( cIdEstado )
{
	fncConsultaMunicipiosPF(cIdEstado);
	fncConsultaClavesLadaPF(cIdEstado);
}

function fncConsultaMunicipiosPF( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cPFMunicipio.options.length > 0 )
		document.frmCuestionarioAfiliacion.cPFMunicipio.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLMunicipios = GetXmlHttpObject();
		
		if ( xmlHttpSQLMunicipios == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axMunicipios.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLMunicipios.onreadystatechange = fncAjaxCargaSQLMunicipiosPF;
		xmlHttpSQLMunicipios.open("GET", cUrl, true);
		xmlHttpSQLMunicipios.send(null);
	}
}

function fncAjaxCargaSQLMunicipiosPF()
{
	if (xmlHttpSQLMunicipios.readyState == 4)
	{
		if ( xmlHttpSQLMunicipios.status == 200 )
		{
			if ( xmlHttpSQLMunicipios.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLMunicipios.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cPFMunicipio.options[ document.frmCuestionarioAfiliacion.cPFMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPFMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cMunicipio").length )
				{
					document.frmCuestionarioAfiliacion.cPFMunicipio.options[ document.frmCuestionarioAfiliacion.cPFMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cPFMunicipio.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cPFMunicipio.options[ document.frmCuestionarioAfiliacion.cPFMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPFMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cPFMunicipio.options[ document.frmCuestionarioAfiliacion.cPFMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cPFMunicipio.options.add(oOption);
			//oOption.innerText = "Seleccione un Municipio";
			//oOption.value = "";
		}
	}
}

function fncConsultaClavesLadaPF( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cPFClaveLargaD.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLClavesLada = GetXmlHttpObject();
		
		if ( xmlHttpSQLClavesLada == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axClavesLada.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLClavesLada.onreadystatechange = fncAjaxCargaSQLClavesLadaPF;
		xmlHttpSQLClavesLada.open("GET", cUrl, true);
		xmlHttpSQLClavesLada.send(null);
	}
}

function fncAjaxCargaSQLClavesLadaPF()
{
	if (xmlHttpSQLClavesLada.readyState == 4)
	{
		if ( xmlHttpSQLClavesLada.status == 200 )
		{
			if ( xmlHttpSQLClavesLada.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLClavesLada.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cPFClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cClaveLargaD").length )
				{
					document.frmCuestionarioAfiliacion.cPFClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cPFClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cPFClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cPFClaveLargaD.options.add(oOption);
			//oOption.innerText = "Seleccione una clave";
			//oOption.value = "";
		}
	}
}

function fncChangeEstadosPM( cIdEstado )
{
	fncConsultaMunicipiosPM(cIdEstado);
	fncConsultaClavesLadaPM(cIdEstado);
	fncConsultaClavesLadaPMRes(cIdEstado);
}

function fncConsultaMunicipiosPM( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cPMMunicipio.options.length > 0 )
		document.frmCuestionarioAfiliacion.cPMMunicipio.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLMunicipios = GetXmlHttpObject();
		
		if ( xmlHttpSQLMunicipios == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axMunicipios.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLMunicipios.onreadystatechange = fncAjaxCargaSQLMunicipiosPM;
		xmlHttpSQLMunicipios.open("GET", cUrl, true);
		xmlHttpSQLMunicipios.send(null);
	}
}

function fncAjaxCargaSQLMunicipiosPM()
{
	if (xmlHttpSQLMunicipios.readyState == 4)
	{
		if ( xmlHttpSQLMunicipios.status == 200 )
		{
			if ( xmlHttpSQLMunicipios.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLMunicipios.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cPMMunicipio.options[ document.frmCuestionarioAfiliacion.cPMMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cMunicipio").length )
				{
					document.frmCuestionarioAfiliacion.cPMMunicipio.options[ document.frmCuestionarioAfiliacion.cPMMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cPMMunicipio.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cPMMunicipio.options[ document.frmCuestionarioAfiliacion.cPMMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cPMMunicipio.options[ document.frmCuestionarioAfiliacion.cPMMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cPMMunicipio.options.add(oOption);
			//oOption.innerText = "Seleccione un Municipio";
			//oOption.value = "";
		}
	}
}

function fncConsultaClavesLadaPM( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cPMClaveLargaD.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLClavesLada = GetXmlHttpObject();
		
		if ( xmlHttpSQLClavesLada == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axClavesLada.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLClavesLada.onreadystatechange = fncAjaxCargaSQLClavesLadaPM;
		xmlHttpSQLClavesLada.open("GET", cUrl, true);
		xmlHttpSQLClavesLada.send(null);
	}
}

function fncAjaxCargaSQLClavesLadaPM()
{
	if (xmlHttpSQLClavesLada.readyState == 4)
	{
		if ( xmlHttpSQLClavesLada.status == 200 )
		{
			if ( xmlHttpSQLClavesLada.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLClavesLada.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cPMClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cClaveLargaD").length )
				{
					document.frmCuestionarioAfiliacion.cPMClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cPMClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cPMClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cPMClaveLargaD.options.add(oOption);
			//oOption.innerText = "Seleccione una clave";
			//oOption.value = "";
		}
	}
}

function fncConsultaClavesLadaPMRes( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLClavesLadaRes = GetXmlHttpObject();
		
		if ( xmlHttpSQLClavesLadaRes == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axClavesLada.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLClavesLadaRes.onreadystatechange = fncAjaxCargaSQLClavesLadaPMRes;
		xmlHttpSQLClavesLadaRes.open("GET", cUrl, true);
		xmlHttpSQLClavesLadaRes.send(null);
	}
}

function fncAjaxCargaSQLClavesLadaPMRes()
{
	if (xmlHttpSQLClavesLadaRes.readyState == 4)
	{
		if ( xmlHttpSQLClavesLadaRes.status == 200 )
		{
			if ( xmlHttpSQLClavesLadaRes.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLClavesLadaRes.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cClaveLargaD").length )
				{
					document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options[ document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cPMResClaveLargaD.options.add(oOption);
			//oOption.innerText = "Seleccione una clave";
			//oOption.value = "";
		}
	}
}

function fncChangeEstados( cIdEstado )
{
	fncConsultaMunicipios(cIdEstado);
	fncConsultaClavesLada(cIdEstado);
}

function fncChangeEstadosCursosEspeciales( cIdEstado )
{
	fncConsultaMunicipios(cIdEstado);
	fncConsultaClavesLadaReferencias(cIdEstado);
}

function fncConsultaMunicipios( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cMunicipio.options.length > 0 )
		document.frmCuestionarioAfiliacion.cMunicipio.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLMunicipios = GetXmlHttpObject();
		
		if ( xmlHttpSQLMunicipios == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axMunicipios.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLMunicipios.onreadystatechange = fncAjaxCargaSQLMunicipios;
		xmlHttpSQLMunicipios.open("GET", cUrl, true);
		xmlHttpSQLMunicipios.send(null);
	}
}

function fncAjaxCargaSQLMunicipios()
{
	if (xmlHttpSQLMunicipios.readyState == 4)
	{
		if ( xmlHttpSQLMunicipios.status == 200 )
		{
			if ( xmlHttpSQLMunicipios.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLMunicipios.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cMunicipio").length )
				{
					document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue);
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cMunicipio.options.add(oOption);
			//oOption.innerText = "Seleccione un Municipio";
			//oOption.value = "";
		}
	}
}

function fncConsultaClavesLadaReferencias( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cClaveLargaD.options[0] = null;
	
	while ( document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[0] = null;
	
	while ( document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[0] = null;
	
	while ( document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLClavesLada = GetXmlHttpObject();
		
		if ( xmlHttpSQLClavesLada == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axClavesLada.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLClavesLada.onreadystatechange = fncAjaxCargaSQLClavesLadaReferencias;
		xmlHttpSQLClavesLada.open("GET", cUrl, true);
		xmlHttpSQLClavesLada.send(null);
	}
}

function fncAjaxCargaSQLClavesLadaReferencias()
{
	if (xmlHttpSQLClavesLada.readyState == 4)
	{
		if ( xmlHttpSQLClavesLada.status == 200 )
		{
			if ( xmlHttpSQLClavesLada.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLClavesLada.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption1 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.add(oOption1);
				//oOption1.innerText = "Seleccione una clave";
				//oOption1.value = "";
				
				document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption2 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.add(oOption2);
				//oOption2.innerText = "Seleccione una clave";
				//oOption2.value = "";
				
				document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption3 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.add(oOption3);
				//oOption3.innerText = "Seleccione una clave";
				//oOption3.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cClaveLargaD").length )
				{
					document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					//var oOption1 = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.add(oOption1);
					//oOption1.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption1.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					//var oOption2 = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.add(oOption2);
					//oOption2.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption2.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					//var oOption3 = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.add(oOption3);
					//oOption3.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption3.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption1 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.add(oOption1);
				//oOption1.innerText = "Seleccione una clave";
				//oOption1.value = "";
				
				document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption2 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.add(oOption2);
				//oOption2.innerText = "Seleccione una clave";
				//oOption2.value = "";
				
				document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				//var oOption3 = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.add(oOption3);
				//oOption3.innerText = "Seleccione una clave";
				//oOption3.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
			//oOption.innerText = "Seleccione una clave";
			//oOption.value = "";
			
			document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			//var oOption1 = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.add(oOption1);
			//oOption1.innerText = "Seleccione una clave";
			//oOption1.value = "";
			
			document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			//var oOption2 = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.add(oOption2);
			//oOption2.innerText = "Seleccione una clave";
			//oOption2.value = "";
			
			document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			//var oOption3 = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.add(oOption3);
			//oOption3.innerText = "Seleccione una clave";
			//oOption3.value = "";
		}
	}
}

function fncConsultaClavesLada( cIdEstado )
{
	while ( document.frmCuestionarioAfiliacion.cClaveLargaD.options.length > 0 )
		document.frmCuestionarioAfiliacion.cClaveLargaD.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLClavesLada = GetXmlHttpObject();
		
		if ( xmlHttpSQLClavesLada == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axClavesLada.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLClavesLada.onreadystatechange = fncAjaxCargaSQLClavesLada;
		xmlHttpSQLClavesLada.open("GET", cUrl, true);
		xmlHttpSQLClavesLada.send(null);
	}
}

function fncAjaxCargaSQLClavesLada()
{
	if (xmlHttpSQLClavesLada.readyState == 4)
	{
		if ( xmlHttpSQLClavesLada.status == 200 )
		{
			if ( xmlHttpSQLClavesLada.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLClavesLada.responseXML.documentElement;
				
				document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cClaveLargaD").length )
				{
					document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue);
					
					//var oOption = document.createElement("OPTION");
					//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cClaveLargaD")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
				
				//var oOption = document.createElement("OPTION");
				//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
				//oOption.innerText = "Seleccione una clave";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option("Seleccione una clave", "");
			
			//var oOption = document.createElement("OPTION");
			//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oOption);
			//oOption.innerText = "Seleccione una clave";
			//oOption.value = "";
		}
	}
}

function fncBuscaNoSocio()
{
	if ( fncTrim( document.frmCuestionarioAfiliacion.cUsuario.value ) == "" )
	{
		alert("Para realizar la búsqueda debé ingresar el No. Socio.");
		document.frmCuestionarioAfiliacion.cUsuario.focus();
		return;
	}
	else if ( fncTrim( document.frmCuestionarioAfiliacion.cPassword.value ) == "" )
	{
		alert("Para realizar la búsqueda debé ingresar la Contraseña.");
		document.frmCuestionarioAfiliacion.cPassword.focus();
		return;
	}
	else
	{
		xmlHttpSQLNoSocio = GetXmlHttpObject();
		
		if ( xmlHttpSQLNoSocio == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axNoSocio.asp" + 
			"?" + 
			"cUsuario=" + document.frmCuestionarioAfiliacion.cUsuario.value + 
			"&" + 
			"cPassword=" + document.frmCuestionarioAfiliacion.cPassword.value + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		xmlHttpSQLNoSocio.onreadystatechange = fncAjaxCargaSQLNoSocio;
		xmlHttpSQLNoSocio.open("GET", cUrl, true);
		xmlHttpSQLNoSocio.send(null);
	}
}

function fncAjaxCargaSQLNoSocio()
{
	if (xmlHttpSQLNoSocio.readyState == 4)
	{
		if ( xmlHttpSQLNoSocio.status == 200 )
		{
			if ( xmlHttpSQLNoSocio.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLNoSocio.responseXML.documentElement;
				
				if ( xmlResponse.getElementsByTagName("cValido")[0].childNodes[0].nodeValue == 0 )
				{
					document.frmCuestionarioAfiliacion.cUsuario.value = "No existe información.";
					document.frmCuestionarioAfiliacion.cUsuario.style.color = "#CC0000";
					document.frmCuestionarioAfiliacion.cPassword.style.color = "#CC0000";
				}
				else
				{
					document.frmCuestionarioAfiliacion.cPassword.disabled = true;
					document.frmCuestionarioAfiliacion.cBuscarNoSocio.disabled = true;
					
					if ( xmlResponse.getElementsByTagName("cTipoSucursal")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTipoSucursal.value = xmlResponse.getElementsByTagName("cTipoSucursal")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRFC.disabled = true;
					if ( xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cRFC.value = xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cTipoEmpresa.disabled = true;
					if ( xmlResponse.getElementsByTagName("cTipoEmpresa")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTipoEmpresa.value = xmlResponse.getElementsByTagName("cTipoEmpresa")[0].childNodes[0].nodeValue;
					
					if ( xmlResponse.getElementsByTagName("cTipoEmpresa")[0].childNodes[0].nodeValue == "1" )
					{
						document.getElementById("divPersonaFisica").className = "CDivTipoPersonaOn";
						
						document.frmCuestionarioAfiliacion.cNombre.disabled = true;
						if ( xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNombre.value = xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0].nodeValue;
						
						document.frmCuestionarioAfiliacion.cApellidoP.disabled = true;
						if ( xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cApellidoP.value = xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0].nodeValue;
						
						document.frmCuestionarioAfiliacion.cApellidoM.disabled = true;
						if ( xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cApellidoM.value = xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0].nodeValue;
						
						if ( xmlResponse.getElementsByTagName("cNombreComercialF")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNombreComercialF.value = xmlResponse.getElementsByTagName("cNombreComercialF")[0].childNodes[0].nodeValue;
					}
					else if ( xmlResponse.getElementsByTagName("cTipoEmpresa")[0].childNodes[0].nodeValue == "2" )
					{
						document.getElementById("divPersonaMoral").className = "CDivTipoPersonaOn";
						
						document.frmCuestionarioAfiliacion.cRazonSocial.disabled = true;
						if ( xmlResponse.getElementsByTagName("cRazonSocial")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cRazonSocial.value = xmlResponse.getElementsByTagName("cRazonSocial")[0].childNodes[0].nodeValue;
						
						if ( xmlResponse.getElementsByTagName("cNombreComercialM")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNombreComercialM.value = xmlResponse.getElementsByTagName("cNombreComercialM")[0].childNodes[0].nodeValue;
					}
					
					if ( xmlResponse.getElementsByTagName("cTipoUbicacion")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTipoUbicacion.value = xmlResponse.getElementsByTagName("cTipoUbicacion")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCalle.value = xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoExterior.value = xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoInterior.value = xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cColindantes01")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cColindantes01.value = xmlResponse.getElementsByTagName("cColindantes01")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cColindantes02")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cColindantes02.value = xmlResponse.getElementsByTagName("cColindantes02")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cPosterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cPosterior.value = xmlResponse.getElementsByTagName("cPosterior")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEstado.value = xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cMunicipio.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cMunicipio.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
					}
					if ( xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cColonia.value = xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cTipoAGEB")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTipoAGEB.value = xmlResponse.getElementsByTagName("cTipoAGEB")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cCP")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCP.value = xmlResponse.getElementsByTagName("cCP")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cWebPage")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cWebPage.value = xmlResponse.getElementsByTagName("cWebPage")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cDirectorGeneral")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cDirectorGeneral.value = xmlResponse.getElementsByTagName("cDirectorGeneral")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEMailDirectorGeneral")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEMailDirectorGeneral.value = xmlResponse.getElementsByTagName("cEMailDirectorGeneral")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cRepresentante")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cRepresentante.value = xmlResponse.getElementsByTagName("cRepresentante")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEMailRepresentante")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEMailRepresentante.value = xmlResponse.getElementsByTagName("cEMailRepresentante")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cContador")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cContador.value = xmlResponse.getElementsByTagName("cContador")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEMailContador")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEMailContador.value = xmlResponse.getElementsByTagName("cEMailContador")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cClaveLargaDI.value = xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					if ( xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea01.value = xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea02.value = xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cFax")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFax.value = xmlResponse.getElementsByTagName("cFax")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cIdActividad")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cIdActividad.value = xmlResponse.getElementsByTagName("cIdActividad")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cFechaOperacionesD.disabled = true;
					if ( xmlResponse.getElementsByTagName("cFechaOperacionesD")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFechaOperacionesD.value = xmlResponse.getElementsByTagName("cFechaOperacionesD")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cFechaOperacionesM.disabled = true;
					if ( xmlResponse.getElementsByTagName("cFechaOperacionesM")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFechaOperacionesM.value = xmlResponse.getElementsByTagName("cFechaOperacionesM")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cFechaOperacionesA.disabled = true;
					if ( xmlResponse.getElementsByTagName("cFechaOperacionesA")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFechaOperacionesA.value = xmlResponse.getElementsByTagName("cFechaOperacionesA")[0].childNodes[0].nodeValue;
					
					if ( xmlResponse.getElementsByTagName("cEmpleadosE")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEmpleadosE.value = xmlResponse.getElementsByTagName("cEmpleadosE")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEmpleadosO")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEmpleadosO.value = xmlResponse.getElementsByTagName("cEmpleadosO")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEmpleadosS")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEmpleadosS.value = xmlResponse.getElementsByTagName("cEmpleadosS")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cEmpleadosTotal")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEmpleadosTotal.value = fncFormatNumber(xmlResponse.getElementsByTagName("cEmpleadosTotal")[0].childNodes[0].nodeValue, 0);
					
					if ( xmlResponse.getElementsByTagName("cIngresosNetos")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cIngresosNetos.value = xmlResponse.getElementsByTagName("cIngresosNetos")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("cCuotaAfiliacion")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCuotaAfiliacion.value = fncFormatNumber(xmlResponse.getElementsByTagName("cCuotaAfiliacion")[0].childNodes[0].nodeValue, 2);
					if ( xmlResponse.getElementsByTagName("cCuotaAfiliacion")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCuotaAfiliacionT.value = fncFormatNumber(xmlResponse.getElementsByTagName("cCuotaAfiliacion")[0].childNodes[0].nodeValue, 2);
					if ( xmlResponse.getElementsByTagName("cCuotaSiem")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCuotaSiem.value = fncFormatNumber(xmlResponse.getElementsByTagName("cCuotaSiem")[0].childNodes[0].nodeValue, 2);
					if ( xmlResponse.getElementsByTagName("cCuotaSiem")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCuotaSiemT.value = fncFormatNumber(xmlResponse.getElementsByTagName("cCuotaSiem")[0].childNodes[0].nodeValue, 2);
					if ( xmlResponse.getElementsByTagName("cIdTipoOperacion")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cIdTipoOperacion.value = xmlResponse.getElementsByTagName("cIdTipoOperacion")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("bExporta")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.bExporta.value = xmlResponse.getElementsByTagName("bExporta")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("bImporta")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.bImporta.value = xmlResponse.getElementsByTagName("bImporta")[0].childNodes[0].nodeValue;
					if ( xmlResponse.getElementsByTagName("bProveedorGob")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.bProveedorGob.value = xmlResponse.getElementsByTagName("bProveedorGob")[0].childNodes[0].nodeValue;
					
					if ( xmlResponse.getElementsByTagName("cIdAfiliado")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cIdAfiliado.value = xmlResponse.getElementsByTagName("cIdAfiliado")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cNuevo.value = 0;
					
					var cXI = 0;
					while ( cXI < document.frmCuestionarioAfiliacion.length )
					{
						fncPintaDatosInvalidos(document.frmCuestionarioAfiliacion[cXI], true)
						cXI = cXI + 1;
					}
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cUsuario.value = "No existe información.";
				document.frmCuestionarioAfiliacion.cUsuario.style.color = "#CC0000";
				document.frmCuestionarioAfiliacion.cPassword.style.color = "#CC0000";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cUsuario.value = "No existe información.";
			document.frmCuestionarioAfiliacion.cUsuario.style.color = "#CC0000";
			document.frmCuestionarioAfiliacion.cPassword.style.color = "#CC0000";
		}
	}
}

function fncColorUsuarioPassword()
{
	document.frmCuestionarioAfiliacion.cUsuario.style.color = "#000000";
	document.frmCuestionarioAfiliacion.cPassword.style.color = "#000000";
}

function fncFocusUsuarioPassword()
{
	if ( document.frmCuestionarioAfiliacion.cUsuario.value == "No existe información." )
	{
		document.frmCuestionarioAfiliacion.cUsuario.value = "";
		document.frmCuestionarioAfiliacion.cPassword.value = "";
		
		fncColorUsuarioPassword();
	}
}

var cMesActual = 0;
var cAnioActual = 0;

function fncCalendarioBusqueda()
{
	cMesActual = Number(document.frmBusquedaCalendario.cMesBusqueda.value);
	cAnioActual = Number(document.frmBusquedaCalendario.cAnioBusqueda.value);
	
	fncCargaCalendario( cAnioActual, cMesActual, document.frmBusquedaCalendario.cId.value );
}

function fncCalendarioCambioAnio( cAccion, cTipoFerias, cAnioInicio, cAnioFin )
{
	if ( cAccion == "+" )
	{
		cAnioActual = cAnioActual + 1;
		
		if ( cAnioActual > cAnioFin )
			cAnioActual = cAnioFin;
	}
	else if ( cAccion == "-" )
	{
		cAnioActual = cAnioActual - 1;
		
		if ( cAnioActual < cAnioInicio )
			cAnioActual = cAnioInicio;
	}
	
	fncCargaCalendario( cAnioActual, cMesActual, cTipoFerias );
}

function fncCalendarioCambioMes( cAccion, cTipoFerias )
{
	if ( cAccion == "+" )
	{
		cMesActual = cMesActual + 1;
		
		if ( cMesActual > 12 )
		{
			cMesActual = 1;
			cAnioActual = cAnioActual + 1;
		}
	}
	else if ( cAccion == "-" )
	{
		cMesActual = cMesActual - 1;
		
		if ( cMesActual < 1 )
		{
			cMesActual = 12;
			cAnioActual = cAnioActual - 1;
		}
	}
	
	fncCargaCalendario( cAnioActual, cMesActual, cTipoFerias );
}

function fncCargaCalendario( cAnio, cMes, cTipoFerias )
{
	if ( document.getElementById("tdCalendarioDias") )
		document.getElementById("tdCalendarioDias").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='220' height='139'><tr><td align='center' valign='middle'><img src='" + cSvrPath + "images/cargando_l.gif' width='100' height='81' border='0'></td></tr></table>";
	
	if ( document.getElementById("tdCalendarioResultados") )
		document.getElementById("tdCalendarioResultados").innerHTML = "<table border='0' cellspacing='1' cellpadding='0' width='100%' align='center' bgcolor='#000000'><tr><td><table border='0' cellspacing='0' cellpadding='0' width='100%' height='144' align='center' bgcolor='#FFFFFF'><tr><td><tr><td align='center' valign='middle'><img src='" + cSvrPath + "images/cargando_l.gif' width='100' height='81' border='0'></td></tr></table></td></tr></table>";
	
	cAnioActual = cAnio;
	cMesActual = cMes;
	
	switch( cMes )
	{
		case 1:
			document.getElementById("tdCalendarioMes").innerHTML = "Enero";
			break;
		case 2:
			document.getElementById("tdCalendarioMes").innerHTML = "Febrero";
			break;
		case 3:
			document.getElementById("tdCalendarioMes").innerHTML = "Marzo";
			break;
		case 4:
			document.getElementById("tdCalendarioMes").innerHTML = "Abril";
			break;
		case 5:
			document.getElementById("tdCalendarioMes").innerHTML = "Mayo";
			break;
		case 6:
			document.getElementById("tdCalendarioMes").innerHTML = "Junio";
			break;
		case 7:
			document.getElementById("tdCalendarioMes").innerHTML = "Julio";
			break;
		case 8:
			document.getElementById("tdCalendarioMes").innerHTML = "Agosto";
			break;
		case 9:
			document.getElementById("tdCalendarioMes").innerHTML = "Septiembre";
			break;
		case 10:
			document.getElementById("tdCalendarioMes").innerHTML = "Octubre";
			break;
		case 11:
			document.getElementById("tdCalendarioMes").innerHTML = "Noviembre";
			break;
		case 12:
			document.getElementById("tdCalendarioMes").innerHTML = "Diciembre";
			break;
	}
	
	document.getElementById("tdCalendarioAnio").innerHTML = cAnio;
	document.frmBusquedaCalendario.cMesBusqueda.value = fncLenString(cMes, 2, "0");
	document.frmBusquedaCalendario.cAnioBusqueda.value = fncLenString(cAnio, 4, "0");
	
	//Calendario
	xmlHttpCalendario = GetXmlHttpObject();
	
	if ( xmlHttpCalendario == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axCalendario.asp" + 
		"?" + 
		"cId=" + cTipoFerias + 
		"&" + 
		"cMes=" + cMesActual + 
		"&" + 
		"cAnio=" + cAnioActual + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpCalendario.onreadystatechange = fncAjaxCargaCalendario;
	xmlHttpCalendario.open("GET", cUrl, true);
	xmlHttpCalendario.send(null);
	
	//Resultados
	xmlHttpCalendarioResultados = GetXmlHttpObject();
	
	if ( xmlHttpCalendarioResultados == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axCalendarioResultados.asp" + 
		"?" + 
		"cId=" + cTipoFerias + 
		"&" + 
		"cMes=" + cMesActual + 
		"&" + 
		"cAnio=" + cAnioActual + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpCalendarioResultados.onreadystatechange = fncAjaxCargaResultados;
	xmlHttpCalendarioResultados.open("GET", cUrl, true);
	xmlHttpCalendarioResultados.send(null);
}

function fncAjaxCargaResultados()
{
	if (xmlHttpCalendarioResultados.readyState == 4)
	{
		if ( xmlHttpCalendarioResultados.status == 200 )
		{
			if ( xmlHttpCalendarioResultados.responseText != "ERROR" )
			{
				if ( document.getElementById("tdCalendarioResultados") )
					document.getElementById("tdCalendarioResultados").innerHTML = xmlHttpCalendarioResultados.responseText;
			}
			else
			{
				if ( document.getElementById("tdCalendarioResultados") )
					document.getElementById("tdCalendarioResultados").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (1)</span>";
			}
		}
		else
		{
			if ( document.getElementById("tdCalendarioResultados") )
				document.getElementById("tdCalendarioResultados").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (2)</span>";
		}
	}
}

function fncAjaxCargaCalendario()
{
	if (xmlHttpCalendario.readyState == 4)
	{
		if ( xmlHttpCalendario.status == 200 )
		{
			if ( xmlHttpCalendario.responseText != "ERROR" )
			{
				document.getElementById("tdCalendarioDias").innerHTML = xmlHttpCalendario.responseText;
			}
			else
				document.getElementById("tdCalendarioDias").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (1)</span>";
		}
		else
			document.getElementById("tdCalendarioDias").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (2)</span>";
	}
}

function fncIniciaCalendarioHome( cMes, cAnio )
{
	cMesActual = cMes;
	cAnioActual = cAnio;
}

function fncCalendarioHomeCambioAnio( cAccion, cAnioInicio, cAnioFin )
{
	if ( cAccion == "+" )
	{
		cAnioActual = cAnioActual + 1;
		
		if ( cAnioActual > cAnioFin )
			cAnioActual = cAnioFin;
	}
	else if ( cAccion == "-" )
	{
		cAnioActual = cAnioActual - 1;
		
		if ( cAnioActual < cAnioInicio )
			cAnioActual = cAnioInicio;
	}
	
	fncCargaCalendarioHome( cAnioActual, cMesActual );
}

function fncCalendarioHomeCambioMes( cAccion )
{
	if ( cAccion == "+" )
	{
		cMesActual = cMesActual + 1;
		
		if ( cMesActual > 12 )
		{
			cMesActual = 1;
			cAnioActual = cAnioActual + 1;
		}
	}
	else if ( cAccion == "-" )
	{
		cMesActual = cMesActual - 1;
		
		if ( cMesActual < 1 )
		{
			cMesActual = 12;
			cAnioActual = cAnioActual - 1;
		}
	}
	
	fncCargaCalendarioHome( cAnioActual, cMesActual );
}

function fncCargaCalendarioHome( cAnio, cMes )
{
	if ( document.getElementById("tdCalendarioDias") )
		document.getElementById("tdCalendarioDias").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='220' height='139'><tr><td align='center' valign='middle'><img src='" + cSvrPath + "images/cargando_l.gif' width='100' height='81' border='0'></td></tr></table>";
	
	cAnioActual = cAnio;
	cMesActual = cMes;
	
	switch( cMes )
	{
		case 1:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Enero";
			break;
		case 2:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Febrero";
			break;
		case 3:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Marzo";
			break;
		case 4:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Abril";
			break;
		case 5:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Mayo";
			break;
		case 6:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Junio";
			break;
		case 7:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Julio";
			break;
		case 8:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Agosto";
			break;
		case 9:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Septiembre";
			break;
		case 10:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Octubre";
			break;
		case 11:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Noviembre";
			break;
		case 12:
			document.getElementById("tdCalendarioHomeMes").innerHTML = "Diciembre";
			break;
	}
	
	document.getElementById("tdCalendarioHomeAnio").innerHTML = cAnio;
	document.getElementById("tdCalendarioHomeAnioArriba").innerHTML = "Calendario " + cAnio + " CANIEM";
	
	//Calendario
	xmlHttpCalendario = GetXmlHttpObject();
	
	if ( xmlHttpCalendario == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axCalendarioHome.asp" + 
		"?" + 
		"cMes=" + cMesActual + 
		"&" + 
		"cAnio=" + cAnioActual + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpCalendario.onreadystatechange = fncAjaxCargaCalendarioHome;
	xmlHttpCalendario.open("GET", cUrl, true);
	xmlHttpCalendario.send(null);
}

function fncAjaxCargaCalendarioHome()
{
	if (xmlHttpCalendario.readyState == 4)
	{
		if ( xmlHttpCalendario.status == 200 )
		{
			if ( xmlHttpCalendario.responseText != "ERROR" )
			{
				document.getElementById("tdCalendarioHomeDias").innerHTML = xmlHttpCalendario.responseText;
			}
			else
				document.getElementById("tdCalendarioHomeDias").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (1)</span>";
		}
		else
			document.getElementById("tdCalendarioHomeDias").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (2)</span>";
	}
}

function fncContactoOcupacion( cTipoOcupacion )
{
	document.frmFormaContacto.cOcupacion1.value = "";
	document.frmFormaContacto.cOcupacion2.value = "";
	
	if ( cTipoOcupacion.value == "1" )
	{
		document.frmFormaContacto.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOn";
		document.frmFormaContacto.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
	}
	else if ( cTipoOcupacion.value == "2" )
	{
		document.frmFormaContacto.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
		document.frmFormaContacto.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOn";
	}
	else
	{
		document.frmFormaContacto.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
		document.frmFormaContacto.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
	}
}

function fncContactoEstado( cEstado )
{
	if ( cEstado.value == "XXEXTXX" )
	{
		document.frmFormaContacto.cExtranjero.className = "CWidthAfiliacionCajasMed CTDAfiliacionCajas CInputFocusOn";
	}
	else
	{
		document.frmFormaContacto.cExtranjero.className = "CWidthAfiliacionCajasMed CTDAfiliacionCajas CInputFocusOff";
	}
}

function fncValidaFormaContacto()
{
	if ( document.frmFormaContacto.cRangoEdades.value == "" )
	{
		alert("El campo \"Rango de Edad\" no es válido.");
		document.frmFormaContacto.cRangoEdades.focus();
		return;
	}
	
	if ( document.frmFormaContacto.cGenero.value == "" )
	{
		alert("El campo \"Género\" no es válido.");
		document.frmFormaContacto.cGenero.focus();
		return;
	}
	
	if ( fncTrim(document.frmFormaContacto.cEMail.value) == "" )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmFormaContacto.cEMail.focus();
		return;
	}
	else if ( fncEsEmail(document.frmFormaContacto.cEMail.value) == false )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmFormaContacto.cEMail.focus();
		return;
	}
	
	if ( document.frmFormaContacto.cIdAreaInteres.value == "" )
	{
		alert("El campo \"Área de interés\" no es válido.");
		document.frmFormaContacto.cIdAreaInteres.focus();
		return;
	}
	
	if ( document.frmFormaContacto.cTipoOcupacion.value == "" )
	{
		alert("El campo \"Ocupación\" no es válido.");
		document.frmFormaContacto.cTipoOcupacion.focus();
		return;
	}
	else
	{
		var cTipoOcupacion = document.frmFormaContacto.cTipoOcupacion.value;
		var oTipoOcupacion = "document.frmFormaContacto.cOcupacion" + cTipoOcupacion;
		oTipoOcupacion = eval(oTipoOcupacion);
		
		if ( oTipoOcupacion.value == "" )
		{
			alert("El campo \"Ocupación\" no es válido.");
			oTipoOcupacion.focus();
			return;
		}
	}
	
	if ( document.frmFormaContacto.cEstado.value == "" )
	{
		alert("El campo ¿De dónde nos visita? no es válido.");
		document.frmFormaContacto.cEstado.focus();
		return;
	}
	else if ( document.frmFormaContacto.cEstado.value == "XXEXTXX" && fncTrim(document.frmFormaContacto.cExtranjero.value) == "" )
	{
		alert("El campo ¿De dónde nos visita? no es válido.");
		document.frmFormaContacto.cExtranjero.focus();
		return;
	}
	
	if ( fncTrim(document.frmFormaContacto.cAsunto.value) == "" )
	{
		alert("El campo \"Asunto\" no es válido.");
		document.frmFormaContacto.cAsunto.focus();
		return;
	}
	else if ( document.frmFormaContacto.cAsunto.value.length > 1000 )
	{
		alert("El campo \"Asunto\" no puede ser mayor a 1,000 caracteres.");
		document.frmFormaContacto.cAsunto.focus();
		return;
	}
	
	document.frmFormaContacto.action = "xContacto.asp";
	document.frmFormaContacto.submit();
}

function fncCambiaPasado( cValorPasado )
{
	if ( cValorPasado.value == "3" )
		document.getElementById("divAfiliadoPasado").style.display = "";
	else
		document.getElementById("divAfiliadoPasado").style.display = "none";
}

function fncPreRegistroFeriasEnviar()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "0";
	fncValidaPreRegFeriasNacional();
}

function fncPreRegistroFeriasEnviarInt()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "0";
	fncValidaPreRegFeriasInterNacional();
}

function fncPreRegistroFeriasImprimir()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "1";
	fncValidaPreRegFeriasNacional();
}

function fncPreRegistroFeriasImprimirInt()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "1";
	fncValidaPreRegFeriasInterNacional();
}

function fncValidaPreRegFeriasNacional()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoEmpresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoEmpresa, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFNombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cPFNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoM.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFTelefono01.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFTelefono01";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFTelefono01";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFTelefono01, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFTelefono01.value = fncTrim( document.frmCuestionarioAfiliacion.cPFTelefono01.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFEMail.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFEMail";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFEMail, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPFEMail.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFEMail";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFEMail, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cPFEMail.value );
		}
		else if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "2" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEmpresa.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEmpresa";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEmpresa";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEmpresa, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEmpresa.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEmpresa.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMTelefono.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMTelefono";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMTelefono";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMTelefono, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMTelefono.value = fncTrim( document.frmCuestionarioAfiliacion.cPMTelefono.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEMail.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMail";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMail, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPMEMail.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMail";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMail, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEMail.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMNombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cPMNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoM.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMTelefonoRes.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMTelefonoRes";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMTelefonoRes";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMTelefonoRes, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMTelefonoRes.value = fncTrim( document.frmCuestionarioAfiliacion.cPMTelefonoRes.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEMailRes.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMailRes";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMailRes";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMailRes, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPMEMailRes.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMailRes";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMailRes";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMailRes, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEMailRes.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEMailRes.value );
		}
	}
	
	if ( document.frmCuestionarioAfiliacion.cFeriaInteres.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "FeriaInteres";
		if ( oCampoNombre == "" ) oCampoNombre = "cFeriaInteres";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cFeriaInteres, false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		if ( document.frmCuestionarioAfiliacion.cImprimir.value == "0" )
		{
			document.frmCuestionarioAfiliacion.action = "xPreRegistro.asp";
			document.frmCuestionarioAfiliacion.submit();
		}
		else if ( document.frmCuestionarioAfiliacion.cImprimir.value == "1" )
		{
			window.print();
		}
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncCambioCargo( oCargos )
{
	if ( oCargos.value == "Otros" )
	{
		oCargos.style.display = "none";
		document.frmCuestionarioAfiliacion.cCargoOtro.style.display = "";
	}
}

function fncValidaPreRegFeriasInterNacional()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TipoEmpresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cTipoEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTipoEmpresa, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFNombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cPFNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cPFApellidoM.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFRFC.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFRFC";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFRFC";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFRFC, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cPFRFC.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFDomicilio.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFDomicilio";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFDomicilio";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFDomicilio, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFDomicilio.value = fncTrim( document.frmCuestionarioAfiliacion.cPFDomicilio.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFNoExterior.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFNoExterior";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFNoExterior";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFNoExterior, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cPFNoExterior.value );
			
			if ( document.frmCuestionarioAfiliacion.cPFEstado.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFEstado";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFEstado";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFEstado, false );
			}
			
			if ( document.frmCuestionarioAfiliacion.cPFMunicipio.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFMunicipio";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFMunicipio";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFMunicipio, false );
			}
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFColonia.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFColonia";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFColonia";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFColonia, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cPFColonia.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFCP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFCP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFCP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFCP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFCP.value = fncTrim( document.frmCuestionarioAfiliacion.cPFCP.value );
			
			/*
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFClaveLargaDI.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFClaveLargaDI";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFClaveLargaDI";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFClaveLargaDI, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cPFClaveLargaDI.value );
			*/
			/*
			if ( document.frmCuestionarioAfiliacion.cPFClaveLargaD.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFClaveLargaD";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFClaveLargaD";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFClaveLargaD, false );
			}
			*/
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFTelLinea01.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFTelLinea01";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFTelLinea01";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFTelLinea01, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cPFTelLinea01.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPFEMail.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFEMail";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFEMail, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPFEMail.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PFEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPFEMail";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPFEMail, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPFEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cPFEMail.value );
		}
		else if ( document.frmCuestionarioAfiliacion.cTipoEmpresa.value == "2" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEmpresa.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEmpresa";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEmpresa";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEmpresa, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEmpresa.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEmpresa.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMRFC.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMRFC";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMRFC";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMRFC, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cPMRFC.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMDomicilio.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMDomicilio";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMDomicilio";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMDomicilio, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMDomicilio.value = fncTrim( document.frmCuestionarioAfiliacion.cPMDomicilio.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMNoExterior.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMNoExterior";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMNoExterior";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMNoExterior, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cPMNoExterior.value );
			
			if ( document.frmCuestionarioAfiliacion.cPMEstado.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEstado";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEstado";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEstado, false );
			}
			
			if ( document.frmCuestionarioAfiliacion.cPMMunicipio.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMMunicipio";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMMunicipio";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMMunicipio, false );
			}
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMColonia.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMColonia";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMColonia";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMColonia, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cPMColonia.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMCP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMCP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMCP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMCP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMCP.value = fncTrim( document.frmCuestionarioAfiliacion.cPMCP.value );
			
			/*
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMClaveLargaDI.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMClaveLargaDI";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMClaveLargaDI";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMClaveLargaDI, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cPMClaveLargaDI.value );
			*/
			/*
			if ( document.frmCuestionarioAfiliacion.cPMClaveLargaD.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMClaveLargaD";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMClaveLargaD";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMClaveLargaD, false );
			}
			*/
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMTelLinea01.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMTelLinea01";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMTelLinea01";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMTelLinea01, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cPMTelLinea01.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEMail.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMail";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMail, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPMEMail.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMail";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMail";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMail, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEMail.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMNombre.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMNombre";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMNombre";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMNombre, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cPMNombre.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoP.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMApellidoP";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMApellidoP";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMApellidoP, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoP.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoM.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMApellidoM";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMApellidoM";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMApellidoM, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cPMApellidoM.value );
			
			/*
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMResClaveLargaDI.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMResClaveLargaDI";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMResClaveLargaDI";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMResClaveLargaDI, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMResClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cPMResClaveLargaDI.value );
			*/
			/*
			if ( document.frmCuestionarioAfiliacion.cPMResClaveLargaD.value == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMResClaveLargaD";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMResClaveLargaD";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMResClaveLargaD, false );
			}
			*/
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMResTelLinea01.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMResTelLinea01";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMResTelLinea01";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMResTelLinea01, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMResTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cPMResTelLinea01.value );
			
			if ( fncTrim( document.frmCuestionarioAfiliacion.cPMEMailRes.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMailRes";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMailRes";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMailRes, false );
			}
			else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cPMEMailRes.value ) == false )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "PMEMailRes";
				if ( oCampoNombre == "" ) oCampoNombre = "cPMEMailRes";
							
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPMEMailRes, false );
			}
			else
				document.frmCuestionarioAfiliacion.cPMEMailRes.value = fncTrim( document.frmCuestionarioAfiliacion.cPMEMailRes.value );
		}
	}
	
	if ( document.frmCuestionarioAfiliacion.cAfiliadoPasado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "AfiliadoPasado";
		if ( oCampoNombre == "" ) oCampoNombre = "cAfiliadoPasado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cAfiliadoPasado, false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		if ( document.frmCuestionarioAfiliacion.cImprimir.value == "0" )
		{
			document.frmCuestionarioAfiliacion.action = "xPreRegistro.asp";
			document.frmCuestionarioAfiliacion.submit();
		}
		else if ( document.frmCuestionarioAfiliacion.cImprimir.value == "1" )
		{
			window.print();
		}
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncPreRegistroCursosEnviar()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "0";
	fncValidaPreRegCursos();
}

function fncPreRegistroCursosImprimir()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "1";
	fncValidaPreRegCursos();
}

function fncValidaPreRegCursos()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliado";
		if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliado, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliadoNumero";
				if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliadoNumero";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero, false );
			}
			else
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value );
		}
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "RFC";
		if ( oCampoNombre == "" ) oCampoNombre = "cRFC";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRFC, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cRFC.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cNombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cNombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoP";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoM";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoM";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoM, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCalle.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Calle";
		if ( oCampoNombre == "" ) oCampoNombre = "cCalle";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCalle, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim( document.frmCuestionarioAfiliacion.cCalle.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoExterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoExterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoExterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value );
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Estado";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstado, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Municipio";
		if ( oCampoNombre == "" ) oCampoNombre = "cMunicipio";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cMunicipio, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColonia.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colonia";
		if ( oCampoNombre == "" ) oCampoNombre = "cColonia";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColonia, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cColonia.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CP";
		if ( oCampoNombre == "" ) oCampoNombre = "cCP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim( document.frmCuestionarioAfiliacion.cCP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value );
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TelLinea";
		if ( oCampoNombre == "" ) oCampoNombre = "cTelLinea01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTelLinea01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMail.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMail.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cEMail.value );
	
	if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "1" && document.frmCuestionarioAfiliacion.bNoAfiliadoValido.value == "0" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliadoNumero";
		if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliadoNumero";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero, false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		if ( document.frmCuestionarioAfiliacion.cImprimir.value == "0" )
		{
			document.frmCuestionarioAfiliacion.cSiAfiliado.disabled = false;
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.disabled = false;
			document.frmCuestionarioAfiliacion.cRFC.disabled = false;
			document.frmCuestionarioAfiliacion.cNombre.disabled = false;
			document.frmCuestionarioAfiliacion.cApellidoP.disabled = false;
			document.frmCuestionarioAfiliacion.cApellidoM.disabled = false;
			document.frmCuestionarioAfiliacion.cCalle.disabled = false;
			document.frmCuestionarioAfiliacion.cNoExterior.disabled = false;
			document.frmCuestionarioAfiliacion.cNoInterior.disabled = false;
			document.frmCuestionarioAfiliacion.cEstado.disabled = false;
			document.frmCuestionarioAfiliacion.cMunicipio.disabled = false;
			document.frmCuestionarioAfiliacion.cColonia.disabled = false;
			document.frmCuestionarioAfiliacion.cCP.disabled = false;
			document.frmCuestionarioAfiliacion.cClaveLargaDI.disabled = false;
			document.frmCuestionarioAfiliacion.cClaveLargaD.disabled = false;
			document.frmCuestionarioAfiliacion.cTelLinea01.disabled = false;
			document.frmCuestionarioAfiliacion.cTelLinea02.disabled = false;
			document.frmCuestionarioAfiliacion.cFax.disabled = false;
			
			document.frmCuestionarioAfiliacion.action = "xPreRegistro.asp";
			document.frmCuestionarioAfiliacion.submit();
		}
		else if ( document.frmCuestionarioAfiliacion.cImprimir.value == "1" )
		{
			window.print();
		}
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncPreRegistroCursosMedidaEnviar()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "0";
	fncValidaPreRegCursosMedida();
}

function fncPreRegistroCursosMedidaImprimir()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "1";
	fncValidaPreRegCursosMedida();
}

function fncValidaPreRegCursosMedida()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCursoRequerido.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CursoRequerido";
		if ( oCampoNombre == "" ) oCampoNombre = "cCursoRequerido";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCursoRequerido, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCursoRequerido.value = fncTrim( document.frmCuestionarioAfiliacion.cCursoRequerido.value );
	
	if ( document.frmCuestionarioAfiliacion.cNivel.value == "Otro" )
	{
		if ( fncTrim( document.frmCuestionarioAfiliacion.cNivelEspecificar.value ) == "" )
		{
			if ( cCampoOpcion == "" ) cCampoOpcion = "NivelEspecificar";
			if ( oCampoNombre == "" ) oCampoNombre = "cNivelEspecificar";
			
			fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNivelEspecificar, false );
		}
		else
			document.frmCuestionarioAfiliacion.cNivelEspecificar.value = fncTrim( document.frmCuestionarioAfiliacion.cNivelEspecificar.value );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoPersonas.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoPersonas";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoPersonas";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoPersonas, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoPersonas.value = fncTrim( document.frmCuestionarioAfiliacion.cNoPersonas.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpresa.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpresa, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpresa.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpresa.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCalle.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Calle";
		if ( oCampoNombre == "" ) oCampoNombre = "cCalle";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCalle, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim( document.frmCuestionarioAfiliacion.cCalle.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoExterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoExterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoExterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value );
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Estado";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstado, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Municipio";
		if ( oCampoNombre == "" ) oCampoNombre = "cMunicipio";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cMunicipio, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColonia.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colonia";
		if ( oCampoNombre == "" ) oCampoNombre = "cColonia";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColonia, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cColonia.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CP";
		if ( oCampoNombre == "" ) oCampoNombre = "cCP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim( document.frmCuestionarioAfiliacion.cCP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "RFC";
		if ( oCampoNombre == "" ) oCampoNombre = "cRFC";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRFC, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cRFC.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cNombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cNombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoP";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoM";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoM";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoM, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCargoContacto.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CargoContacto";
		if ( oCampoNombre == "" ) oCampoNombre = "cCargoContacto";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCargoContacto, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCargoContacto.value = fncTrim( document.frmCuestionarioAfiliacion.cCargoContacto.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value );
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TelLinea";
		if ( oCampoNombre == "" ) oCampoNombre = "cTelLinea01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTelLinea01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMail.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMail.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cEMail.value );
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		if ( document.frmCuestionarioAfiliacion.cImprimir.value == "0" )
		{
			document.frmCuestionarioAfiliacion.action = "xPreRegistro.asp";
			document.frmCuestionarioAfiliacion.submit();
		}
		else if ( document.frmCuestionarioAfiliacion.cImprimir.value == "1" )
		{
			window.print();
		}
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncPreRegistroCursosEspecialesEnviar()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "0";
	fncValidaPreRegCursosEspeciales();
}

function fncPreRegistroCursosEspecialesImprimir()
{
	document.frmCuestionarioAfiliacion.cImprimir.value = "1";
	fncValidaPreRegCursosEspeciales();
}

function fncCartaRecomendacion(cIdEstado)
{
	if ( cIdEstado.value == "9" )
		document.getElementById("tdCartaRecomendacion").innerHTML = "* Cartas de recomendación";
	else
		document.getElementById("tdCartaRecomendacion").innerHTML = "Cartas de recomendación";
}

function fncValidaPreRegCursosEspeciales()
{
	var cCampoOpcion = "";
	var oCampoNombre = "";
	
	document.getElementById("trMensajeError").className = "CTrOpcionesOff";
	
	if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliado";
		if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliado, false );
	}
	else
	{
		if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "1" )
		{
			if ( fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value ) == "" )
			{
				if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliadoNumero";
				if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliadoNumero";
				
				fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero, false );
			}
			else
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value );
		}
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "RFC";
		if ( oCampoNombre == "" ) oCampoNombre = "cRFC";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRFC, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRFC.value = fncTrim( document.frmCuestionarioAfiliacion.cRFC.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cNombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNombre.value = fncTrim( document.frmCuestionarioAfiliacion.cNombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoP";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ApellidoM";
		if ( oCampoNombre == "" ) oCampoNombre = "cApellidoM";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cApellidoM, false );
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim( document.frmCuestionarioAfiliacion.cApellidoM.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCalle.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Calle";
		if ( oCampoNombre == "" ) oCampoNombre = "cCalle";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCalle, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim( document.frmCuestionarioAfiliacion.cCalle.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "NoExterior";
		if ( oCampoNombre == "" ) oCampoNombre = "cNoExterior";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cNoExterior, false );
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim( document.frmCuestionarioAfiliacion.cNoExterior.value );
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Estado";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstado";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstado, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Municipio";
		if ( oCampoNombre == "" ) oCampoNombre = "cMunicipio";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cMunicipio, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cColonia.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Colonia";
		if ( oCampoNombre == "" ) oCampoNombre = "cColonia";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cColonia, false );
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim( document.frmCuestionarioAfiliacion.cColonia.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cCP.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "CP";
		if ( oCampoNombre == "" ) oCampoNombre = "cCP";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cCP, false );
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim( document.frmCuestionarioAfiliacion.cCP.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cClaveLargaDI.value );
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "TelLinea";
		if ( oCampoNombre == "" ) oCampoNombre = "cTelLinea01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cTelLinea01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim( document.frmCuestionarioAfiliacion.cTelLinea01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEMail.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else if ( fncEsEmail( document.frmCuestionarioAfiliacion.cEMail.value ) == false )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EMail";
		if ( oCampoNombre == "" ) oCampoNombre = "cEMail";
				
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEMail, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEMail.value = fncTrim( document.frmCuestionarioAfiliacion.cEMail.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEdad.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Edad";
		if ( oCampoNombre == "" ) oCampoNombre = "cEdad";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEdad, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEdad.value = fncTrim( document.frmCuestionarioAfiliacion.cEdad.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cSexo.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Sexo";
		if ( oCampoNombre == "" ) oCampoNombre = "cSexo";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSexo, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEstadoCivil.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "EstadoCivil";
		if ( oCampoNombre == "" ) oCampoNombre = "cEstadoCivil";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEstadoCivil, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEstadoCivil.value = fncTrim( document.frmCuestionarioAfiliacion.cEstadoCivil.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cGradoEstudios.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "GradoEstudios";
		if ( oCampoNombre == "" ) oCampoNombre = "cGradoEstudios";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cGradoEstudios, false );
	}
	else
		document.frmCuestionarioAfiliacion.cGradoEstudios.value = fncTrim( document.frmCuestionarioAfiliacion.cGradoEstudios.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cPuestoActual.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "PuestoActual";
		if ( oCampoNombre == "" ) oCampoNombre = "cPuestoActual";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPuestoActual, false );
	}
	else
		document.frmCuestionarioAfiliacion.cPuestoActual.value = fncTrim( document.frmCuestionarioAfiliacion.cPuestoActual.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cEmpresa.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Empresa";
		if ( oCampoNombre == "" ) oCampoNombre = "cEmpresa";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cEmpresa, false );
	}
	else
		document.frmCuestionarioAfiliacion.cEmpresa.value = fncTrim( document.frmCuestionarioAfiliacion.cEmpresa.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cResponsabilidades.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Responsabilidades";
		if ( oCampoNombre == "" ) oCampoNombre = "cResponsabilidades";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cResponsabilidades, false );
	}
	else
		document.frmCuestionarioAfiliacion.cResponsabilidades.value = fncTrim( document.frmCuestionarioAfiliacion.cResponsabilidades.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cPorQueAsistir.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "PorQueAsistir";
		if ( oCampoNombre == "" ) oCampoNombre = "cPorQueAsistir";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPorQueAsistir, false );
	}
	else
		document.frmCuestionarioAfiliacion.cPorQueAsistir.value = fncTrim( document.frmCuestionarioAfiliacion.cPorQueAsistir.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cPlanDesarrollo.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "PlanDesarrollo";
		if ( oCampoNombre == "" ) oCampoNombre = "cPlanDesarrollo";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cPlanDesarrollo, false );
	}
	else
	{
		document.frmCuestionarioAfiliacion.cPlanDesarrollo.value = fncTrim( document.frmCuestionarioAfiliacion.cPlanDesarrollo.value );
		
		if ( document.frmCuestionarioAfiliacion.cPlanDesarrollo.value.length > 600 )
			document.frmCuestionarioAfiliacion.cPlanDesarrollo.value = document.frmCuestionarioAfiliacion.cPlanDesarrollo.value.substring(0, 600);
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01Nombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01Nombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01Nombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef01Nombre.value = fncTrim( document.frmCuestionarioAfiliacion.cRef01Nombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01Prefesion.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01Prefesion";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01Prefesion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01Prefesion, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef01Prefesion.value = fncTrim( document.frmCuestionarioAfiliacion.cRef01Prefesion.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01Tiempo.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01Tiempo";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01Tiempo";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01Tiempo, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef01Tiempo.value = fncTrim( document.frmCuestionarioAfiliacion.cRef01Tiempo.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01ClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01ClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01ClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef01ClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cRef01ClaveLargaDI.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01ClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01ClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef01Telefono01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref01Telefono01";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef01Telefono01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef01Telefono01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef01Telefono01.value = fncTrim( document.frmCuestionarioAfiliacion.cRef01Telefono01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02Nombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02Nombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02Nombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef02Nombre.value = fncTrim( document.frmCuestionarioAfiliacion.cRef02Nombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02Prefesion.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02Prefesion";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02Prefesion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02Prefesion, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef02Prefesion.value = fncTrim( document.frmCuestionarioAfiliacion.cRef02Prefesion.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02Tiempo.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02Tiempo";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02Tiempo";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02Tiempo, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef02Tiempo.value = fncTrim( document.frmCuestionarioAfiliacion.cRef02Tiempo.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02ClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02ClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02ClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef02ClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cRef02ClaveLargaDI.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02ClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02ClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef02Telefono01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref02Telefono01";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef02Telefono01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef02Telefono01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef02Telefono01.value = fncTrim( document.frmCuestionarioAfiliacion.cRef02Telefono01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03Nombre.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03Nombre";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03Nombre";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03Nombre, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef03Nombre.value = fncTrim( document.frmCuestionarioAfiliacion.cRef03Nombre.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03Prefesion.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03Prefesion";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03Prefesion";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03Prefesion, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef03Prefesion.value = fncTrim( document.frmCuestionarioAfiliacion.cRef03Prefesion.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03Tiempo.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03Tiempo";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03Tiempo";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03Tiempo, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef03Tiempo.value = fncTrim( document.frmCuestionarioAfiliacion.cRef03Tiempo.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03ClaveLargaDI.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03ClaveLargaDI";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03ClaveLargaDI";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03ClaveLargaDI, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef03ClaveLargaDI.value = fncTrim( document.frmCuestionarioAfiliacion.cRef03ClaveLargaDI.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03ClaveLargaD";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03ClaveLargaD";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03ClaveLargaD, false );
	}
	
	if ( fncTrim( document.frmCuestionarioAfiliacion.cRef03Telefono01.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Ref03Telefono01";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03Telefono01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cRef03Telefono01, false );
	}
	else
		document.frmCuestionarioAfiliacion.cRef03Telefono01.value = fncTrim( document.frmCuestionarioAfiliacion.cRef03Telefono01.value );
	
	if ( fncTrim( document.frmCuestionarioAfiliacionCV.cCurriculum.value ) == "" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "Curriculum";
		if ( oCampoNombre == "" ) oCampoNombre = "cRef03Telefono01";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacionCV.cCurriculum, false );
	}
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "9" )
	{
		if ( fncTrim( document.frmCuestionarioAfiliacionCV.cCartaRecomendacion.value ) == "" )
		{
			if ( cCampoOpcion == "" ) cCampoOpcion = "CartaRecomendacion";
			if ( oCampoNombre == "" ) oCampoNombre = "cRef03Telefono01";
			
			fncPintaDatosInvalidos( document.frmCuestionarioAfiliacionCV.cCartaRecomendacion, false );
		}
	}
	
	if ( document.frmCuestionarioAfiliacion.cSiAfiliado.value == "1" && document.frmCuestionarioAfiliacion.bNoAfiliadoValido.value == "0" )
	{
		if ( cCampoOpcion == "" ) cCampoOpcion = "SiAfiliadoNumero";
		if ( oCampoNombre == "" ) oCampoNombre = "cSiAfiliadoNumero";
		
		fncPintaDatosInvalidos( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero, false );
	}
	
	if ( cCampoOpcion == "" && oCampoNombre == "" )
	{
		if ( document.frmCuestionarioAfiliacion.cImprimir.value == "0" )
		{
			document.frmCuestionarioAfiliacion.cSiAfiliado.disabled = false;
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.disabled = false;
			document.frmCuestionarioAfiliacion.cRFC.disabled = false;
			document.frmCuestionarioAfiliacion.cNombre.disabled = false;
			document.frmCuestionarioAfiliacion.cApellidoP.disabled = false;
			document.frmCuestionarioAfiliacion.cApellidoM.disabled = false;
			document.frmCuestionarioAfiliacion.cCalle.disabled = false;
			document.frmCuestionarioAfiliacion.cNoExterior.disabled = false;
			document.frmCuestionarioAfiliacion.cNoInterior.disabled = false;
			document.frmCuestionarioAfiliacion.cEstado.disabled = false;
			document.frmCuestionarioAfiliacion.cMunicipio.disabled = false;
			document.frmCuestionarioAfiliacion.cColonia.disabled = false;
			document.frmCuestionarioAfiliacion.cCP.disabled = false;
			document.frmCuestionarioAfiliacion.cClaveLargaDI.disabled = false;
			document.frmCuestionarioAfiliacion.cClaveLargaD.disabled = false;
			document.frmCuestionarioAfiliacion.cTelLinea01.disabled = false;
			document.frmCuestionarioAfiliacion.cTelLinea02.disabled = false;
			document.frmCuestionarioAfiliacion.cFax.disabled = false;
			
			var cFileNameCV;
			var CCCV;
			var cXCV;
			var cNombreCV = document.frmCuestionarioAfiliacionCV.cCurriculum.value;
			var cCadenaCV = cNombreCV.length;
			var cExtensionArchivoCV = "";
			
			for ( cXCV = cCadenaCV; cXCV > 0; cXCV-- )
			{
				CCCV = cNombreCV.substr(cXCV, 1);
				
				if( CCCV == "." )
					cXCV = 0
				else
					cExtensionArchivoCV = CCCV + cExtensionArchivoCV
			}
			
			if ( cNombreCV.indexOf("\\") == -1 )
				cFileNameCV = cNombreCV;
			else
			{
				cFileNameCV = "";
				
				for ( cXCV = cCadenaCV; cXCV > 0; cXCV-- )
				{
					CCCV = cNombreCV.substr(cXCV, 1);
					
					if( CCCV == "\\" )
						cXCV = 0;
					else
						cFileNameCV = CCCV + cFileNameCV;
				}
			}
			
			cExtensionArchivoCV = cExtensionArchivoCV.toLowerCase();
			
			if ( cExtensionArchivoCV != "doc" && 
				cExtensionArchivoCV != "docx" && 
				cExtensionArchivoCV != "xls" && 
				cExtensionArchivoCV != "xlsx" && 
				cExtensionArchivoCV != "ppt" && 
				cExtensionArchivoCV != "pptx" && 
				cExtensionArchivoCV != "pps" && 
				cExtensionArchivoCV != "ppsx" && 
				cExtensionArchivoCV != "pdf" && 
				cExtensionArchivoCV != "jpg" )
			{
				alert("El campo \"Curriculum Vitae\" no es válido.\n\nLos formatos válidos son:\n Microsoft Word\n Microsoft Excel\n Microsoft Powerpoint\n Adobe Acrobat\n Imagenes JPG");
				document.frmCuestionarioAfiliacionCV.cCurriculum.focus();
				return;
			}
			
			document.frmCuestionarioAfiliacion.cFileNameUploadCV.value = cFileNameCV;
			
			if ( fncTrim( document.frmCuestionarioAfiliacionCV.cCartaRecomendacion.value ) != "" )
			{
				var cFileNameCR;
				var CCCR;
				var cXCR;
				var cNombreCR = document.frmCuestionarioAfiliacionCV.cCartaRecomendacion.value;
				var cCadenaCR = cNombreCR.length;
				var cExtensionArchivoCR = "";
				
				for ( cXCR = cCadenaCR; cXCR > 0; cXCR-- )
				{
					CCCR = cNombreCR.substr(cXCR, 1);
					
					if( CCCR == "." )
						cXCR = 0
					else
						cExtensionArchivoCR = CCCR + cExtensionArchivoCR
				}
				
				if ( cNombreCR.indexOf("\\") == -1 )
					cFileNameCR = cNombreCR;
				else
				{
					cFileNameCR = "";
					
					for ( cXCR = cCadenaCR; cXCR > 0; cXCR-- )
					{
						CCCR = cNombreCR.substr(cXCR, 1);
						
						if( CCCR == "\\" )
							cXCR = 0;
						else
							cFileNameCR = CCCR + cFileNameCR;
					}
				}
				
				cExtensionArchivoCR = cExtensionArchivoCR.toLowerCase();
				
				if ( cExtensionArchivoCR != "doc" && 
					cExtensionArchivoCR != "docx" && 
					cExtensionArchivoCR != "xls" && 
					cExtensionArchivoCR != "xlsx" && 
					cExtensionArchivoCR != "ppt" && 
					cExtensionArchivoCR != "pptx" && 
					cExtensionArchivoCR != "pps" && 
					cExtensionArchivoCR != "ppsx" && 
					cExtensionArchivoCR != "pdf" && 
					cExtensionArchivoCR != "jpg" )
				{
					alert("El campo \"Curriculum Vitae\" no es válido.\n\nLos formatos válidos son:\n Microsoft Word\n Microsoft Excel\n Microsoft Powerpoint\n Adobe Acrobat\n Imagenes JPG");
					document.frmCuestionarioAfiliacionCV.cCartaRecomendacion.focus();
					return;
				}
				
				document.frmCuestionarioAfiliacion.cFileNameUploadCR.value = cFileNameCR;
			}
			
			var cURLAction = "xPreRegistro.asp?" + 
				"cFileNameUploadCV=" + document.frmCuestionarioAfiliacion.cFileNameUploadCV.value + 
				"&" + 
				"cFileNameUploadCR=" + document.frmCuestionarioAfiliacion.cFileNameUploadCR.value + 
				"&" + 
				"cTipoPreRegistro=" + document.frmCuestionarioAfiliacion.cTipoPreRegistro.value + 
				"&" + 
				"cSiAfiliado=" + document.frmCuestionarioAfiliacion.cSiAfiliado.value + 
				"&" + 
				"cSiAfiliadoNumero=" + document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value + 
				"&" + 
				"cRFC=" + document.frmCuestionarioAfiliacion.cRFC.value + 
				"&" + 
				"cNombre=" + document.frmCuestionarioAfiliacion.cNombre.value + 
				"&" + 
				"cApellidoP=" + document.frmCuestionarioAfiliacion.cApellidoP.value + 
				"&" + 
				"cApellidoM=" + document.frmCuestionarioAfiliacion.cApellidoM.value + 
				"&" + 
				"cCalle=" + document.frmCuestionarioAfiliacion.cCalle.value + 
				"&" + 
				"cNoExterior=" + document.frmCuestionarioAfiliacion.cNoExterior.value + 
				"&" + 
				"cNoInterior=" + document.frmCuestionarioAfiliacion.cNoInterior.value + 
				"&" + 
				"cEstado=" + document.frmCuestionarioAfiliacion.cEstado.value + 
				"&" + 
				"cMunicipio=" + document.frmCuestionarioAfiliacion.cMunicipio.value + 
				"&" + 
				"cColonia=" + document.frmCuestionarioAfiliacion.cColonia.value + 
				"&" + 
				"cCP=" + document.frmCuestionarioAfiliacion.cCP.value + 
				"&" + 
				"cClaveLargaDI=" + document.frmCuestionarioAfiliacion.cClaveLargaDI.value + 
				"&" + 
				"cClaveLargaD=" + document.frmCuestionarioAfiliacion.cClaveLargaD.value + 
				"&" + 
				"cTelLinea01=" + document.frmCuestionarioAfiliacion.cTelLinea01.value + 
				"&" + 
				"cFax=" + document.frmCuestionarioAfiliacion.cFax.value + 
				"&" + 
				"cTelLinea02=" + document.frmCuestionarioAfiliacion.cTelLinea02.value + 
				"&" + 
				"cEMail=" + document.frmCuestionarioAfiliacion.cEMail.value + 
				"&" + 
				"cEdad=" + document.frmCuestionarioAfiliacion.cEdad.value + 
				"&" + 
				"cSexo=" + document.frmCuestionarioAfiliacion.cSexo.value + 
				"&" + 
				"cEstadoCivil=" + document.frmCuestionarioAfiliacion.cEstadoCivil.value + 
				"&" + 
				"cGradoEstudios=" + document.frmCuestionarioAfiliacion.cGradoEstudios.value + 
				"&" + 
				"cTrabajoEditorial=" + document.frmCuestionarioAfiliacion.cTrabajoEditorial.value + 
				"&" + 
				"cLibreria=" + document.frmCuestionarioAfiliacion.cLibreria.value + 
				"&" + 
				"cFreelance=" + document.frmCuestionarioAfiliacion.cFreelance.value + 
				"&" + 
				"cOtroMedio=" + document.frmCuestionarioAfiliacion.cOtroMedio.value + 
				"&" + 
				"cCual=" + document.frmCuestionarioAfiliacion.cCual.value + 
				"&" + 
				"cPuestoActual=" + document.frmCuestionarioAfiliacion.cPuestoActual.value + 
				"&" + 
				"cEmpresa=" + document.frmCuestionarioAfiliacion.cEmpresa.value + 
				"&" + 
				"cResponsabilidades=" + document.frmCuestionarioAfiliacion.cResponsabilidades.value + 
				"&" + 
				"cPorQueAsistir=" + document.frmCuestionarioAfiliacion.cPorQueAsistir.value + 
				"&" + 
				"cPlanDesarrollo=" + document.frmCuestionarioAfiliacion.cPlanDesarrollo.value + 
				"&" + 
				"cRef01Nombre=" + document.frmCuestionarioAfiliacion.cRef01Nombre.value + 
				"&" + 
				"cRef01Prefesion=" + document.frmCuestionarioAfiliacion.cRef01Prefesion.value + 
				"&" + 
				"cRef01Tiempo=" + document.frmCuestionarioAfiliacion.cRef01Tiempo.value + 
				"&" + 
				"cRef01ClaveLargaDI=" + document.frmCuestionarioAfiliacion.cRef01ClaveLargaDI.value + 
				"&" + 
				"cRef01ClaveLargaD=" + document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.value + 
				"&" + 
				"cRef01Telefono01=" + document.frmCuestionarioAfiliacion.cRef01Telefono01.value + 
				"&" + 
				"cRef02Nombre=" + document.frmCuestionarioAfiliacion.cRef02Nombre.value + 
				"&" + 
				"cRef02Prefesion=" + document.frmCuestionarioAfiliacion.cRef02Prefesion.value + 
				"&" + 
				"cRef02Tiempo=" + document.frmCuestionarioAfiliacion.cRef02Tiempo.value + 
				"&" + 
				"cRef02ClaveLargaDI=" + document.frmCuestionarioAfiliacion.cRef02ClaveLargaDI.value + 
				"&" + 
				"cRef02ClaveLargaD=" + document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.value + 
				"&" + 
				"cRef02Telefono01=" + document.frmCuestionarioAfiliacion.cRef02Telefono01.value + 
				"&" + 
				"cRef03Nombre=" + document.frmCuestionarioAfiliacion.cRef03Nombre.value + 
				"&" + 
				"cRef03Prefesion=" + document.frmCuestionarioAfiliacion.cRef03Prefesion.value + 
				"&" + 
				"cRef03Tiempo=" + document.frmCuestionarioAfiliacion.cRef03Tiempo.value + 
				"&" + 
				"cRef03ClaveLargaDI=" + document.frmCuestionarioAfiliacion.cRef03ClaveLargaDI.value + 
				"&" + 
				"cRef03ClaveLargaD=" + document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.value + 
				"&" + 
				"cRef03Telefono01=" + document.frmCuestionarioAfiliacion.cRef03Telefono01.value + 
				"";
			
			document.frmCuestionarioAfiliacionCV.action = cURLAction;
			document.frmCuestionarioAfiliacionCV.submit();
		}
		else if ( document.frmCuestionarioAfiliacion.cImprimir.value == "1" )
		{
			alert("Imprimir")
			return
			
			window.print();
		}
	}
	else
		fncDatosInvalidos(cCampoOpcion, oCampoNombre);
}

function fncBuscaNoSocioCursos()
{
	var bValidar = false;
	
	if ( ( fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value ) != "" && fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.value ) != "" ) || ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) != "" ) )
		bValidar = true;
	
	if ( bValidar == true )
	{
		xmlHttpSQLNoSocio = GetXmlHttpObject();
		
		if ( xmlHttpSQLNoSocio == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axNoSocioCursos.asp" + 
			"?" + 
			"cUsuario=" + document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value + 
			"&" + 
			"cPassword=" + document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.value + 
			"&" + 
			"cRFC=" + document.frmCuestionarioAfiliacion.cRFC.value + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		xmlHttpSQLNoSocio.onreadystatechange = fncAjaxCargaSQLNoSocioCursos;
		xmlHttpSQLNoSocio.open("GET", cUrl, true);
		xmlHttpSQLNoSocio.send(null);
	}
	else
	{
		alert("Para realizar la búsqueda debé ingresar:\n\n - Número de afiliado y Contraseña\nó\n - RFC");
		return;
	}
}

function fncAjaxCargaSQLNoSocioCursos()
{
	if (xmlHttpSQLNoSocio.readyState == 4)
	{
		if ( xmlHttpSQLNoSocio.status == 200 )
		{
			if ( xmlHttpSQLNoSocio.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLNoSocio.responseXML.documentElement;
				
				if ( xmlResponse.getElementsByTagName("cValido")[0].childNodes[0].nodeValue == 0 )
				{
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
					document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
					document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
				}
				else
				{
					document.frmCuestionarioAfiliacion.cSiAfiliado.disabled = true;
					document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.disabled = true;
					document.frmCuestionarioAfiliacion.cBuscarNoSocio.disabled = true;
					
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.disabled = true;
					if ( xmlResponse.getElementsByTagName("cUsuario")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = xmlResponse.getElementsByTagName("cUsuario")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRFC.disabled = true;
					if ( xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cRFC.value = xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0].nodeValue;
					
					if ( xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cNombre.disabled = true;
							document.frmCuestionarioAfiliacion.cNombre.value = xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0].nodeValue;
						}
					}
					
					if ( xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cApellidoP.disabled = true;
							document.frmCuestionarioAfiliacion.cApellidoP.value = xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0].nodeValue;
						}
					}
					
					if ( xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cApellidoM.disabled = true;
							document.frmCuestionarioAfiliacion.cApellidoM.value = xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0].nodeValue;
						}
					}
					
					document.frmCuestionarioAfiliacion.cCalle.disabled = true;
					if ( xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCalle.value = xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cNoExterior.disabled = true;
					if ( xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoExterior.value = xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cNoInterior.disabled = true;
					if ( xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoInterior.value = xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cEstado.disabled = true;
					if ( xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEstado.value = xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cMunicipio.disabled = true;
					if ( xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cMunicipio.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cMunicipio.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
					}
					
					document.frmCuestionarioAfiliacion.cColonia.disabled = true;
					if ( xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cColonia.value = xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cCP.disabled = true;
					if ( xmlResponse.getElementsByTagName("cCP")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCP.value = xmlResponse.getElementsByTagName("cCP")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cClaveLargaDI.disabled = true;
					if ( xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cClaveLargaDI.value = xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cClaveLargaD.disabled = true;
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					
					document.frmCuestionarioAfiliacion.cTelLinea01.disabled = true;
					if ( xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea01.value = xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cTelLinea02.disabled = true;
					if ( xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea02.value = xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cFax.disabled = true;
					if ( xmlResponse.getElementsByTagName("cFax")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFax.value = xmlResponse.getElementsByTagName("cFax")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.bNoAfiliadoValido.value = 1;
					
					var cXI = 0;
					while ( cXI < document.frmCuestionarioAfiliacion.length )
					{
						fncPintaDatosInvalidos(document.frmCuestionarioAfiliacion[cXI], true)
						cXI = cXI + 1;
					}
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
				document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
				document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
			document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
			document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
		}
	}
}

function fncBuscaNoSocioCursosEspeciales()
{
	var bValidar = false;
	
	if ( ( fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value ) != "" && fncTrim( document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.value ) != "" ) || ( fncTrim( document.frmCuestionarioAfiliacion.cRFC.value ) != "" ) )
		bValidar = true;
	
	if ( bValidar == true )
	{
		xmlHttpSQLNoSocio = GetXmlHttpObject();
		
		if ( xmlHttpSQLNoSocio == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axNoSocioCursos.asp" + 
			"?" + 
			"cUsuario=" + document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value + 
			"&" + 
			"cPassword=" + document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.value + 
			"&" + 
			"cRFC=" + document.frmCuestionarioAfiliacion.cRFC.value + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		xmlHttpSQLNoSocio.onreadystatechange = fncAjaxCargaSQLNoSocioCursosEspeciales;
		xmlHttpSQLNoSocio.open("GET", cUrl, true);
		xmlHttpSQLNoSocio.send(null);
	}
	else
	{
		alert("Para realizar la búsqueda debé ingresar:\n\n - Número de afiliado y Contraseña\nó\n - RFC");
		return;
	}
}

function fncAjaxCargaSQLNoSocioCursosEspeciales()
{
	if (xmlHttpSQLNoSocio.readyState == 4)
	{
		if ( xmlHttpSQLNoSocio.status == 200 )
		{
			if ( xmlHttpSQLNoSocio.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLNoSocio.responseXML.documentElement;
				
				if ( xmlResponse.getElementsByTagName("cValido")[0].childNodes[0].nodeValue == 0 )
				{
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
					document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
					document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
				}
				else
				{
					document.frmCuestionarioAfiliacion.cSiAfiliado.disabled = true;
					document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.disabled = true;
					document.frmCuestionarioAfiliacion.cBuscarNoSocio.disabled = true;
					
					document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.disabled = true;
					if ( xmlResponse.getElementsByTagName("cUsuario")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = xmlResponse.getElementsByTagName("cUsuario")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cRFC.disabled = true;
					if ( xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cRFC.value = xmlResponse.getElementsByTagName("cRFC")[0].childNodes[0].nodeValue;
					
					if ( xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cNombre.disabled = true;
							document.frmCuestionarioAfiliacion.cNombre.value = xmlResponse.getElementsByTagName("cNombre")[0].childNodes[0].nodeValue;
						}
					}
					
					if ( xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cApellidoP.disabled = true;
							document.frmCuestionarioAfiliacion.cApellidoP.value = xmlResponse.getElementsByTagName("cApellidoP")[0].childNodes[0].nodeValue;
						}
					}
					
					if ( xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0] ) 
					{
						if ( xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0].nodeValue != "" )
						{
							document.frmCuestionarioAfiliacion.cApellidoM.disabled = true;
							document.frmCuestionarioAfiliacion.cApellidoM.value = xmlResponse.getElementsByTagName("cApellidoM")[0].childNodes[0].nodeValue;
						}
					}
					
					document.frmCuestionarioAfiliacion.cCalle.disabled = true;
					if ( xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCalle.value = xmlResponse.getElementsByTagName("cCalle")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cNoExterior.disabled = true;
					if ( xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoExterior.value = xmlResponse.getElementsByTagName("cNoExterior")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cNoInterior.disabled = true;
					if ( xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cNoInterior.value = xmlResponse.getElementsByTagName("cNoInterior")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cEstado.disabled = true;
					if ( xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cEstado.value = xmlResponse.getElementsByTagName("cEstado")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cMunicipio.disabled = true;
					if ( xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cMunicipio.options[ document.frmCuestionarioAfiliacion.cMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cMunicipio.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cMunicipio.value = xmlResponse.getElementsByTagName("cMunicipio")[0].childNodes[0].nodeValue;
					}
					
					document.frmCuestionarioAfiliacion.cColonia.disabled = true;
					if ( xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cColonia.value = xmlResponse.getElementsByTagName("cColonia")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cCP.disabled = true;
					if ( xmlResponse.getElementsByTagName("cCP")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cCP.value = xmlResponse.getElementsByTagName("cCP")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cClaveLargaDI.disabled = true;
					if ( xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cClaveLargaDI.value = xmlResponse.getElementsByTagName("cClaveLargaDI")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cClaveLargaD.disabled = true;
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cClaveLargaD.options[ document.frmCuestionarioAfiliacion.cClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cRef01ClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cRef02ClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					
					if ( xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0] )
					{
						document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options[ document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.length ] = new Option(xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue);
						//var oSelect = document.createElement("OPTION");
						//document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.options.add(oSelect, 0);
						//oSelect.innerText = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						//oSelect.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
						document.frmCuestionarioAfiliacion.cRef03ClaveLargaD.value = xmlResponse.getElementsByTagName("cClaveLargaD")[0].childNodes[0].nodeValue;
					}
					
					document.frmCuestionarioAfiliacion.cTelLinea01.disabled = true;
					if ( xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea01.value = xmlResponse.getElementsByTagName("cTelLinea01")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cTelLinea02.disabled = true;
					if ( xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cTelLinea02.value = xmlResponse.getElementsByTagName("cTelLinea02")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.cFax.disabled = true;
					if ( xmlResponse.getElementsByTagName("cFax")[0].childNodes[0] ) document.frmCuestionarioAfiliacion.cFax.value = xmlResponse.getElementsByTagName("cFax")[0].childNodes[0].nodeValue;
					
					document.frmCuestionarioAfiliacion.bNoAfiliadoValido.value = 1;
					
					fncCartaRecomendacion(document.frmCuestionarioAfiliacion.cEstado);
					
					var cXI = 0;
					while ( cXI < document.frmCuestionarioAfiliacion.length )
					{
						fncPintaDatosInvalidos(document.frmCuestionarioAfiliacion[cXI], true)
						cXI = cXI + 1;
					}
				}
			}
			else
			{
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
				document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
				document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
				document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
			}
		}
		else
		{
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.value = "No existe información.";
			document.frmCuestionarioAfiliacion.cSiAfiliadoNumero.style.color = "#CC0000";
			document.frmCuestionarioAfiliacion.cSiAfiliadoPassword.style.color = "#CC0000";
			document.frmCuestionarioAfiliacion.cRFC.style.color = "#CC0000";
		}
	}
}

function fncValidaPreRegistro()
{
	if ( fncTrim(document.frmCuestionarioAfiliacion.cNombres.value) == "" )
	{
		alert("El campo \"Nombre\" no es válido.");
		document.frmCuestionarioAfiliacion.cNombres.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cNombres.value = fncTrim(document.frmCuestionarioAfiliacion.cNombres.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cApellidoP.value) == "" )
	{
		alert("El campo \"Apellido Paterno\" no es válido.");
		document.frmCuestionarioAfiliacion.cApellidoP.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoP.value = fncTrim(document.frmCuestionarioAfiliacion.cApellidoP.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cApellidoM.value) == "" )
	{
		alert("El campo \"Apellido Materno\" no es válido.");
		document.frmCuestionarioAfiliacion.cApellidoM.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cApellidoM.value = fncTrim(document.frmCuestionarioAfiliacion.cApellidoM.value);
	
	if ( document.frmCuestionarioAfiliacion.cSexo.value == "" )
	{
		alert("El campo \"Sexo\" no es válido.");
		document.frmCuestionarioAfiliacion.cSexo.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaNacimientoD.value == "" )
	{
		alert("El campo \"Día de Nacimiento\" no es válido.");
		document.frmCuestionarioAfiliacion.cFechaNacimientoD.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaNacimientoM.value == "" )
	{
		alert("El campo \"Mes de Nacimiento\" no es válido.");
		document.frmCuestionarioAfiliacion.cFechaNacimientoM.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cFechaNacimientoA.value == "" )
	{
		alert("El campo \"Año de Nacimiento\" no es válido.");
		document.frmCuestionarioAfiliacion.cFechaNacimientoA.focus();
		return;
	}
	
	if ( fncValidaFecha(document.frmCuestionarioAfiliacion.cFechaNacimientoD, document.frmCuestionarioAfiliacion.cFechaNacimientoM, document.frmCuestionarioAfiliacion.cFechaNacimientoA) == false )
	{
		alert("El campo \"Fecha de Nacimiento\" no es válido.");
		document.frmCuestionarioAfiliacion.cFechaNacimientoD.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cFechaNacimiento.value = "" + 
			fncLenString(document.frmCuestionarioAfiliacion.cFechaNacimientoA.value, 4, "0") + 
			fncLenString(document.frmCuestionarioAfiliacion.cFechaNacimientoM.value, 2, "0") + 
			fncLenString(document.frmCuestionarioAfiliacion.cFechaNacimientoD.value, 2, "0");
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cNombreComercial.value) == "" )
	{
		alert("El campo \"Nombre de la Empresa\" no es válido.");
		document.frmCuestionarioAfiliacion.cNombreComercial.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cNombreComercial.value = fncTrim(document.frmCuestionarioAfiliacion.cNombreComercial.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cCalle.value) == "" )
	{
		alert("El campo \"Domicilio\" no es válido.");
		document.frmCuestionarioAfiliacion.cCalle.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cCalle.value = fncTrim(document.frmCuestionarioAfiliacion.cCalle.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cNoExterior.value) == "" )
	{
		alert("El campo \"No Exterior\" no es válido.");
		document.frmCuestionarioAfiliacion.cNoExterior.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cNoExterior.value = fncTrim(document.frmCuestionarioAfiliacion.cNoExterior.value);
	
	if ( document.frmCuestionarioAfiliacion.cEstado.value == "" )
	{
		alert("El campo \"Entidad Federativa\" no es válido.");
		document.frmCuestionarioAfiliacion.cEstado.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cMunicipio.value == "" )
	{
		alert("El campo \"Delegación o Municipio\" no es válido.");
		document.frmCuestionarioAfiliacion.cMunicipio.focus();
		return;
	}
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cColonia.value) == "" )
	{
		alert("El campo \"Colonia\" no es válido.");
		document.frmCuestionarioAfiliacion.cColonia.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cColonia.value = fncTrim(document.frmCuestionarioAfiliacion.cColonia.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cCP.value) == "" )
	{
		alert("El campo \"Codigo Postal\" no es válido.");
		document.frmCuestionarioAfiliacion.cCP.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cCP.value = fncTrim(document.frmCuestionarioAfiliacion.cCP.value);
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaDI.value == "" )
	{
		alert("El campo \"Clave Internacional\" no es válido.");
		document.frmCuestionarioAfiliacion.cClaveLargaDI.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cClaveLargaD.value == "" )
	{
		alert("El campo \"Clave Larga Distancia\" no es válido.");
		document.frmCuestionarioAfiliacion.cClaveLargaD.focus();
		return;
	}
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cTelLinea01.value) == "" )
	{
		alert("El campo \"Teléfonos\" no es válido.");
		document.frmCuestionarioAfiliacion.cTelLinea01.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cTelLinea01.value = fncTrim(document.frmCuestionarioAfiliacion.cTelLinea01.value);
	
	if ( fncTrim(document.frmCuestionarioAfiliacion.cEMail.value) == "" )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmCuestionarioAfiliacion.cEMail.focus();
		return;
	}
	else if ( fncEsEmail(document.frmCuestionarioAfiliacion.cEMail.value) == false )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmCuestionarioAfiliacion.cEMail.focus();
		return;
	}
	else
		document.frmCuestionarioAfiliacion.cEMail.value = fncTrim(document.frmCuestionarioAfiliacion.cEMail.value);
	
	if ( document.frmCuestionarioAfiliacion.cComoEnteraron.value == "" )
	{
		alert("El campo \"¿Como supo de nosotros?\" no es válido.");
		document.frmCuestionarioAfiliacion.cComoEnteraron.focus();
		return;
	}
	
	if ( document.frmCuestionarioAfiliacion.cComentariosAltaAfiliacion.value.length > 800 )
	{
		alert("El campo \"Aclaración o comentario\" no es válido. Debe ser máximo de 800 caracteres.");
		document.frmCuestionarioAfiliacion.cComentariosAltaAfiliacion.focus();
		return;
	}
	
	document.frmCuestionarioAfiliacion.action = "xRegistro.asp";
	document.frmCuestionarioAfiliacion.submit();
}

function fncContactoOcupacionDiplomado( cTipoOcupacion )
{
	document.frmFormaDiplomado.cOcupacion1.value = "";
	document.frmFormaDiplomado.cOcupacion2.value = "";
	
	if ( cTipoOcupacion.value == "1" )
	{
		document.frmFormaDiplomado.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOn";
		document.frmFormaDiplomado.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
	}
	else if ( cTipoOcupacion.value == "2" )
	{
		document.frmFormaDiplomado.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
		document.frmFormaDiplomado.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOn";
	}
	else
	{
		document.frmFormaDiplomado.cOcupacion1.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
		document.frmFormaDiplomado.cOcupacion2.className = "CWidthAfiliacionCajasChi CTDAfiliacionCajas CInputFocusOff";
	}
}

function fncContactoEstadoDiplomado( cEstado )
{
	if ( cEstado.value == "XXEXTXX" )
	{
		document.frmFormaDiplomado.cExtranjero.className = "CWidthAfiliacionCajasMed CTDAfiliacionCajas CInputFocusOn";
	}
	else
	{
		document.frmFormaDiplomado.cExtranjero.className = "CWidthAfiliacionCajasMed CTDAfiliacionCajas CInputFocusOff";
	}
}

function fncValidaFormaDiplomado()
{
	if ( document.frmFormaDiplomado.cRangoEdades.value == "" )
	{
		alert("El campo \"Rango de Edad\" no es válido.");
		document.frmFormaDiplomado.cRangoEdades.focus();
		return;
	}
	
	if ( document.frmFormaDiplomado.cGenero.value == "" )
	{
		alert("El campo \"Género\" no es válido.");
		document.frmFormaDiplomado.cGenero.focus();
		return;
	}
	
	if ( fncTrim(document.frmFormaDiplomado.cEMail.value) == "" )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmFormaDiplomado.cEMail.focus();
		return;
	}
	else if ( fncEsEmail(document.frmFormaDiplomado.cEMail.value) == false )
	{
		alert("El campo \"Correo electrónico\" no es válido.");
		document.frmFormaDiplomado.cEMail.focus();
		return;
	}
	
	if ( document.frmFormaDiplomado.cTipoOcupacion.value == "" )
	{
		alert("El campo \"Ocupación\" no es válido.");
		document.frmFormaDiplomado.cTipoOcupacion.focus();
		return;
	}
	else
	{
		var cTipoOcupacion = document.frmFormaDiplomado.cTipoOcupacion.value;
		var oTipoOcupacion = "document.frmFormaDiplomado.cOcupacion" + cTipoOcupacion;
		oTipoOcupacion = eval(oTipoOcupacion);
		
		if ( oTipoOcupacion.value == "" )
		{
			alert("El campo \"Ocupación\" no es válido.");
			oTipoOcupacion.focus();
			return;
		}
	}
	
	if ( document.frmFormaDiplomado.cEstado.value == "" )
	{
		alert("El campo ¿De dónde nos visita? no es válido.");
		document.frmFormaDiplomado.cEstado.focus();
		return;
	}
	else if ( document.frmFormaDiplomado.cEstado.value == "XXEXTXX" && fncTrim(document.frmFormaDiplomado.cExtranjero.value) == "" )
	{
		alert("El campo ¿De dónde nos visita? no es válido.");
		document.frmFormaDiplomado.cExtranjero.focus();
		return;
	}
	
	if ( document.frmUploadDiplomado.cCV.value == "" )
	{
		alert("El campo \"Curriculum Vitae\" no es válido.");
		document.frmUploadDiplomado.cCV.focus();
		return;
	}
	
	var cFileName;
	var CC;
	var cX;
	var cNombre = document.frmUploadDiplomado.cCV.value;
	var cCadena = cNombre.length;
	var cExtensionArchivo = "";
	
	for ( cX = cCadena; cX > 0; cX-- )
	{
		CC = cNombre.substr(cX, 1);
		
		if( CC == "." )
			cX = 0
		else
			cExtensionArchivo = CC + cExtensionArchivo
	}
	
	if ( cNombre.indexOf("\\") == -1 )
		cFileName = cNombre;
	else
	{
		cFileName = "";
		
		for ( cX = cCadena; cX > 0; cX-- )
		{
			CC = cNombre.substr(cX, 1);
			
			if( CC == "\\" )
				cX = 0;
			else
				cFileName = CC + cFileName;
		}
	}
	
	cExtensionArchivo = cExtensionArchivo.toLowerCase();
	
	if ( cExtensionArchivo != "doc" && 
		cExtensionArchivo != "docx" && 
		cExtensionArchivo != "xls" && 
		cExtensionArchivo != "xlsx" && 
		cExtensionArchivo != "ppt" && 
		cExtensionArchivo != "pptx" && 
		cExtensionArchivo != "pps" && 
		cExtensionArchivo != "ppsx" && 
		cExtensionArchivo != "pdf" && 
		cExtensionArchivo != "jpg" )
	{
		alert("El campo \"Curriculum Vitae\" no es válido.\n\nLos formatos válidos son:\n Microsoft Word\n Microsoft Excel\n Microsoft Powerpoint\n Adobe Acrobat\n Imagenes JPG");
		document.frmUploadDiplomado.cCV.focus();
		return;
	}
	
	document.frmFormaDiplomado.cFileNameUpload.value = cFileName;
	
	var cURLAction = "xDiplomado.asp?" + 
		"cFileNameUpload=" + document.frmFormaDiplomado.cFileNameUpload.value + 
		"&" + 
		"cRangoEdades=" + document.frmFormaDiplomado.cRangoEdades.value + 
		"&" + 
		"cGenero=" + document.frmFormaDiplomado.cGenero.value + 
		"&" + 
		"cEMail=" + document.frmFormaDiplomado.cEMail.value + 
		"&" + 
		"cTipoOcupacion=" + document.frmFormaDiplomado.cTipoOcupacion.value + 
		"&" + 
		"cOcupacion1=" + document.frmFormaDiplomado.cOcupacion1.value + 
		"&" + 
		"cOcupacion2=" + document.frmFormaDiplomado.cOcupacion2.value + 
		"&" + 
		"cEstado=" + document.frmFormaDiplomado.cEstado.value + 
		"&" + 
		"cExtranjero=" + document.frmFormaDiplomado.cExtranjero.value + 
		"";
	
	document.frmUploadDiplomado.action = cURLAction;
	document.frmUploadDiplomado.submit();
}

function fncCargaCursos( cAnio, cMes, bEspeciales )
{
	document.getElementById("tdCursosDescripcion").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='100' height='100'><tr><td align='center' valign='middle' bgcolor='FFFFFF'><img src='images/cargando_l.gif' width='100' height='81' border='0'></td></tr></table>";
	
	cAnioActual = cAnio;
	cMesActual = cMes;
	
	switch( cMes )
	{
		case 1:
			document.getElementById("tdCursosMes").innerHTML = "Enero";
			break;
		case 2:
			document.getElementById("tdCursosMes").innerHTML = "Febrero";
			break;
		case 3:
			document.getElementById("tdCursosMes").innerHTML = "Marzo";
			break;
		case 4:
			document.getElementById("tdCursosMes").innerHTML = "Abril";
			break;
		case 5:
			document.getElementById("tdCursosMes").innerHTML = "Mayo";
			break;
		case 6:
			document.getElementById("tdCursosMes").innerHTML = "Junio";
			break;
		case 7:
			document.getElementById("tdCursosMes").innerHTML = "Julio";
			break;
		case 8:
			document.getElementById("tdCursosMes").innerHTML = "Agosto";
			break;
		case 9:
			document.getElementById("tdCursosMes").innerHTML = "Septiembre";
			break;
		case 10:
			document.getElementById("tdCursosMes").innerHTML = "Octubre";
			break;
		case 11:
			document.getElementById("tdCursosMes").innerHTML = "Noviembre";
			break;
		case 12:
			document.getElementById("tdCursosMes").innerHTML = "Diciembre";
			break;
	}
	
	//Cursos
	xmlHttpCalendario = GetXmlHttpObject();
	
	if ( xmlHttpCalendario == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axCursos.asp" + 
		"?" + 
		"cMes=" + cMesActual + 
		"&" + 
		"cAnio=" + cAnioActual + 
		"&" + 
		"bEspeciales=" + bEspeciales + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpCalendario.onreadystatechange = fncAjaxCargaCursos;
	xmlHttpCalendario.open("GET", cUrl, true);
	xmlHttpCalendario.send(null);
}

function fncAjaxCargaCursos()
{
	if (xmlHttpCalendario.readyState == 4)
	{
		if ( xmlHttpCalendario.status == 200 )
		{
			if ( xmlHttpCalendario.responseText != "ERROR" )
			{
				document.getElementById("tdCursosDescripcion").innerHTML = xmlHttpCalendario.responseText;
			}
			else
				document.getElementById("tdCursosDescripcion").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (1)</span>";
		}
		else
			document.getElementById("tdCursosDescripcion").innerHTML = "<span class='CTdCalendarioError'>Error Calendario (2)</span>";
	}
}

function fncCursosCambioMes( cAccion, bEspeciales )
{
	if ( cAccion == "+" )
	{
		cMesActual = cMesActual + 1;
		
		if ( cMesActual > 12 )
		{
			cMesActual = 1;
			cAnioActual = cAnioActual + 1;
		}
	}
	else if ( cAccion == "-" )
	{
		cMesActual = cMesActual - 1;
		
		if ( cMesActual < 1 )
		{
			cMesActual = 12;
			cAnioActual = cAnioActual - 1;
		}
	}
	
	fncCargaCursos( cAnioActual, cMesActual, bEspeciales );
}

function fncCursosMedidaCambioNivel( oObjTD )
{
	if ( oObjTD.value == "Otro" )
	{
		document.getElementById("tdNivelEspecificar").style.display = "";
		document.getElementById("tdNivelEspecificar01").style.display = "";
	}
	else
	{
		document.getElementById("tdNivelEspecificar").style.display = "none";
		document.getElementById("tdNivelEspecificar01").style.display = "none";
	}
}

function fncMenuTableOver( cMenu )
{
	if ( document.getElementById("Izq" + cMenu) )
		document.getElementById("Izq" + cMenu).className = "TDMenuIzqOver"
	if ( document.getElementById("Cen" + cMenu) )
		document.getElementById("Cen" + cMenu).className = "TDMenuCenOver"
	if ( document.getElementById("Cen01" + cMenu) )
		document.getElementById("Cen01" + cMenu).className = "TDMenuCenOver"
	if ( document.getElementById("Cen02" + cMenu) )
		document.getElementById("Cen02" + cMenu).className = "TDMenuCenOver"
	if ( document.getElementById("Der" + cMenu) )
		document.getElementById("Der" + cMenu).className = "TDMenuDerOver"
}

function fncMenuTableOut( cMenu )
{
	if ( document.getElementById("Izq" + cMenu) )
		document.getElementById("Izq" + cMenu).className = "TDMenuIzq"
	if ( document.getElementById("Cen" + cMenu) )
		document.getElementById("Cen" + cMenu).className = "TDMenuCen"
	if ( document.getElementById("Cen01" + cMenu) )
		document.getElementById("Cen01" + cMenu).className = "TDMenuCen"
	if ( document.getElementById("Cen02" + cMenu) )
		document.getElementById("Cen02" + cMenu).className = "TDMenuCen"
	if ( document.getElementById("Der" + cMenu) )
		document.getElementById("Der" + cMenu).className = "TDMenuDer"
}

function fncDifusionCatalogo()
{
	fncDifusionContenido( "DDifusionContenido", 1, 0, "", 0 );
}

function fncDifusionContacto()
{
	fncDifusionContenido( "DDifusionContenido", 2, 0, "", 0 );
}

function fncDifusionUbicacion()
{
	var cHTML = "";
	
	if ( document.getElementById("DDifusionContenido") )
		document.getElementById("DDifusionContenido").innerHTML = "<center><img src=\"" + cSvrPath + "images/imgBibliotecaLoader.gif\" width=\"66\" height=\"66\" border=\"0\"></center>";
	
	cHTML = "" + 
		"<table border='0' bordercolor='red' cellspacing='0' cellpadding='0' width='100%' height='100%'>" + 
			"<tr>" + 
				"<td valign='middle' align='center'>" + 
					"<div id='dMyMap' style='position:relative; width:448px; height:300px;'></div>" + 
				"</td>" + 
			"</tr>" + 
		"</table>" + 
		"";
	
	if ( document.getElementById("DDifusionContenido") )
		document.getElementById("DDifusionContenido").innerHTML = cHTML;
	
	GetMap(1);
}

function fncDifusionContenido( oDivContenido, cId, cPage, cYear, cExtra )
{
	if ( cYear == "" )
	{
		var oDate = new Date();
		var cDate = oDate.getYear();
		cDate = cDate + "";
		
		if ( cDate.length == 3 )
			cDate = "20" + cDate.substring(1);
		
		cYear = cDate;
	}
	
	if ( cId == 0 || cId == 1 || cId == 2 || cId == 3 )
	{
		if ( document.getElementById(oDivContenido) )
			document.getElementById(oDivContenido).innerHTML = "<center><img src=\"" + cSvrPath + "images/imgBibliotecaLoader.gif\" width=\"66\" height=\"66\" border=\"0\"></center>";
	}
	else
	{
		if ( document.getElementById(oDivContenido) )
			document.getElementById(oDivContenido).innerHTML = "<center><img src=\"" + cSvrPath + "images/imgDifusionLoader.gif\" width=\"66\" height=\"66\" border=\"0\"></center>";
	}	
	
	xmlHttpDifusionContenido = GetXmlHttpObject();
	
	if ( xmlHttpDifusionContenido == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axDifusion.asp" + 
		"?" + 
		"cDiv=" + oDivContenido + 
		"&" + 
		"cId=" + cId + 
		"&" + 
		"cYear=" + cYear + 
		"&" + 
		"cPage=" + cPage + 
		"&" + 
		"cExtra=" + cExtra + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpDifusionContenido.onreadystatechange = fncAJAXDifusionContenido;
	xmlHttpDifusionContenido.open("GET", cUrl, true);
	xmlHttpDifusionContenido.send(null);
}

function fncAJAXDifusionContenido()
{
	if (xmlHttpDifusionContenido.readyState == 4)
	{
		if ( xmlHttpDifusionContenido.status == 200 )
		{
			var cResponseAjax = xmlHttpDifusionContenido.responseText;
			var arrayResponse;
			var cDiv = "";
			var cResponse = "";
			
			if ( cResponseAjax.substring(0, 3) != "ERR" )
			{
				arrayResponse = cResponseAjax.split("|||||");
				document.getElementById(arrayResponse[0]).innerHTML = arrayResponse[1];
			}
			else
			{
				arrayResponse = cResponseAjax.split("|||||");
				document.getElementById(arrayResponse[1]).innerHTML = "<span class='CTdCalendarioError'>" + arrayResponse[0] + "</span>";
			}
		}
	}
}

function fncAbreBoletines(cTotalSecciones, cIdSeccion)
{
	var cX = 0;
	var arraySecciones = cTotalSecciones.split("||");
	
	var arrayImage = document.getElementById("imgMasMenos" + cIdSeccion).src.split("/")
	
	if ( arrayImage[arrayImage.length - 1] == "btnMasD.png" )
	{
		document.getElementById("imgMasMenos" + cIdSeccion).src = cSvrPath + "images/btnMenosD.png";
		
		while ( cX < arraySecciones.length )
		{
			if ( arraySecciones[cX] != "" )
			{
				document.getElementById("TRSeccion" + arraySecciones[cX]).style.display = "none";
				document.getElementById("TBLSeccion" + arraySecciones[cX]).style.display = "none";
			}
			
			cX = cX + 1;
		}
	
		document.getElementById("TRSeccion" + cIdSeccion).style.display = "";
		document.getElementById("TBLSeccion" + cIdSeccion).style.display = "";
	}
	else
	{
		document.getElementById("imgMasMenos" + cIdSeccion).src = cSvrPath + "images/btnMasD.png";
		
		while ( cX < arraySecciones.length )
		{
			if ( arraySecciones[cX] != "" )
			{
				document.getElementById("TRSeccion" + arraySecciones[cX]).style.display = "";
				document.getElementById("TBLSeccion" + arraySecciones[cX]).style.display = "none";
			}
			
			cX = cX + 1;
		}
	}
}

function fncValidaSuscripcion()
{
	document.frmSuscripcionRevista.action = "xSuscripcion.asp";
	document.frmSuscripcionRevista.submit();
}

function fncSuscripcionChangeEstados( cIdEstado )
{
	fncSuscripcionConsultaMunicipios(cIdEstado);
}

function fncSuscripcionConsultaMunicipios( cIdEstado )
{
	while ( document.frmSuscripcionRevista.cMunicipio.options.length > 0 )
		document.frmSuscripcionRevista.cMunicipio.options[0] = null;
	
	if ( cIdEstado.value != "" )
	{
		xmlHttpSQLMunicipios = GetXmlHttpObject();
		
		if ( xmlHttpSQLMunicipios == null )
		{
			alert (cAJAXNoValido);
			return;
		}
			
		var cUrl = "axMunicipios.asp" + 
			"?" + 
			"cIdEstado=" + cIdEstado.value + 
			"&" + 
			"cIdRandom=" + Math.random();
			
		xmlHttpSQLMunicipios.onreadystatechange = fncAjaxCargaSQLSuscripcionMunicipios;
		xmlHttpSQLMunicipios.open("GET", cUrl, true);
		xmlHttpSQLMunicipios.send(null);
	}
}

function fncAjaxCargaSQLSuscripcionMunicipios()
{
	if (xmlHttpSQLMunicipios.readyState == 4)
	{
		if ( xmlHttpSQLMunicipios.status == 200 )
		{
			if ( xmlHttpSQLMunicipios.responseXML.documentElement != null )
			{
				var xmlResponse = xmlHttpSQLMunicipios.responseXML.documentElement;
				
				document.frmSuscripcionRevista.cMunicipio.options[ document.frmSuscripcionRevista.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				//var oOption = document.createElement("OPTION");
				//document.frmSuscripcionRevista.cMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
				
				var cX = 0;
				while ( cX < xmlResponse.getElementsByTagName("cMunicipio").length )
				{
					document.frmSuscripcionRevista.cMunicipio.options[ document.frmSuscripcionRevista.cMunicipio.options.length ] = new Option(xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue, xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue);
					//var oOption = document.createElement("OPTION");
					//document.frmSuscripcionRevista.cMunicipio.options.add(oOption);
					//oOption.innerText = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[1].childNodes[0].nodeValue;
					//oOption.value = xmlResponse.getElementsByTagName("cMunicipio")[cX].childNodes[0].childNodes[0].nodeValue;
					
					cX = cX + 1;
				}
			}
			else
			{
				document.frmSuscripcionRevista.cMunicipio.options[ document.frmSuscripcionRevista.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
				//var oOption = document.createElement("OPTION");
				//document.frmSuscripcionRevista.cMunicipio.options.add(oOption);
				//oOption.innerText = "Seleccione un Municipio";
				//oOption.value = "";
			}
		}
		else
		{
			document.frmSuscripcionRevista.cMunicipio.options[ document.frmSuscripcionRevista.cMunicipio.options.length ] = new Option("Seleccione un Municipio", "");
			//var oOption = document.createElement("OPTION");
			//document.frmSuscripcionRevista.cMunicipio.options.add(oOption);
			//oOption.innerText = "Seleccione un Municipio";
			//oOption.value = "";
		}
	}
}

function fncVerNoticia( cIdSeccion, cIdItem )
{
	document.frmSeccion.IS.value = cIdSeccion;
	document.frmSeccion.IT.value = cIdItem;
	document.frmSeccion.submit();
}

function fncNoticiasFeriasClick( cUrl, cIT )
{
	document.frmMenusIT.IT.value = cIT;
	document.frmMenusIT.action = cUrl;
	document.frmMenusIT.submit();
}

function fncNoticiasFeriasOver( oSrc, cOpc )
{
	if ( cOpc == 1 )
		oSrc.className = "CNoticiasFeriasOn";
	else
		oSrc.className = "CNoticiasFerias";
}

function fncIrNoticia( cId, cIB )
{
	document.frmMenusIT.IT.value = cId;
	document.frmMenusIT.IB.value = cIB;
	document.frmMenusIT.action = "noticia.asp";
	document.frmMenusIT.submit();
}

function fncClickVotar( cTipo )
{
	document.frmEncuesta.cTipoAccion.value = cTipo
}

function fncValidarEncuesta()
{
	if ( document.getElementById("tbDivEncuesta") )
	{
		if ( document.frmEncuesta.cTipoAccion.value == 1 )
		{
			var oFPregunta = document.frmEncuesta.rdRespuesta;
			var nCont = 4;
			var fChecked = false;
			
			for ( nCont = 0; oFPregunta.length > nCont ; nCont++ )
			{
				if ( oFPregunta[nCont].checked == true ) 
				{
					fChecked = true;
					break;
				}
			}
			
			if ( fChecked == true )
			{
				var cIdEncuesta = document.frmEncuesta.cIdEncuesta.value;
				
				document.getElementById("tbDivEncuesta").innerHTML = "<img src='images/cargando_l.gif' class='CCargandoEncuestas'>";
				
				xmlHttpEncuesta = GetXmlHttpObject();
				
				if ( xmlHttpEncuesta == null )
				{
					alert (cAJAXNoValido);
					return;
				}
				
				var cUrl = "axEncuestas.asp" + 
					"?" + 
					"cIdEncuesta=" + cIdEncuesta + 
					"&" + 
					"cValor=" + (nCont + 1) + 
					"&" + 
					"bVotar=1" + 
					"&" + 
					"cIdRandom=" + Math.random();
				
				xmlHttpEncuesta.onreadystatechange = fncAJAXValidarEncuesta;
				xmlHttpEncuesta.open("GET", cUrl, true);
				xmlHttpEncuesta.send(null);
			}
			else
			{
				alert ( "Por favor dé una respuesta a la pregunta." );
				return;
			}
		}
		else
		{
			var cIdEncuesta = document.frmEncuesta.cIdEncuesta.value;
			
			document.getElementById("tbDivEncuesta").innerHTML = "<img src='images/cargando_l.gif' class='CCargandoEncuestas'>";
			
			xmlHttpEncuesta = GetXmlHttpObject();
			
			if ( xmlHttpEncuesta == null )
			{
				alert (cAJAXNoValido);
				return;
			}
			
			var cUrl = "axEncuestas.asp" + 
				"?" + 
				"cIdEncuesta=" + cIdEncuesta + 
				"&" + 
				"bVotar=0" + 
				"&" + 
				"cIdRandom=" + Math.random();
			
			xmlHttpEncuesta.onreadystatechange = fncAJAXValidarEncuesta;
			xmlHttpEncuesta.open("GET", cUrl, true);
			xmlHttpEncuesta.send(null);
		}
	}
}

function fncAJAXValidarEncuesta()
{
	if (xmlHttpEncuesta.readyState == 4)
	{
		if ( xmlHttpEncuesta.status == 200 )
		{
			var cResponseAjax = xmlHttpEncuesta.responseText;
			
			if ( cResponseAjax.substring(0, 3) != "ERR" )
			{
				arrayResponse = cResponseAjax.split("|||||");
				document.getElementById("tbDivEncuesta").innerHTML = arrayResponse[1];
			}
			else
			{
				arrayResponse = cResponseAjax.split("|||||");
				document.getElementById("tbDivEncuesta").innerHTML = "<span class='CTdCalendarioError'>Error en Encuesta</span>";
			}
		}
	}
}

function fncIrSeccionBanner(strURL, cIdSeccion, cTarget)
{
	document.frmIrASeccionBanner.IS.value = cIdSeccion;
	document.frmIrASeccionBanner.action = strURL;
	document.frmIrASeccionBanner.target = cTarget;
	document.frmIrASeccionBanner.submit();
}

function fncLoadPage()
{
	window.onscroll = fncAcomodaScrollAvisos;
    window.onresize = fncAcomodaScrollAvisos;
}

function fncAcomodaScrollAvisos()
{
	if ( document.getElementById("tBlackOpacity") )
		document.getElementById("tBlackOpacity").style.top = f_scrollTop();
	
	if ( document.getElementById("tPopUpOpacity") )
		document.getElementById("tPopUpOpacity").style.top = f_scrollTop();
	
	if ( document.getElementById("divHojaCuestionario") )
		fncScrollCuestionario();
}

function fncAccesoAfiliados()
{
	if ( document.getElementById("tBlackOpacity") )
		document.getElementById("tBlackOpacity").style.display = "";
	
	if ( document.getElementById("tPopUpOpacity") )
		document.getElementById("tPopUpOpacity").style.display = "";
	
	if ( document.getElementById("cNoSocio") )
		document.frmAccesoAfiliados.cNoSocio.focus();
}

function fncAccesoAfiliadosCerrar()
{
	if ( document.getElementById("tBlackOpacity") )
		document.getElementById("tBlackOpacity").style.display = "none";
	
	if ( document.getElementById("tPopUpOpacity") )
		document.getElementById("tPopUpOpacity").style.display = "none";
}

function fncValidaAccesoCambiaPass()
{
	if( document.frmAccesoAfiliadosCambiaPass.cPassword.value == "" )
	{
		alert("El campo \"Contraseña Actual\" no es válido.");
		document.frmAccesoAfiliadosCambiaPass.cPassword.focus();
		return;
	}
	
	if( document.frmAccesoAfiliadosCambiaPass.cPasswordNew.value == "" )
	{
		alert("El campo \"Nueva Contraseña\" no es válido.");
		document.frmAccesoAfiliadosCambiaPass.cPasswordNew.focus();
		return;
	}
	
	if( document.frmAccesoAfiliadosCambiaPass.cPasswordNewConf.value == "" )
	{
		alert("El campo \"Confirmar Contraseña\" no es válido.");
		document.frmAccesoAfiliadosCambiaPass.cPasswordNewConf.focus();
		return;
	}
	
	document.frmAccesoAfiliadosCambiaPass.action = "xAcceso.asp";
	document.frmAccesoAfiliadosCambiaPass.submit();
}

function fncValidaAcceso()
{
	if( document.frmAccesoAfiliados.cNoSocio.value == "" )
	{
		alert("El campo \"No. Socio\" no es válido.");
		document.frmAccesoAfiliados.cNoSocio.focus();
		return;
	}
	
	if( document.frmAccesoAfiliados.cPassword.value == "" )
	{
		alert("El campo \"Contraseña\" no es válido.");
		document.frmAccesoAfiliados.cPassword.focus();
		return;
	}
	
	document.frmAccesoAfiliados.action = "xAcceso.asp";
	document.frmAccesoAfiliados.submit();
}

function fncIrAForo(strURL, IdSeccion, IdForo, IdComentario)
{
	document.frmIrAForo.IS.value = IdSeccion;
	document.frmIrAForo.IFO.value = IdForo;
	document.frmIrAForo.ICO.value = IdComentario;
	document.frmIrAForo.action = strURL;
	document.frmIrAForo.submit();
}

function fncEnviarComentario()
{
	if ( document.frmEnviaComentario.cComentario.value == "" )
	{
		alert("Introduzca un Cometario.");
		document.frmEnviaComentario.cComentario.focus();
		return;
	}
	
	document.frmEnviaComentario.submit();
}

function fncOverImgMas(oImg, strImage01, strImage02)
{
	var aLiga = split(oImg.src, "/");
	
	if ( aLiga[aLiga.length - 1] == "btnMas.png" || aLiga[aLiga.length - 1] == "btnMasOver.png" )
		oImg.src = strImage01;
	else if ( aLiga[aLiga.length - 1] == "btnMenos.png" || aLiga[aLiga.length - 1] == "btnMenosOver.png" )
		oImg.src = strImage02;
}

function fncBlogTitleClick( cIdBlog )
{
	document.frmBlogs.IP.value = cIdBlog;
	document.frmBlogs.submit();
}

function fncScrollCuestionario()
{
	var cLimiteInicio = 220;
	var cLimiteFinal = 2620;
	
	if ( f_scrollTop() > cLimiteInicio )
		if ( f_scrollTop() < cLimiteFinal )
			document.getElementById("divHojaCuestionario").style.top = (f_scrollTop() - cLimiteInicio) + "px";
		else
			document.getElementById("divHojaCuestionario").style.top = (cLimiteFinal - cLimiteInicio + 60) + "px";
	else
		document.getElementById("divHojaCuestionario").style.top = 0 + "px";
}

/*
INICIA CARRUSEL BANNERS
*/
var cIdTimeOutAuto = 0;

uagent = window.navigator.userAgent.toLowerCase();

IEB = (uagent.indexOf('msie') != -1) ? true: false; 

var cTotalImages = 0;
var cTimeDelay = 50;
var cFactorDivisor = 3;
var cGeneralLado = "+";
var cGeneralLadoAnterior = "+";
var cImagesFolderName = "";
var cBotonesFolderName = "";
var slideleftkalan = 0;

var cGeneralWidth = 0;
var cGeneralHeight = 0;

imgarr = new Array();
imgstr = new Array();
linkstr = new Array();
clslinkstr = new Array();

function slideleftSonraki()
{
	if ( cGeneralLado == "+" )
	{
		cIndexCurrent = cIndexNext;
		cIndexNext = cIndexNext + 1;
		
		if ( cIndexNext >= cTotalImages )
			cIndexNext = 0;
	}
	else if ( cGeneralLado == "-" )
	{
		cIndexCurrent = cIndexNext;
		cIndexNext = cIndexNext - 1;
		
		if ( cIndexNext < 0 )
			cIndexNext = cTotalImages - 1;
	}
	
	oDivImageCurrent = document.getElementById('slideleftd' + cIndexCurrent);
	oDivImageNext = document.getElementById('slideleftd' + cIndexNext);
}

function slideleftzindx()
{
	oDivImageNext.style.visibility = "visible";
	oDivImageCurrent.style.zIndex = 2;
	oDivImageNext.style.zIndex = 3;
}

function fncConfiguraCarrusel()
{
	cTotalImages = imgarr.length;
	
	if ( document.getElementById("btnCarruselAtras") && cTotalImages <= 1 )
	{
		document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtrasOff.png";
		document.getElementById("btnCarruselAtras").className = "CImagenBotonesCarruselOff";
		document.getElementById("btnCarruselAtras").disabled = "true";
	}
	
	if ( document.getElementById("btnCarruselAdelante") && cTotalImages <= 1 )
	{
		document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelanteOff.png";
		document.getElementById("btnCarruselAdelante").className = "CImagenBotonesCarruselOff";
		document.getElementById("btnCarruselAdelante").disabled = "true";
	}
	
	cIndexCurrent = 0;
	cIndexNext = 0;
	oCDivCarruselInterno = null;
	stepc = 20 * (3);
	slideleftdif = 0.00;
	slideleftop = 1.00;
	slideleftdif = ( 1.00 / stepc );
	
	dstr1 = '<div id="';
	dstr2 = '" style="position:absolute; visibility:hidden; left:0px; top:0px; padding:0px; margin:0px; overflow: hidden;">';
	dstr23 = '' + 
		'<table border="0" bordercolor="red" cellspacing="0" cellpadding="0" style="position:relative; left:0px; top:0px; padding:0px; margin:0px;">' + 
			'<tr>' + 
				'<td style="width:' + cGeneralWidth + 'px; height:' + cGeneralHeight + 'px; left:0px; top:0px; padding:0px; margin:0px; text-align:' + 'center' + '; vertical-align:' + 'middle' + ';">';
	dstr3 = '<img id="slideleftimg';
	dstr4 = '" src="';
	dstr5 = '" style="position:relative;" alt="" />';
	dstr56 = '' + 
				'</td>' + 
			'</tr>' + 
		'</table>';
	dstr6 = '</div>';
	
	this.fncIniciaSlideInterno = fncIniciaSlide;
}

function slideleftDoSlide()
{
	if ( cGeneralLado == "+" )
	{
		slideleftkalan = slideleftkalan - Math.ceil( slideleftkalan / cFactorDivisor );
		oDivImageCurrent.style.left = "" + ( slideleftkalan - cGeneralWidth ) + "px";
		oDivImageNext.style.left = "" + slideleftkalan + "px";
		
		if( slideleftkalan <= 0 )
		{
			slideleftSonraki();
			slideleftkalan = +cGeneralWidth;
			oDivImageNext.style.left = "" + slideleftkalan + "px";
			
			slideleftzindx();
			
			if ( document.getElementById("btnCarruselAtras") )
			{
				document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtras.png";
				document.getElementById("btnCarruselAtras").className = "CImagenBotonesCarrusel";
				document.getElementById("btnCarruselAtras").disabled = "";
			}
			
			if ( document.getElementById("btnCarruselAdelante") )
			{
				document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelante.png";
				document.getElementById("btnCarruselAdelante").className = "CImagenBotonesCarrusel";
				document.getElementById("btnCarruselAdelante").disabled = "";
			}
			
			cIdTimeOutAuto = setTimeout("fncTimeOutAccion()", 10000);
		}
		else
		{
			setTimeout('slideleftDoSlide()', cTimeDelay);
		}
	}
	else if ( cGeneralLado == "-" )
	{
		slideleftkalan = slideleftkalan - Math.floor( slideleftkalan / cFactorDivisor );
		oDivImageCurrent.style.left = "" + ( slideleftkalan + cGeneralWidth ) + "px";
		oDivImageNext.style.left = "" + slideleftkalan + "px";
		
		if( slideleftkalan >= 0 )
		{
			slideleftSonraki();
			slideleftkalan = -cGeneralWidth;
			oDivImageNext.style.left = "" + slideleftkalan + "px";
			
			slideleftzindx();
			
			if ( document.getElementById("btnCarruselAtras") )
			{
				document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtras.png";
				document.getElementById("btnCarruselAtras").className = "CImagenBotonesCarrusel";
				document.getElementById("btnCarruselAtras").disabled = "";
			}
			
			if ( document.getElementById("btnCarruselAdelante") )
			{
				document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelante.png";
				document.getElementById("btnCarruselAdelante").className = "CImagenBotonesCarrusel";
				document.getElementById("btnCarruselAdelante").disabled = "";
			}
			
			cIdTimeOutAuto = setTimeout("fncTimeOutAccion()", 10000);
		}
		else
		{
			setTimeout('slideleftDoSlide()', cTimeDelay);
		}
	}
}

function fncPrimerSlide()
{
	oCDivCarruselInterno = document.getElementById("CDivCarruselInterno");
	
	if ( cTotalImages > 0 )
	{
		oDivImageCurrent = document.getElementById("slideleftd" + 0);
		oDivImageCurrent.style.visibility = "visible";
	}
	
	if ( cTotalImages > 1 )
	{
		cIndexCurrent = 0;
		cIndexNext = 0;
		
		if ( cGeneralLado == "+" )
			slideleftkalan = +cGeneralWidth;
		else if ( cGeneralLado == "-" )
			slideleftkalan = -cGeneralWidth;
		
		slideleftSonraki();
		oDivImageNext.style.left = "" + slideleftkalan + "px";
		
		slideleftzindx();
		
		cIdTimeOutAuto = setTimeout("fncTimeOutAccion()", 10000);
	}
}

function fncIniciaSlide()
{
	i = 0;
	cInnerText = "";
	
	for ( i = 0; i < cTotalImages; i++ )
	{
		cInnerText = cInnerText + dstr1 + "slideleftd" + i + dstr2 + dstr23 + linkstr[i] + dstr3 + i + dstr4 + imgstr[i] + dstr5 + clslinkstr[i] + dstr56 + dstr6;
	}
	
	document.getElementById("CDivCarruselInterno").innerHTML = "" + cInnerText;
	
	var cXTotal = 0;
	while ( cXTotal < cTotalImages )
	{
		document.getElementById("slideleftimg" + cXTotal).src = cImagesFolderName + imgarr[cXTotal].title;
		cXTotal = cXTotal + 1;
	}
	
	setTimeout('fncPrimerSlide()', 100);
}

function fncComienzaCarrusel( cPathFolder, cPathButtonsFolder, cWidth, cHeight )
{
	cImagesFolderName = cPathFolder;
	cBotonesFolderName = cPathButtonsFolder;
	
	if ( document.getElementById("btnCarruselAtras") )
		document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtras.png";
	
	if ( document.getElementById("btnCarruselAdelante") )
		document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelante.png";
	
	cGeneralWidth = cWidth;
	cGeneralHeight = cHeight;
	
	oFncCreaCarrusel = new fncConfiguraCarrusel();
	oFncCreaCarrusel.fncIniciaSlideInterno();
}

function fncTimeOutAccion()
{
	fncClickAccion(1);
}

function fncClickAccion( cValue )
{
	clearTimeout(cIdTimeOutAuto);
	
	if ( cValue < 0 )
	{
		cGeneralLado = "-";
		
		if ( cGeneralLadoAnterior != cGeneralLado )
		{
			cGeneralLadoAnterior = cGeneralLado;
			
			slideleftSonraki();
			slideleftSonraki();
			slideleftkalan = -cGeneralWidth;
			slideleftzindx();
		}
		
		if ( document.getElementById("btnCarruselAtras") )
		{
			document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtrasOff.png";
			document.getElementById("btnCarruselAtras").className = "CImagenBotonesCarruselPro";
			document.getElementById("btnCarruselAtras").disabled = "true";
		}
		
		if ( document.getElementById("btnCarruselAdelante") )
		{
			document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelanteOff.png";
			document.getElementById("btnCarruselAdelante").className = "CImagenBotonesCarruselPro";
			document.getElementById("btnCarruselAdelante").disabled = "true";
		}
		
		setTimeout('slideleftDoSlide()', 100);
	}
	else
	{
		cGeneralLado = "+";
		
		if ( cGeneralLadoAnterior != cGeneralLado )
		{
			cGeneralLadoAnterior = cGeneralLado;
			
			slideleftSonraki();
			slideleftSonraki();
			slideleftkalan = +cGeneralWidth;
			slideleftzindx();
		}
		
		if ( document.getElementById("btnCarruselAtras") )
		{
			document.getElementById("btnCarruselAtras").src = cBotonesFolderName + "btnAtrasOff.png";
			document.getElementById("btnCarruselAtras").className = "CImagenBotonesCarruselPro";
			document.getElementById("btnCarruselAtras").disabled = "true";
		}
		
		if ( document.getElementById("btnCarruselAdelante") )
		{
			document.getElementById("btnCarruselAdelante").src = cBotonesFolderName + "btnAdelanteOff.png";
			document.getElementById("btnCarruselAdelante").className = "CImagenBotonesCarruselPro";
			document.getElementById("btnCarruselAdelante").disabled = "true";
		}
		
		setTimeout('slideleftDoSlide()', 100);
	}
}
/*
TERMINA CARRUSEL BANNERS
*/

window.onload = fncLoadPage;
