function validaAutoReg1(v_Form) {
	//Telefono
	if (v_Form.txtNroTel.value.length==0){
		alert("Ingrese Teléfono");
		v_Form.txtNroTel.focus();
		//document.getElementById('txtNroTel').Value);
		return false;
	//}else{
	//	alert(v_Form.txtNroTel.value);
	}
	
	//Valida No Tlf
	if (v_Form.txtNroTel.value != ""){
		if (!validarTelefono(v_Form.txtNroTel.value)){
			alert("Ingrese su Teléfono correctamente");
			v_Form.txtNroTel.focus();
			return false;
		}
	}
	
	//DNI
	if (v_Form.txtNroDoc.value.length==0){
		alert("Ingrese DNI");
		v_Form.txtNroDoc.focus();
		return false;
	}
	
	if (v_Form.txtNroDoc.value != ""){
		if (!Valida_DNI(v_Form.txtNroDoc)){
			v_Form.txtNroDoc.focus();
			return false;
		}
	}
	
	//Ultimo Recibo
	//if (v_Form.txtUltRec.value.length==0){
	//	alert("Ingrese Ultimo recibo");
	//	v_Form.txtUltRec.focus();
	//	return false;
	//}
	//return true;
	
	//Ultimo Recibo hidden - campo oculto por modificacion de autoregistro en aol  - Jorge Ramirez
	if (v_Form.hdUltimoRecibo.value.length==0){
		alert("Ingrese Ultimo recibo");
		//v_Form.txtUltRec.focus();
		return false;
	}
	return true;
	
}


function validaAutoReg2(v_Form) {
	//DNI
	if (v_Form.txtNroDoc.value.length==0){
		alert("Ingrese DNI");
		v_Form.txtNroDoc.focus();
		return false;
	}
	if (v_Form.txtNroDoc.value != ""){
		if (!Valida_DNI(v_Form.txtNroDoc)){
				
				v_Form.txtNroDoc.focus();
				return false;
			}
	}	
	if (v_Form.txtNroDoc.value != ""){
		if ((v_Form.txtNroDoc.value)!=(v_Form.txhNroDocument.value)){
			    
				alert("El DNI no coincide con el registrado antes");
				v_Form.txtNroDoc.focus();
				return false;
			}
	}

	//Fecha Inscripción
	if (v_Form.cboFecInsDia.options[0].selected==true){
		alert("Ingrese Día de Inscipción");
		v_Form.cboFecInsDia.focus();
		return false;
	}
	if (v_Form.cboFecInsMes.options[0].selected==true){
		alert("Ingrese Mes de Inscripción");
		v_Form.cboFecInsMes.focus();
		return false;
	}
	if (v_Form.txtFecInsAno.value.length==0){
		alert("Ingrese Año de Inscipción");
		v_Form.txtFecInsAno.focus();
		return false;
	}		

	//Validacion de fecha
	if  (!(v_Form.cboFecNacDia.value=="" && v_Form.cboFecNacMes.value=="" && v_Form.txtFecNacAno.value=="")){
		if (!checkdate(v_Form.cboFecNacDia.value ,v_Form.cboFecNacMes.value, v_Form.txtFecNacAno.value )){
			alert("Fecha de Nacimiento inválida");
			v_Form.cboFecNacDia.focus();
			return false;
		}
		if (isChrSpc(v_Form.cboFecNacDia.value)  || !ContentOnlyNumber(v_Form.cboFecNacDia.value)){
			alert("Fecha de Nacimiento no debe contener letras o caracteres especiales");
			v_Form.cboFecNacDia.focus();
			return false;
		}
		if (isChrSpc(v_Form.cboFecNacMes.value) || !ContentOnlyNumber(v_Form.cboFecNacMes.value)){
			alert("Fecha de Nacimiento no debe contener letras o caracteres especiales");
			v_Form.cboFecNacMes.focus();
			return false;
		}
		if (isChrSpc(v_Form.txtFecNacAno.value) || !ContentOnlyNumber(v_Form.txtFecNacAno.value)){
			alert("Fecha de Nacimiento no debe contener letras o caracteres especiales");
			v_Form.txtFecNacAno.focus();
			return false;
		}
	}
	
	//Fecha Nacimiento
	if (v_Form.cboFecNacDia.options[0].selected==true){
		alert("Ingrese Día de Nacimiento");
		v_Form.cboFecNacDia.focus();
		return false;
	}
	if (v_Form.cboFecNacMes.options[0].selected==true){
		alert("Ingrese Mes de Nacimiento");
		v_Form.cboFecNacMes.focus();
		return false;
	}
	if (v_Form.txtFecNacAno.value.length==0){
		alert("Ingrese Año de Nacimiento");
		v_Form.txtFecNacAno.focus();
		return false;
	}
		
	//Valida Teléfono Móvil
	//if (v_Form.txtTelMovCon.value != ""){
		if (!ContentOnlyNumber(v_Form.txtTelMovCon.value)){
				alert("Número de Telefono Móvil inválido");
				v_Form.txtTelMovCon.focus();
				return false; 
		}
		if (isChrSpc(v_Form.txtTelMovCon.value)){
			alert("Número de Telefono Móvil no debe contener caracteres especiales");
			v_Form.txtTelMovCon.focus();
			return false;
		}
	//}

	//Valida Nro Pc's
	//if (v_Form.txtNroPcsCas.value != ""){
		if (!ContentOnlyNumber(v_Form.txtNroPcsCas.value)){
			alert("Número de Pcs inválido");
			v_Form.txtNroPcsCas.focus();
			return false;
		}	
		if (isChrSpc(v_Form.txtNroPcsCas.value)){
			alert("Número de Pcs no debe contener caracteres especiales");
			v_Form.txtNroPcsCas.focus();
			return false;	
		}
	//}
		
	//Valida No Tlf		
	if (!validarTelefono(v_Form.txtTelFijCon.value)){
		alert("Ingrese su Teléfono correctamente");
		v_Form.txtTelFijCon.focus();
		return false;
	}
		
	//Sexo
	if (v_Form.cboSex.options[0].selected==true){
		alert("Seleccione Sexo");
		v_Form.cboSex.focus();
		return false;
	}
	
	//Email 1
	if (v_Form.txtUsuEMail1.value.length==0){
		alert("Ingrese Usuario de Email 1");
		v_Form.txtUsuEMail1.focus();
		return false;
	}
		
	if (v_Form.txtDomEMail1.value.length==0){
		alert("Ingrese Dominio de Email 1");
		v_Form.txtDomEMail1.focus();
		return false;
	}
		
	//Email 2
	if (v_Form.txtDomEMail2.value.length!=0){
		if (v_Form.txtUsuEMail2.value.length==0){
			alert("Ingrese Usuario de Email 2");
			v_Form.txtUsuEMail2.focus();
			return false;
		}
	}
	if (v_Form.txtUsuEMail2.value.length!=0){
		if (v_Form.txtDomEMail2.value.length==0){
			alert("Ingrese Dominio de Email 2");
			v_Form.txtDomEMail2.focus();
			return false;
		}
	}
	
	//Usuario
	if (v_Form.txtUsu.value.length==0){
		alert("Ingrese un Usuario ");
		v_Form.txtUsu.focus();
		return false;
	}
	if (isChrSpcAOL(v_Form.txtUsu.value)){ 
		alert("El Usuario no debe contener caracteres especiales");
		v_Form.txtUsu.focus();
		return false;
	}
		
	//Password
	if (v_Form.txtPwd.value.length==0){
		alert("Ingrese el Password");
		v_Form.txtPwd.focus();
		return false;
	}
	
	if (v_Form.txtPwd.value.length<6){
		alert("La longitud de la contraseña debe de ser de un mínimo de 6 caracteres y un máximo de 10.");
		v_Form.txtPwd.focus();
		return false;
	}
	
	if (!isContrasena(v_Form.txtPwd.value)){
		alert("La contraseña no debe contener caracteres especiales");
		v_Form.txtPwd.focus();
		return false;
	}
		
	//Confirmación Password
	if (v_Form.txtConPwd.value.length==0){
		alert("Ingrese la confimación de Password");
		v_Form.txtConPwd.focus();
		return false;
	}
		
	//Valida Password con Confirmacion...		  
	//Confirmación Password
	if (v_Form.txtConPwd.value!=v_Form.txtPwd.value){
		alert("No coincide el password con la confirmación");
		v_Form.txtConPwd.focus();
		return false;
	}
		
	//Pregunta Clave
	if (v_Form.txtPreCla.value.length==0){
		alert("Ingrese la Pregunta Clave");
		v_Form.txtPreCla.focus();
		return false;
	}
	
	//Rpta Clave
	if (v_Form.txtRptCla.value.length==0){
		alert("Ingrese la Respuesta Clave");
		v_Form.txtRptCla.focus();
		return false;
	}

	//check de Aceptación de Condiciones
  if (v_Form.chkAcpCon.checked==false){
		alert("Debe aceptar las condiciones del contrato");
		return false;
	}
	
	return true;
}


function validaAutoEmpr1(v_Form) {
	
	// Razón Social
	if (v_Form.txtRazSoc.value.length==0){
		alert("Ingrese Razón Social");
		v_Form.txtRazSoc.focus();
		return false;
	}
	//RUC
	if (v_Form.txtNroDoc.value.length==0){
		alert("Ingrese RUC");
		v_Form.txtNroDoc.focus();
		return false;
	}
	//RUC NO 11 Caract
	if (v_Form.txtNroDoc.value != ""){		
		if (!validarTelefono(v_Form.txtNroDoc.value)){
			alert("Ingrese su RUC correctamente");
			v_Form.txtNroTel.focus();
			return false;
		}
	}
	if (v_Form.txtNroDoc.value.length!=11){
		alert("El RUC debe tener 11 caracteres");
		v_Form.txtNroDoc.focus();
		return false;
	}
	// Representante Legal
	if (v_Form.txtRepLeg.value.length==0){
		alert("Ingrese Representante Legal");
		v_Form.txtRepLeg.focus();
		return false;
	}	
	//Telefono
	if (v_Form.txtNroTel.value.length==0){
		alert("Ingrese Teléfono");
		v_Form.txtNroTel.focus();
		return false;
	}
	//Valida No Tlf
	if (v_Form.txtNroTel.value != ""){		
		if (!validarTelefono(v_Form.txtNroTel.value)){
			alert("Ingrese su Teléfono correctamente");
			v_Form.txtNroTel.focus();
			return false;
		}
	}
		//Corre Electrónico
	if (v_Form.txtCorreoElectrNeg.value.length == 0){		
		alert("Ingrese correo electronico");
		v_Form.txtCorreoElectrNeg.focus();
		return false;
	}
	if (v_Form.txtCorreoElectrNeg.value != ""){		
		if (!validacorreo(v_Form.txtCorreoElectrNeg.value)){
			alert("Ingrese su correo con el formato correcto");
			v_Form.txtCorreoElectrNeg.focus();
			return false;
		}
	}
	return true;
}

function validaOlvidoClave(v_Form){
	//v_Form = document.forms["frmOlvidoClave"];
	if (v_Form.usuario.value==""){
		alert("Ingrese su Usuario");
		v_Form.usuario.focus();
		return false;
	}
	if (isChrSpc(v_Form.usuario.value)){
		alert("Usuario no debe contener caracteres especiales");
		v_Form.usuario.focus();
		return false;
	}
	if (v_Form.Respuesta!=null){
		if (v_Form.Respuesta.value==""){
			alert("Ingrese su Respuesta");
			v_Form.Respuesta.focus();
			return false;
		}
		if (isChrSpc(v_Form.Respuesta.value)){
			alert("La Respuesta no debe contener Caracteres Especiales");
			v_Form.Respuesta.focus();
			return false;
		}
	}
	//v_Form.submit();
	return true;
}
function validaOlvidoClave1(v_Form){
	//v_Form = document.forms["frmOlvidoClave"];
	if (v_Form.hdUsuario.value==""){
		alert("Ingrese su Usuario");
		v_Form.hdUsuario.focus();
		return false;
	}
	/*
	if (isChrSpc(v_Form.hdUsuario.value)){
		alert("Usuario no debe contener caracteres especiales");
		v_Form.hdUsuario.focus();
		return false;
	}
	*/
	if (v_Form.Respuesta!=null){
		if (v_Form.Respuesta.value==""){
			alert("Ingrese su Respuesta");
			v_Form.Respuesta.focus();
			return false;
		}
		/*
		if (isChrSpc(v_Form.Respuesta.value)){
			alert("La Respuesta no debe contener Caracteres Especiales");
			v_Form.Respuesta.focus();
			return false;
		}
		*/
	}
	//v_Form.submit();
	return true;
}
function isContrasena(str){
	for(var i=0; i<str.length; i++ )
	{
		if ( !isValidChr(str.charAt(i)))
		return false;
	}
		return true;
}
	
function isValidChr(c){
	validChrs = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	for (var j=0; j<validChrs.length; j++)
	{
		if (c==validChrs.charAt(j))
			return true;
	}
			return false;
}
	function isChrSpcAOL(str){
		ChrSpc = "°·@¬!\"#%&<>'¡:`¿~,;$/=+*\\-.()}]{[^\?áéíóúñÑ\ ";
		for(var i=0; i<str.length; i++ ){
			for (var j=0; j<ChrSpc.length; j++){
				if (str.charAt(i)==ChrSpc.charAt(j))
					return true;
			}
		}
		return false;
	}