<!--
	function validarEmail(control, mensaje){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(control.value)){
			return true;
		}else{
			alert(mensaje);
			control.focus();
			return false;
		}
	}

	function validarCedula(control, TAM, mensaje){
		var cedula = control.value.toString();
		var longitud = cedula.length;
		var sum = 0;
		var num = 0;
		
		if(longitud != TAM){
			alert(mensaje);
			control.focus();
			return false;
		}
		for(i = 0; i < longitud - 1; i++){
			if(i % 2){
				num = parseInt(cedula.charAt(i));
			}else{
				num = parseInt(cedula.charAt(i)) * 2;
			}
			if(num > 9){
				num -= 9;
			}
			sum += num;
		}
		if((sum % 10) == 0 && parseInt(cedula.charAt(i)) == 0){
			return true;
		}else if((10 - (sum % 10)) == parseInt(cedula.charAt(i))){
			return true;
		}else{
			alert(mensaje);
			control.focus();
			return false;
		}
	}

	function soloNumeros(texto, objeto, maxDecimales, evento){
		opc = false;

		key = (document.all) ? evento.keyCode : evento.which;

		if(texto == "%d"){
			if(key == 0 || key == 8 || (key > 47 && key < 58)){
				opc = true;
			}
		}

		if(texto == "%f"){
			if(key == 0 || key == 8 || (key > 47 && key < 58)){
				opc = true;
				if((objeto.value.indexOf('.') + 1) != 0 && key != 8 && key != 0){
					if((objeto.value.length - (objeto.value.indexOf('.') + 1)) >= maxDecimales){
						opc = false;
					}
				}
			}

			if(objeto.value.search("[.*]") == -1 && objeto.value.length != 0){
				if(key == 46){
					opc = true;
				}
			}
		}
		return opc;
	}

	function validarCampoNumero(control, TMIN, TMAX, VMIN, VMAX, mensaje){
		if(control.value.length >= TMIN && control.value.length <= TMAX && !isNaN(control.value) && parseFloat(control.value) >= VMIN && parseFloat(control.value) <= VMAX){
			return true;
		}else{
			alert(mensaje);
			control.focus();
			return false;
		}
	}

	function validarCampoNumeroNoObligatorio(control, TMIN, TMAX, VMIN, VMAX, mensaje){
		if(!control.value.length == 0){
			if(control.value.length >= TMIN && control.value.length <= TMAX && !isNaN(control.value) && parseFloat(control.value) >= VMIN && parseFloat(control.value) <= VMAX){
				return true;
			}else{
				alert(mensaje);
				control.focus();
				return false;
			}
		}else{
			return true;
		}
	}

	function validarCampoTextoObligatorio(control, TMIN, TMAX, mensaje){
		if(control.value.length >= TMIN && control.value.length <= TMAX){
			return true;
		}else{
			alert(mensaje);
			control.focus();
			return false;
		}
	}

	function validarCampoTextoNoObligatorio(control, TMIN, TMAX, mensaje){
		if(!control.value.length == 0){
			if(control.value.length >= TMIN && control.value.length <= TMAX){
				return true;
			}else{
				alert(mensaje);
				control.focus();
				return false;
			}
		}else{
			return true;
		}
	}

	function validaTextArea(control, evento, tam){
		key = (document.all) ? evento.keyCode : evento.which;
		ingresa = true;

		if(key != 8 && key != 0){
			if(control.value.length >= tam){
				ingresa = false;
			}
		}
		return ingresa;
	}

	function noCaracteresEspeciales(control, espacios, signosPuntuacion, guiones, mensaje){
		var str = control.value.toString();
		var totalCaracteres = 0;

		if(espacios){
			if(str.indexOf(' ') != -1){
				var espacios = /\s/g;
				totalCaracteres += str.match(espacios).length;
			}
		}

		if(signosPuntuacion){
			if(str.indexOf('.') != -1){
				var puntos = /\./g;
				totalCaracteres += str.match(puntos).length;
			}
			if(str.indexOf(',') != -1){
				var comas = /\,/g;
				totalCaracteres += str.match(comas).length;
			}
			if(str.indexOf(':') != -1){
				var dosPuntos = /\:/g;
				totalCaracteres += str.match(dosPuntos).length;
			}
			if(str.indexOf(';') != -1){
				var puntoComa = /\;/g;
				totalCaracteres += str.match(puntoComa).length;
			}
		}
		
		if(guiones){
			if(str.indexOf('-') != -1){
				var menos = /\-/g;
				totalCaracteres += str.match(menos).length;
			}
			if(str.indexOf('/') != -1){
				var division = /\//g;
				totalCaracteres += str.match(division).length;
			}
		}

		var alfanumerico = /\w/g;
		totalCaracteres += str.match(alfanumerico).length;

		if(str.length == totalCaracteres){
			return true;
		}else{
			control.focus();
			alert(mensaje);
		}
	}

	function informacionAdicional(destino){
		var pagina = destino.toString();
		
		var w = window.open(pagina, "InformacionAdicional", "width=500, height=300, screenX=80, screenY=40, top=80, left=40, resizable=yes, scrollbars=yes");
		w.focus();
		return;
    }

	function validarFecha(fecha, MIN, MAX){
		var mensaje = "Fecha incorrecta. ";

		if(/^\d{4}-((0[0-9])|(1[0-2]))-(([0-2][0-9])|(3[0-1]))/.test(fecha.value)){
			var anio_i = parseInt(fecha.value.substring(0, 4), 10);
			var mes_i = parseInt(fecha.value.substring(5, 7), 10);
			var dia_i = parseInt(fecha.value.substring(8, 10), 10);

			var maxd_i = 31;

			if(anio_i >= MIN && anio_i <= MAX){
				if(mes_i >= 1 && mes_i <= 12){
					if(mes_i == 2){
						if((anio_i % 4) == 0){
							maxd_i = 29;
						}else{
							maxd_i = 28;
						}
					}else if(mes_i == 4 || mes_i == 6 || mes_i == 9 || mes_i == 11){
						maxd_i = 30;
					}

					if(dia_i >= 1 && dia_i <= maxd_i){
						return true;
					}else{
						alert(mensaje.concat("Por favor revise el día ingresado."));
						fecha.focus();
					}
				}else{
					alert(mensaje.concat("Por favor revise el mes ingresado."));
					fecha.focus();
				}
			}else{
				alert(mensaje.concat("Por favor revise el año ingresado."));
				fecha.focus();
			}
		}else{
			alert(mensaje.concat("Formato no válido."));
			fecha.focus();
		}
	}
-->
