function nuevoAjax()
{
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
	lo que se puede copiar tal como esta aqui */
	var xmlhttp=false;
	try
	{
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			// Creacion del objet AJAX para IE
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); }

	return xmlhttp;
}

function valida_buscador(obj)
{
	ok=false;
	if(obj.busqueda!=null&&obj.busqueda.value=="")
	{
		alert("Debe escribir una frase o palabra a buscar!!!");
		obj.busqueda.focus();
	}
	else if(obj.busqueda!=null&&obj.busqueda.value==" ")
	{
		alert("Debe escribir una frase o palabra a buscar!!!");
		obj.busqueda.focus();
	}
	else
	{
		ok = true;
	}
	return ok;
}

/*INICIO --- FUNCIONES PARA COLOREAR LAS FILAS DE LAS TABLAS AL DAR CLICK Y AL PASAR POR ENCIMA*/
function sobre(celda)
{

		if( celda.className!='marca')
		{
		  celda.className='sobre'
		}
}

function quita(celda)
{
		if(celda.className=='sobre')
		{
		  celda.className='quita'
		}
}

function marcarc(celda)
{

		if(celda.className=='quita'||celda.className=='sobre')
		{
		  celda.className='marca'
		}
		else
		if(celda.className=='marca')
		{
		  celda.className='quita'
		}
 }

/*FIN --*/

function valida_registro(obj)
{
	ok  = false;
	var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.nombre != null && obj.nombre.value == ""){
		alert("No ha ingresado el nombre del usuario");
		obj.nombre.focus();
	}else if(obj.apellidos != null && obj.apellidos.value == ""){
		alert("No ha ingresado apellidos");
		obj.apellidos.focus();
	}else if(obj.direccion != null && obj.direccion.value == ""){
		alert("No ha ingresado una direccion ");
		obj.direccion.focus();
	}else if(obj.telefono != null && obj.telefono.value == ""){
		alert("No ha ingresado un numero telefonico ");
		obj.telefono.focus();
	}else if(obj.email != null && obj.email.value == ""){
		alert("No ha ingresado un e-mail");
		obj.email.focus();
	}else if(!re.test(obj.email.value)){
		alert("Correo electrónico inválido!!!");
		obj.email.focus();
	}else if((obj.dia != null && obj.dia.value == "")||(obj.mes != null && obj.mes.value == "")||(obj.ano != null && obj.ano.value == "")){
		alert("No ha ingresado una fecha válida");
	}else if(obj.pais != null && obj.pais.value == ""){
		alert("No ha ingresado un país");
		obj.pais.focus();
	}else if(obj.departamento != null && obj.departamento.value == ""){
		alert("No ha ingresado un estado");
		obj.departamento.focus();
	}else if(obj.postal != null && obj.postal.value == ""){
		alert("No ha ingresado un numero código postal");
		obj.postal.focus();
	}
	else{
		ok = true;}
	return ok;
}

function valida_sucursal(obj)
{
	ok  = false;
	var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.sucursal_ejecutivo != null && obj.sucursal_ejecutivo.value == ""){
		alert("No ha ingresado el nombre de la sucursal");
		obj.sucursal_ejecutivo.focus();
	}else if(obj.correo_sucursal_ejecutivo != null && obj.correo_sucursal_ejecutivo.value == ""){
		alert("No ha ingresado un e-mail");
		obj.correo_sucursal_ejecutivo.focus();
	}else if(!re.test(obj.correo_sucursal_ejecutivo.value)){
		alert("Correo electrónico inválido!!!");
		obj.correo_sucursal_ejecutivo.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_ingreso(obj)
{
	ok  = false;
	var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.usuario.value == ""){
		alert("Escriba su nombre de usuario");
		obj.usuario.focus();
	}else if(obj.contrasena.value == ""){
		alert("Escriba su contrase"+String.fromCharCode(241)+"a");
		obj.contrasena.focus();
	}else{
		ok = true;
	}
	return ok;
}

function validaUser(object){
	submit();
	alert("aqio");
}

function validaben(obj)
{
	ok  = false;
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.select1.options[obj.select1.selectedIndex].value=="0"){
		alert("Se requiere el municipio.");
		obj.select1.focus();
	}else if(obj.select2.options[obj.select2.selectedIndex].value=="0"){
		alert("Se requiere el corregimiento.");
		obj.select2.focus();
	}else if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.apellido != null && obj.apellido.value == ""){
		alert("Se requiere el apellido.");
		obj.apellido.focus();
	}else if(obj.cedula != null && obj.cedula.value == ""){
		alert("Se requiere la cedula.");
		obj.cedula.focus();
	}else if(document.getElementById('selcar').checked==true){
			if(obj.carnet != null && obj.carnet.value == ""){
				alert("Se requiere el número de carnet desmovilizado.");
				obj.carnet.focus();
			}
			else{
				ok = true;
			}
	}
	else{
		ok = true;
	}
	if(ok == true){
		ok = false;
	if(obj.genero.options[obj.genero.selectedIndex].value=="0"){
		alert("Se requiere el genero.");
		obj.genero.focus();
	}else if(obj.edad != null && obj.edad.value == ""){
		alert("Se requiere la edad.");
		obj.edad.focus();
	}else if(obj.etnia.options[obj.etnia.selectedIndex].value=="0"){
		alert("Se requiere la etnia.");
		obj.etnia.focus();
	}else if(obj.estudios.options[obj.estudios.selectedIndex].value=="0"){
		alert("Se requiere el nivel de estudios.");
		obj.estudios.focus();
	}else if(obj.estadoc.options[obj.estadoc.selectedIndex].value=="0"){
		alert("Se requiere el estado civil.");
		obj.estadoc.focus();
	}else if(obj.select3.options[obj.select3.selectedIndex].value=="0"){
		alert("Se requiere la asociación.");
		obj.select3.focus();
	}else if(obj.select4.options[obj.select4.selectedIndex].value=="0"){
		alert("Se requiere el proyecto.");
		obj.select4.focus();
	}else{
		ok = true; }
	}
	return ok;
}

function validaben1(obj)
{
	ok  = false;
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.habitantes != null && obj.habitantes.value == ""){
		alert("Se requiere el número de habitantes en la vivienda.");
		obj.habitantes.focus();
	}else if(obj.personas != null && obj.personas.value == ""){
		alert("Se requiere el número de personas a cargo.");
		obj.personas.focus();
	}else if(obj.hijos != null && obj.hijos.value == ""){
		alert("Se requiere el número de hijos.");
		obj.hijos.focus();
	}else{
		ok = true;}
	return ok;
}

var mydate=new Date();
	var mesh = mydate.getMonth()+1;
	if(mesh < 10){
		mesh = "0"+mesh;
	}
	var diah = mydate.getDate();
	if(diah < 10){
		diah = "0"+diah;
	}
	var hoy = mydate.getFullYear()+"-"+mesh+"-"+diah;

function validaben2(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	var fechas = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;

	if(obj.select3.options[obj.select3.selectedIndex].value == "0"){
		alert("Se requiere el servicio que recibe el beneficiario.");
		obj.select1.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha en la cual recibe los servicios.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha en la cual recibe los servicios.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha en la cual recibe los servicios.");
		obj.mess.focus();
	}else if(fechas > hoy){
		alert("La fecha de inicio del servicio debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else{
		ok = true;
	}
	return ok;
}

function validaasoc(obj)
{
	ok  = false;

	var fechaso = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.municipio.options[obj.municipio.selectedIndex].value=="0"){
		alert("Se requiere el municipio.");
		obj.municipio.focus();
	}else if(obj.select2.options[obj.select2.selectedIndex].value=="0"){
		alert("Se requiere el corregimiento.");
		obj.select2.focus();
	}else if(obj.select3.options[obj.select3.selectedIndex].value=="0"){
		alert("Se requiere el proyecto.");
		obj.select3.focus();
	}else if(obj.nit != null && obj.nit.value == ""){
		alert("Se requiere el nit.");
		obj.nit.focus();
	}else if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha de registro.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha de registro.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha de registro.");
		obj.mess.focus();
	}else if(fechaso > hoy){
		alert("La fecha de registro de la asociación debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_cant(obj)
{
	//alert('aca')
	ok  = false;
	if(document.obj.cantidad != null && document.obj.cantidad.value == "")
	{
		alert("No ha ingresado la cantidad a comprar");
		document.obj.cantidad.focus();
	}
	else
	{
		ok = true;
	}
	return ok;
}

function valida_email(obj)
{
	ok  = false;
	var errmsg = "";
	var re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	if(!re.test(obj.email.value)){
		//alert("El email es invalido.");
		errmsg += "El email es invalido \n";
		obj.email.focus();
	}

	return errmsg;
}


function valida_email1(obj)
{
	ok  = false;
	var errmsg = "";
	var re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	if(!re.test(obj.email.value)){
	alert("El email es invalido.");
//		errmsg += "El email es invalido \n";
		obj.email.focus();
	}

	return errmsg;
}

function valida_contac(obj)
{
	ok  = false;
	var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.apellido != null && obj.apellido.value == ""){
		alert("Se requiere el apellido.");
		obj.apellido.focus();
	}else if(obj.ciudad != null && obj.ciudad.value==""){
		alert("Se requiere la ciudad.");
		obj.apellido.focus();
	}else if(!re.test(obj.email.value)){
		alert("El email es invalido.");
		obj.email.focus();
	}else if(obj.comentario!=null && obj.comentario.value==""){
		alert("Se requiere el Comentario.");
		obj.comentario.focus();
	}else if(obj.area.options[obj.area.selectedIndex].value=="0"){
		alert("Se requiere el área.");
		obj.area.focus();
	}else{
		ok = true;
	}

	return ok;
}



function valida_informe(obj)
{

	var fechasi = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;

	if(obj.nombre.value=="")
	{
		alert("Se requiere el nombre.");
		obj.nombre.focus();
		return false;
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha de ingreso.");
		obj.anno.focus();
		return false;
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha de ingreso.");
		obj.mess.focus();
		return false;
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha de ingreso.");
		obj.mess.focus();
	}else if(fechasi > hoy){
		alert("La fecha de ingreso del servicio debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
		return false;
	}else if(obj.archivo.value == ""){
		alert("Se requiere el archivo a cargar.");
		obj.archivo.focus();
		return false;
	}
	else{
		return true;}
}

function validaaso(obj)
{
	ok  = false;
	var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.asociacion.options[obj.asociacion.selectedIndex].value=="0"){
		alert("Seleccione asociación.");
		obj.asociacion.focus();
	}else{
		ok = true;}
	return ok;
}

function validaindica(obj)
{
	ok  = false;
	var conta = 0;
	//alert('que pasa. '+obj.municipio.options[obj.municipio.selectedIndex].value);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.municipio.options[obj.municipio.selectedIndex].value!="0"){
		conta++;
	}
	if(obj.proyecto.options[obj.proyecto.selectedIndex].value!="0"){
		conta++;
	}
	if(obj.genero.options[obj.genero.selectedIndex].value!="0"){
		conta++;
	}
	if(obj.desmovilizado.options[obj.desmovilizado.selectedIndex].value!="0"){
		conta++;
	}
	if(obj.edad.options[obj.edad.selectedIndex].value!="0"){
		conta++;
	}
	if(obj.estudios.options[obj.estudios.selectedIndex].value!="0"){
		conta++;
	}

	if(conta <=1 || conta >= 4){
		alert('Debe seleccionar entre dos (2) y tres (3) variables para generar la estadistica.');
		obj.municipio.focus();
	}else{
		ok =true;
	}
	return ok;
}

function esInteger(e) {
var charCode
if (navigator.appName == "Netscape") // Veo si es Netscape o Explorer (mas adelante lo explicamos)
charCode = e.which // leo la tecla que ingreso
else
charCode = e.keyCode // leo la tecla que ingreso
status = charCode
if (charCode > 31 && (charCode < 48 || charCode > 57)) { // Chequeamos que sea un numero comparandolo con los valores ASCII
alert("Esto no es un Numero !!")
return false
}
}


function validamigo(form){
	var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;

	if(form.nombre.value=="")
	{
		alert("Escribe tu nombre");
		    return false
	}
	else if(form.temail.value=="")
	{
		alert("Escribe tu email");
		    return false
	}
	else if (!filter.test(form.temail.value))
	{
		    alert("El E-mail ingresado no es valido");
		    return false
	}
	else if(form.anombre.value=="")
	{
		alert("Escribe el nombre de tu amigo");
		    return false
	}
	else if(form.email.value=="")
	{
		alert("Escribe el email de tu amigo");
		    return false
	}
	else if(!filter.test(form.email.value))
	{
		alert("El E-mail de tu amigo no es valido");
		    return false
	}
	else
	{
		return true;
	}
}

function esCaracter(e) {
var charCode
if (navigator.appName == "Netscape") // Veo si es Netscape o Explorer (mas adelante lo explicamos)
charCode = e.which // leo la tecla que ingreso
else
charCode = e.keyCode // leo la tecla que ingreso
status = charCode
//alert(charCode)
if (charCode >= 48 && charCode <= 57) { // Chequeamos que sea un numero comparandolo con los valores ASCII
alert("No se admiten numeros!!")
return false
}
}

function valida_noticias(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.titulo != null && obj.titulo.value == ""){
		alert("Se requiere el titulo.");
		obj.titulo.focus();
	}else if(obj.resena != null && obj.resena.value == ""){
		alert("Se requiere la rese"+String.fromCharCode(241)+"a.");
		obj.resena.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen.");
		obj.imagen.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_socios(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen.");
		obj.imagen.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_objetivos(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.titulo != null && obj.titulo.value == ""){
		alert("Se requiere el titulo.");
		obj.titulo.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_historias(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.titulo != null && obj.titulo.value == ""){
		alert("Se requiere el titulo.");
		obj.titulo.focus();
	}else if(obj.resena != null && obj.resena.value == ""){
		alert("Se requiere la rese"+String.fromCharCode(241)+"a.");
		obj.resena.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen.");
		obj.imagen.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_municipios(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen.");
		obj.imagen.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_categorias(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre.");
		obj.nombre.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion.");
		obj.descripcion.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen.");
		obj.imagen.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_etnias(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre de la etnia.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_generos(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del genero.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_estudios(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del nivel de estudio.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_estadosc(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del estado civil.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_vivienda(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del tipo de vivienda.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_salud(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del acceso a salud.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_unidades(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre de la unidad de medida.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function valida_coberturas(obj)
{
	ok  = false;
	//alert('a ' + document.forms['obj']['servicio[]'].selectedIndex);
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre de la cobertura.");
		obj.nombre.focus();
	}else{
		ok = true;
	}
	return ok;
}

function validaindi(obj)
{
	ok  = false;

	var fechaso = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;
	//var re=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else if(obj.cobertura.options[obj.cobertura.selectedIndex].value == "0"){
		alert("Se requiere la cobertura.");
		obj.cobertura.focus();
	}else if(document.getElementById("select_m").disabled == false && obj.municipio.options[obj.municipio.selectedIndex].value == "0"){
		alert("Se requiere el municipio.");
		obj.municipio.focus();
	}else if(document.getElementById("select_p").disabled == false && obj.categoria.options[obj.categoria.selectedIndex].value == "0"){
		alert("Se requiere el proyecto.");
		obj.categoria.focus();
	}else if(document.getElementById("select_a").disabled == false && obj.asociacion.options[obj.asociacion.selectedIndex].value == "0"){
		alert("Se requiere la asociación.");
		obj.asociacion.focus();
	}else if(obj.indicador.options[obj.indicador.selectedIndex].value == "0"){
		alert("Se requiere el indicador.");
		obj.indicador.focus();
	}else if(obj.meta != null && obj.meta.value == ""){
		alert("Se requiere la meta.");
		obj.meta.focus();
	}else if(obj.logro != null && obj.logro.value == ""){
		alert("Se requiere el logro.");
		obj.logro.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.mess.focus();
	}else if(fechaso > hoy){
		alert("La fecha debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_indica(obj)
{
	ok  = false;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del indicador");
		obj.nombre.focus();
	}else if(obj.cobertura.options[obj.cobertura.selectedIndex].value == "0"){
		alert("Se requiere la cobertura.");
		obj.cobertura.focus();
	}else if(obj.unidad.options[obj.unidad.selectedIndex].value == "0"){
		alert("Se requiere la unidad de medida.");
		obj.unidad.focus();
	}else if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_compo(obj)
{
	ok  = false;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del componente");
		obj.nombre.focus();
	}else if(obj.resena != null && obj.resena.value == ""){
		alert("Se requiere la rese"+String.fromCharCode(241)+"a");
		obj.resena.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripcion");
		obj.descripcion.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_servi(obj)
{
	ok  = false;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre del servicio");
		obj.nombre.focus();
	}else if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else if(obj.indicador.options[obj.indicador.selectedIndex].value == "0"){
		alert("Se requiere el indicador.");
		obj.indicador.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_albun(obj)
{
	ok  = false;

	if(obj.titulo != null && obj.titulo.value == ""){
		alert("Se requiere el titulo del álbum");
		obj.titulo.focus();
	}else if(obj.descripcion != null && obj.descripcion.value == ""){
		alert("Se requiere la descripción");
		obj.descripcion.focus();
	}/*else if(obj.select1.options[obj.select1.selectedIndex].value == "0"){
		alert("Se requiere el proyecto.");
		obj.select1.focus();
	}else if(obj.select2.options[obj.select2.selectedIndex].value == "0"){
		alert("Se requiere el municipio.");
		obj.select2.focus();
	}else if(obj.select3.options[obj.select3.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.select3.focus();
	}*/else{
		ok = true;}
	return ok;
}

function valida_galeria(obj)
{
	ok  = false;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre de la foto");
		obj.nombre.focus();
	}else if(obj.imagen != null && obj.imagen.value == ""){
		alert("Se requiere la imagen");
		obj.imagen.focus();
	}else if(obj.select4.options[obj.select4.selectedIndex].value == "0"){
		alert("Se requiere el álbum.");
		obj.select4.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_galeria1(obj)
{
	ok  = false;

	if(obj.nombre != null && obj.nombre.value == ""){
		alert("Se requiere el nombre de la foto");
		obj.nombre.focus();
	}else if(obj.select1.options[obj.select1.selectedIndex].value == "0"){
		alert("Se requiere el proyecto.");
		obj.select1.focus();
	}else if(obj.select2.options[obj.select2.selectedIndex].value == "0"){
		alert("Se requiere el municipio.");
		obj.select2.focus();
	}else if(obj.select3.options[obj.select3.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.select3.focus();
	}else if(obj.select4.options[obj.select4.selectedIndex].value == "0"){
		alert("Se requiere el álbum.");
		obj.select4.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_prod(obj)
{
	ok  = false;

	var fechaso = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;
	if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else if(obj.indicador.options[obj.indicador.selectedIndex].value == "0"){
		alert("Se requiere el indicador.");
		obj.indicador.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.dias.focus();
	}else if(fechaso > hoy){
		alert("La fecha debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else if(obj.cantidad != null && obj.cantidad.value == ""){
		alert("Se requiere la cantidad Kg");
		obj.cantidad.focus();
	}else if(obj.lote != null && obj.lote.value == ""){
		alert("Se requiere el lote");
		obj.lote.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_viaje(obj)
{
	ok  = false;

	var fechaso = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;

	if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else if(obj.indicador.options[obj.indicador.selectedIndex].value == "0"){
		alert("Se requiere el indicador.");
		obj.indicador.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.dias.focus();
	}else if(fechaso > hoy){
		alert("La fecha debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else if(obj.cantidad != null && obj.cantidad.value == ""){
		alert("Se requiere la cantidad Kg");
		obj.cantidad.focus();
	}else if(obj.tipo != null && obj.tipo.value == ""){
		alert("Se requiere el tipo");
		obj.tipo.focus();
	}else if(obj.lote != null && obj.lote.value == ""){
		alert("Se requiere el lote");
		obj.lote.focus();
	}else if(obj.precio != null && obj.precio.value == ""){
		alert("Se requiere el precio Kg");
		obj.precio.focus();
	}else{
		ok = true;}
	return ok;
}

function valida_venta(obj)
{
	ok  = false;
	var ven = 0;
	var rec = 0;

	if(obj.vendidos != null && obj.vendidos.value != ""){
		ven = parseFloat(obj.vendidos.value);
	}
	if(obj.recogido != null && obj.recogido.value != "") {
		rec = parseFloat(obj.recogido.value);
	}

	var fechaso = obj.anno.options[obj.anno.selectedIndex].value+"-"+obj.mess.options[obj.mess.selectedIndex].value+"-"+obj.dias.options[obj.dias.selectedIndex].value;

	if(obj.componente.options[obj.componente.selectedIndex].value == "0"){
		alert("Se requiere el componente.");
		obj.componente.focus();
	}else if(obj.indicador.options[obj.indicador.selectedIndex].value == "0"){
		alert("Se requiere el indicador.");
		obj.indicador.focus();
	}else if(obj.anno.options[obj.anno.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.anno.focus();
	}else if(obj.mess.options[obj.mess.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.mess.focus();
	}else if(obj.dias.options[obj.dias.selectedIndex].value == "0"){
		alert("Se requiere la fecha.");
		obj.dias.focus();
	}else if(fechaso > hoy){
		alert("La fecha debe ser menor o igual a la fecha actual.");
		obj.anno.focus();
	}else if(obj.recogido != null && obj.recogido.value == ""){
		alert("Se requiere Kg recogido");
		obj.recogido.focus();
	}else if(obj.lote != null && obj.lote.value == ""){
		alert("Se requiere el lote");
		obj.lote.focus();
	}else if(obj.vendidos != null && obj.vendidos.value == ""){
		alert("Se requiere Kg vendidos");
		obj.vendidos.focus();
	}else if(obj.precio != null && obj.precio.value == ""){
		alert("Se requiere el precio");
		obj.precio.focus();
	}else if(rec < ven){
		alert("El Kg recogido debe se mayor a Kg Vendidos");
		obj.recogido.focus();
	}else{
		ok = true;}
	return ok;
}

function validaContacto(obj)
{
	ok=false;
	if(obj.nombre!=null&&obj.nombre.value=="")
	{
		alert("Escriba su nombre por favor");
		obj.nombre.focus();
	}
	else if(obj.email!=null&&obj.email.value=="")
	{
		alert("Escriba su correo");
		obj.email.focus();
	}else if(obj.email!=""){
		var error = valida_email(obj);
		if(error!=''){
			alert(error);
			obj.email.value='';
			obj.email.focus();
		}else{
		ok = true;
		var envia = obj.submit.value=1;
		//obj.submit();
		}
	}
	return ok;
}

function enviaComent(obj){
	ok = true;
	var envia = obj.submit.value=1;
	obj.submit();
	return ok;
}

function validaEnvio(obj)
{
	if(document.getElementById('autorizar').checked == true)
	{
		document.getElementById('enviar').disabled = false;
	}
	else
	{
		document.getElementById('enviar').disabled = true;
	}
}

function validaJugadorF(obj){
	var nombres 		= document.getElementById('nombres');
	var identificacion 	= document.getElementById('identificacion');
	var edad 			= document.getElementById('edad');
	var tipoId 			= document.getElementById('tipoIdentificacion');
	var descripcion		= document.getElementById('descripcion');
	var trayectoria		= document.getElementById('trayectoria');
	var club			= document.getElementById('club');
	var login			= document.getElementById('login');
	var contrasena		= document.getElementById('password');
	var confirmacion	= document.getElementById('confirma');
	var email			= document.getElementById('email');

	var error			= "";
	var cerror			= 0;

	if(nombres.value==''){
		error += "El campo Nombres es un campo obligatorio.\n";
	}

	if(identificacion.value==''){
		error += "El campo Identificacion es un campo obligatorio.\n";
	}

	if(edad.value==''){
		error += "El campo Edad es un campo obligatorio.\n";
	}

	if(descripcion.value==''){
		error += "El campo Edad es un campo obligatorio.\n";
	}

	if(trayectoria.value==''){
		error += "El campo Edad es un campo obligatorio.\n";
	}

	if(login.value==''){
		error += "El campo Login es un campo obligatorio.\n";
	}

	if(contrasena.value==''){
		error += "El campo Contrase�a es un campo obligatorio.\n";
	}

	if(confirmacion.value==''){
		error += "El campo Confirmacion es un campo obligatorio.\n";
	}

	if(email.value==''){
		error += "El campo Email es un campo obligatorio.\n";
	}

	if(error==''){
		var accion = document.getElementById('accion');
		accion.value = 'Guardar';
//		document.getElementById(obj).submit();
		return true;
	}

	error = "Algunos campos contienen errores, verifiquelos e intente de nuevo \n\n"+error;

	alert(error);
	return false;
}

function validaForm(obj){
	var error="";
	if(obj.nombre.value==''){
		error += "El campo Nombre es obligatorio y no puede estar vacio. \n";
	}

	if(obj.apellidos.value==''){
		error += "El campo Apellidos es obligatorio y no puede estar vacio. \n";
	}
	if(obj.dia.value==''){
		error += "El campo Fecha de Nacimiento es obligatorio y no puede estar vacio. \n";
	}else{
		if(obj.dia.value>31){
			error += "El Dia de nacimiento es invalido. \n";
			obj.dia.value ='';
		}
	}
	if(obj.mes.value==''){
		error += "El campo Fecha de Nacimiento es obligatorio y no puede estar vacio. \n";
	}else{
		if(obj.mes.value>12){
			error += "El Mes de nacimiento es invalido. \n";
			obj.mes.value ='';
		}
	}
	if(obj.anio.value==''){
		error += "El campo Fecha de Nacimiento es obligatorio y no puede estar vacio. \n";
	}
	if(obj.institucion.value==''){
		error += "El campo Institucion es obligatorio y no puede estar vacio. \n";
	}
	if(obj.direccion.value==''){
		error += "El campo Direccion es obligatorio y no puede estar vacio. \n";
	}
	if(obj.telefono.value==''){
		error += "El campo Telefono es obligatorio y no puede estar vacio. \n";
	}
	if(obj.eps.value==''){
		error += "El campo EPS es obligatorio y no puede estar vacio. \n";
	}
	if(obj.grado.value==''){
		error += "El campo Grado es obligatorio y no puede estar vacio. \n";
	}
	if(obj.fecha.value==''){
		error += "El campo Fecha es obligatorio y no puede estar vacio. \n";
	}
	if(obj.acudiente.value==''){
		error += "El campo Acudiente es obligatorio y no puede estar vacio. \n";
	}
	if(obj.nivel.value==''){
		error += "El campo Nivel es obligatorio y no puede estar vacio. \n";
	}

	if(error==''){
		ok = true;
		var envia = obj.submit.value=1;
		obj.submit();
	}
	else{
		error = "Algunos campos contienen errores, verifiquelos e intente de nuevo \n\n"+error;

		alert(error);
		return false;
	}
}

function validaCampos(obj){
	var error = '';

	if(obj.titulo.value==''){
		error +='El Titulo es un campo obligatorio. \n';
		//obj.titulo.focus();
	}
	//alert(obj.noticia.value);
	var noticia = FCKeditorAPI.__Instances['noticia'].GetHTML();

	if(noticia==''){
		error +='La Noticia es un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaClub(obj){
	var error = '';

	if(obj.nombre.value==''){
		error +='El Nombre es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(obj.descripcion.value==''){
		error +='La Ubicacion es un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaSede(obj){
	var error = '';

	if(obj.proyecto.value==''){
		error +='El Nombre es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(obj.direccion.value==''){
		error +='La Direccion es un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(obj.direccion1.value==''){
		error +='El Area es un campo obligatorio. \n';
		//obj.noticia.focus();
	}


	if(obj.descripcion.value==''){
		error +='Las Caracteristicas son un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}


function validaGaleria(obj){
	var error = '';

	if(obj.nombre.value==''){
		error +='El Nombre es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(obj.imagen.value==''){
		error +='La Imagen es un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaEvento(obj){
	var error = '';

	if(obj.titulo.value==''){
		error +='El Titulo es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(obj.anno.options[obj.anno.selectedIndex].value==""){
		error +='El Anio es un campo obligatorio. \n';
	}

	if(obj.mess.options[obj.mess.selectedIndex].value==""){
		error +='El Mes es un campo obligatorio. \n';
	}

	if(obj.imagen1.value==''){
		error +='La Imagen es un campo obligatorio. \n';
		//obj.noticia.focus();
	}

	if(obj.lugar.value==''){
		error +='El Lugar es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(obj.hora.value==''){
		error +='La Hora es un campo obligatorio. \n';
		//obj.titulo.focus();
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaReglamento(obj){
	var error ='';
	if(obj.titulo.value==''){
		error +='El Titulo es un campo obligatorio. \n';
	}

	if(obj.documento.value==''){
		error +='El Documento es un campo obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaAlbun(obj){
	var error ='';
	if(obj.titulo.value==''){
		error +='El Titulo es un campo obligatorio. \n';
	}

	if(obj.imagen.value==''){
		error +='La Imagen es un campo obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaQuienes(obj){
	var error ='';
	if(obj.mision.value==''){
		error +='La Mision es un campo obligatorio. \n';
	}

	if(obj.vision.value==''){
		error +='La Vision es un campo obligatorio. \n';
	}

	if(obj.descripcion.value==''){
		error +='La Descripcion es un campo obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaPolitica(obj){
	var error ='';
	if(obj.titulo.value==''){
		error +='El Titulo es un campo obligatorio. \n';
	}

	if(obj.noticia.value==''){
		error +='El campo Politica es obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaJugador(obj){
	var error = '';
	if(obj.nombres.value==''){
		error +='El Nombre es un campo obligatorio. \n';
	}
	if(obj.identificacion.value==''){
		error +='La Identificacion es un campo obligatorio. \n';
	}
	if(obj.edad.value==''){
		error +='La Edad es un campo obligatorio. \n';
	}

	if(obj.tipoIdentificacion.options[obj.tipoIdentificacion.selectedIndex].value==""){
		error +='El Tipo de Identificacion es un campo obligatorio. \n';
	}

	if(obj.descripcion.value==''){
		error +='La Descripcion es un campo obligatorio. \n';
	}

	if(obj.trayectoria.value==''){
		error +='La Trayectoria es un campo obligatorio. \n';
	}

	if(obj.diestro.options[obj.diestro.selectedIndex].value==""){
		error +='El campo Diestro es un campo obligatorio. \n';
	}

	if(obj.club.options[obj.club.selectedIndex].value==""){
		error +='El Club es un campo obligatorio. \n';
	}

	if(obj.login.value==''){
		error +='El Usuario es un campo obligatorio. \n';
	}

	if(obj.password.value==''){
		error +='El Password es un campo obligatorio. \n';
	}

	if(obj.email.value==''){
		error +='El Email es un campo obligatorio. \n';
	}

	if(obj.perfil.options[obj.perfil.selectedIndex].value=="0"){
		error +='El Perfil es un campo obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaJugadorM(obj){
	var error = '';
	if(obj.nombres.value==''){
		error +='El Nombre es un campo obligatorio. \n';
	}
	if(obj.identificacion.value==''){
		error +='La Identificacion es un campo obligatorio. \n';
	}
	if(obj.edad.value==''){
		error +='La Edad es un campo obligatorio. \n';
	}

	if(obj.tipoIdentificacion.options[obj.tipoIdentificacion.selectedIndex].value==""){
		error +='El Tipo de Identificacion es un campo obligatorio. \n';
	}

	if(obj.descripcion.value==''){
		error +='La Descripcion es un campo obligatorio. \n';
	}

	if(obj.trayectoria.value==''){
		error +='La Trayectoria es un campo obligatorio. \n';
	}

	if(obj.diestro.options[obj.diestro.selectedIndex].value==""){
		error +='El campo Diestro es un campo obligatorio. \n';
	}

	if(obj.club.options[obj.club.selectedIndex].value==""){
		error +='El Club es un campo obligatorio. \n';
	}

	if(obj.login.value==''){
		error +='El Usuario es un campo obligatorio. \n';
	}


	if(obj.email.value==''){
		error +='El Email es un campo obligatorio. \n';
	}

	if(obj.perfil.options[obj.perfil.selectedIndex].value=="0"){
		error +='El Perfil es un campo obligatorio. \n';
	}

	if(error!=''){
		error = "Existen errores en algunos campos. Verifique y vuelva a intentarlo \n\n"+error;
		alert(error);
		return false;
	}

	return true;
}

function validaPago(obj){
	//alert("esta");
	ok = false;
	checked = false;

	for ( var i = 0; i < obj.tipoid.length; i++ ) {
	    if (obj.tipoid[i].checked) {
	    	checked = true;
	    }
	}

	/*checked1 = false;
	for ( var i = 0; i < obj.si.length; i++ ) {
	    if (obj.si[i].checked) {
	    	checked1 = true;
	    }
	}*/

	/*checked1 = false;
	for ( var i = 0; i < obj.si.length; i++ ) {
	    if (obj.si[i].checked) {
	    	checked1 = true;
	    }
	}*/

	checked2 = false;
	for ( var i = 0; i < obj.genero.length; i++ ) {
	    if (obj.genero[i].checked) {
	    	checked2 = true;
	    }
	}


	var pattern = "^[0-9\�\�\\!\"�\$%&\/\(\)=?�|@#�\'�]";
	//alert("a validar");
	if(obj.int_numb!=null && obj.int_numb.value==""){
		alert("Escriba su N_umero de Documento por favor");
		obj.int_numb.focus();
	}else if(checked==false){
		alert("Seleccione un tipo de documento");
		obj.tipoid[0].focus();
	}else if(obj.t_int_name!=null&&obj.t_int_name.value==""){
		alert("Escriba su nombre por favor");
		obj.t_int_name.focus();
	}else if(obj.t_int_ape!=null&&obj.t_int_ape.value==""){
		alert("Escriba su apellido por favor");
		obj.t_int_ape.focus();
	}else if(obj.int_anio.options[document.getElementById("int_anio").selectedIndex].value==0){
		alert("Debe seleccionar un anio en su fecha de nacimiento.");
		obj.int_anio.focus();
	}else if(obj.int_mes.options[document.getElementById("int_mes").selectedIndex].value==0){
		alert("Debe seleccionar un mes en su fecha de nacimiento.");
		obj.int_mes.focus();
	}else if(obj.int_dia.options[document.getElementById("int_dia").selectedIndex].value==0){
		alert("Debe seleccionar un dia en su fecha de nacimiento.");
		obj.int_dia.focus();
	}else if(checked2==false){
		alert("Debe seleccionar un genero");
		obj.genero[0].focus();
	}else if(obj.int_age!=null && obj.int_age.value==''){
		alert("Escriba su edad por favor.");
		obj.int_age.focus();
	}else if(obj.int_adds!=null && obj.int_adds.value==''){
		alert("Escriba su direccion por favor.");
		obj.int_adds.focus();
	}else if(obj.int_adds.value.match(pattern)){
		alert("La direccion tiene un formato incorrecto.");
		obj.int_adds.focus();
	}else if(obj.int_city!=null && obj.int_city.value==''){
		alert("Escriba su ciudad por favor.");
		obj.int_city.focus();
	}else if(obj.int_phn1!=null && obj.int_phn1.value==''){
		alert("Escriba el numero de telefono");
		obj.int_phn1.focus();
	}else if(obj.int_phn1.value.length<=6){
		alert("El numero de telefono es invalido");
		obj.int_phn1.focus();
	}else if(obj.int_cell1!=null && obj.int_cell1.value==''){
		alert("Escriba el numero de celular");
		obj.int_cell1.focus();
	}else if(obj.int_cell1.value.length<=9){
		alert("El Numero de celular es invalido");
		obj.int_cell1.focus();
	}else if(obj.int_mail!=null && obj.int_mail.value==''){
		alert("Escriba su correo electronico.");
		obj.int_mail.focus();
	}else if(!valida_email2(obj.int_mail)){
		alert("El email no es valido");
		obj.int_mail.focus();
	}else if(obj.eps!=null && obj.eps.value==""){
		alert("Escriba la EPS a la que pertenece");
		obj.eps.focus();
	}else if(obj.liga!=null && obj.liga.value==""){
		alert("Elija la Liga a la cual pertenece");
		obj.liga.focus();
	}
	/*else if(checked1==false){
		ok = false;
		alert("Debe seleccionar si tiene un familiar en la Liga");
		obj.si[0].focus();
	}else if(obj.valida.value=='si'){
		ok = false;
		if(obj.int_condtn!=null && obj.int_condtn.value==''){
			alert("Escriba el o los nombres de sus familiares.");
			obj.int_condtn.focus();
		}else{
			ok = true;
		}
	}else if(obj.validamenor.value=='si'){
		ok = false;
		if(obj.int_nam3!=null && obj.int_nam3.value==''){
			alert("Escriba el nombre del padre");
			obj.int_nam3.focus();
		}else if(obj.int_phn3!=null && obj.int_phn3.value==''){
			alert("Escriba el telefono del padre");
			obj.int_phn3.focus();
		}else if(obj.int_cell3!=null && obj.int_cell3.value==''){
			alert("Escriba el celular del padre");
			obj.int_cell3.focus();
		}else if(obj.int_adds3!=null && obj.int_adds3.value==''){
			alert("Escriba la direccion del padre");
			obj.int_adds3.focus();
		}else if(obj.int_mail3!=null && obj.int_mail3.value==''){
			alert("Escriba el correo electronico del padre");
			obj.int_mail3.focus();
		}else if(!valida_email2(obj.int_mail3)){
			alert("El email del padre es invalido.");
			obj.int_mail3.focus();
		}else if(obj.int_nam4!=null && obj.int_nam4.value==''){
			alert("Escriba el nombre de la madre");
			obj.int_nam4.focus();
		}else if(obj.int_phn4!=null && obj.int_phn4.value==''){
			alert("Escriba el telefono de la madre");
			obj.int_phn4.focus();
		}else if(obj.int_cell4!=null && obj.int_cell4.value==''){
			alert("Escriba el celular de la madre");
			obj.int_cell4.focus();
		}else if(obj.int_adds4!=null && obj.int_adds4.value==''){
			alert("Escriba la direccion de la madre");
			obj.int_adds4.focus();
		}else if(obj.int_mail4!=null && obj.int_mail4.value==''){
			alert("Escriba el correo electronico de la madre");
			obj.int_mail4.focus();
		}else if(!valida_email2(obj.int_mail4)){
			alert("El email de la madre es invalido.");
			obj.int_mail4.focus();
		}else{
			ok = true;
		}
	}*/
	else if(obj.int_nam2!=null && obj.int_nam2.value==""){
		alert("Debe escribir el nombre en la seccion En caso de emergencia llamar a.");
		obj.int_nam2.focus();
	}else if(obj.int_phn2!=null && obj.int_phn2.value==""){
		alert("Debe escribir el telefono en la seccion En caso de emergencia llamar a.");
		obj.int_phn2.focus();
	}else if(obj.int_cell2!=null && obj.int_cell2.value==""){
		alert("Debe escribir el numero de celular en la seccion En caso de emergencia llamar a.");
		obj.int_cell2.focus();
	}else if(obj.emailem!=null && obj.emailem.value==""){
		alert("Debe escribir el email en la seccion En caso de emergencia llamar a.");
		obj.emailem.focus();
	}
	else if(obj.validaclub!=null && obj.validaclub.value==1){
		ok = false;
		if(obj.club!=null && obj.club.value==""){
			alert("Debe elegir el club al que pertenece");
			obj.club.focus();
		}else{
			ok = true;
		}
	}
	else{
		ok =true;
	}
	//return false;
	return ok;
}

function valida_email2(obj)
{
	oki  = false;
	var errmsg = "";
	var re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	if(re.test(obj.value)){
		oki=true;
	}

	return oki;
}

function habilita(){
	var int_condtn = document.getElementById("int_condtn");
	var valida = document.getElementById("valida");

	int_condtn.disabled = false;
	valida.value="si";
}

function deshabilita(){
	var int_condtn = document.getElementById("int_condtn");
	var valida = document.getElementById("valida");

	int_condtn.disabled = true;
	valida.value="no";
}

function verificaEdad(){
	var edad = document.getElementById("int_age");
	var nam = document.getElementById("int_nam3");
	var tel = document.getElementById("int_phn3");
	var cel = document.getElementById("int_cell3");
	var dir = document.getElementById("int_adds3");
	var mail = document.getElementById("int_mail3");

	var name = document.getElementById("int_nam4");
	var tele = document.getElementById("int_phn4");
	var cele = document.getElementById("int_cell4");
	var dire = document.getElementById("int_adds4");
	var maile = document.getElementById("int_mail4");

	if(edad.value<18){
		nam.disabled = false;
		tel.disabled = false;
		cel.disabled = false;
		dir.disabled = false;
		mail.disabled = false;

		name.disabled = false;
		tele.disabled = false;
		cele.disabled = false;
		dire.disabled = false;
		maile.disabled = false;

		var valida = document.getElementById("validamenor");
		valida.value = "si";
	}else{
		nam.disabled = true;
		tel.disabled = true;
		cel.disabled = true;
		dir.disabled = true;
		mail.disabled = true;

		name.disabled = true;
		tele.disabled = true;
		cele.disabled = true;
		dire.disabled = true;
		maile.disabled = true;

		var valida = document.getElementById("validamenor");
		valida.value = "no";
	}
}

function ismaxlength(obj){
	if(obj.value.length >= 300){
		alert('Has superado el tama�o m�ximo permitido');
		return false;
	}
}

function validaRecomendar(obj){
	ok = false;
	if(obj.tunom!=null && obj.tunom.value==''){
		alert("Tu Nombre es un campo obligatorio");
		obj.tunom.focus();
	}else if(obj.tumail!=null && obj.tumail.value==''){
		alert("Tu Email es un campo obligatorio");
		obj.tumail.focus();
	}else if(!valida_email2(obj.tumail)){
			alert("Tu Email es invalido.");
			obj.tumail.focus();
	}else if(obj.sunom!=null && obj.sunom.value==''){
		alert("El Nombre de Tu Amigo es un campo obligatorio");
		obj.sunom.focus();
	}else if(obj.sumail!=null && obj.sumail.value==''){
		alert("El Email de Tu Amigo es un campo obligatorio");
		obj.tumail.focus();
	}else if(!valida_email2(obj.sumail)){
			alert("El Email de Tu Amigo es invalido.");
			obj.sumail.focus();
	}else{
		ok = true;
	}

	return ok;
}

function calculaEdad(ano,mes,dia,dest){
	hoy=new Date();

	ano = ano.value;
	mes = mes.value;
	dia = dia.value;
	edad=hoy.getFullYear()- ano - 1;
	//si resto los meses y me da menor que 0 entonces no ha cumplido a�os. Si da mayor si ha cumplido
    if (hoy.getMonth() + 1 - mes < 0) //+ 1 porque los meses empiezan en 0
       edad = edad
    if (hoy.getMonth() + 1 - mes > 0)
       edad=edad+1

    //entonces es que eran iguales. miro los dias
    //si resto los dias y me da menor que 0 entonces no ha cumplido a�os. Si da mayor o igual si ha cumplido
    if (hoy.getUTCDate() - dia >= 0)
       edad += 1

     dest.value = edad;

}

function cargaUsuario(obj){

	var documento = obj.value;
	if(documento!='')
	{
		ajax=nuevoAjax();
		ajax.open("GET", "admin/includes/infousuario.php?id="+documento, true);
		ajax.onreadystatechange=function()
		{
			if (ajax.readyState==4)
			{
				informacion = ajax.responseText;
				//alert(informacion);
				info = informacion.split(",");

				id_usuario = document.getElementById("idusuario");
				id_usuario.value = info[0];

				int_numb = document.getElementById("int_numb");
				int_numb.value = info[3];

				if(info[2]=='C.C.'){
					tid = document.getElementById("a_int_cc");
						tid.checked = true;

				}else if(info[2]=='T.I.'){
					tid = document.getElementById("a_ti");
						tid.checked = true;
				}else if(info[2]=='otro'){
					tid = document.getElementById("int_othr");
						tid.checked = true;
				}




				int_nam = document.getElementById("int_nam");
				int_nam.value = info[1];

				int_ape = document.getElementById("int_ape");
				int_ape.value = info[26];
				fecha = info[4].split("-");

				int_anio = document.getElementById("int_anio");
				int_anio.value = fecha[2];
				int_mes = document.getElementById("int_mes");
				setTimeout("setDia(int_mes,fecha[1])",1000);
				//int_mes.value=fecha[1];
				int_dia = document.getElementById("int_dia");

				setTimeout("cargaContenido1(fecha[0])",1000);

				//int_dia.value = fecha[0];
				int_age = document.getElementById("int_age");
				int_age.value=info[5];

				/*if(info[5]<18){
					validamenor = document.getElementById("validamenor");
					validamenor.value='si';
				}*/

				int_adds = document.getElementById("int_adds");
				int_adds.value=info[6];
				int_city = document.getElementById("int_city");

				int_city.value=info[7];
				int_phn1 = document.getElementById("int_phn1");
				int_phn1.value=info[8];
				int_cell1 = document.getElementById("int_cell1");
				int_cell1.value=info[9];
				int_mail = document.getElementById("int_mail");
				int_mail.value=info[10];

				/*valida = document.getElementById("valida");

				if(info[11]=='si'){
					familiares = document.getElementById("int_yes");
				}else if(info[11]=='no' || info[11]==''){
					familiares = document.getElementById("int_no");
				}
				familiares.checked = true;*/

				/*int_condtn = document.getElementById("int_condtn");
				int_condtn.value=info[12];*/
				int_nam2 = document.getElementById("int_nam2");
				int_nam2.value=info[13];
				int_phn2 = document.getElementById("int_phn2");
				int_phn2.value=info[14];
				int_cell2 = document.getElementById("int_cell2");
				int_cell2.value=info[15];
				/*int_nam3 = document.getElementById("int_nam3");
				int_nam3.value=info[16];
				int_phn3 = document.getElementById("int_phn3");
				int_phn3.value=info[17];
				int_cell3 = document.getElementById("int_cell3");
				int_cell3.value=info[18];
				int_adds3 = document.getElementById("int_adds3");
				int_adds3.value=info[19];
				int_mail3 = document.getElementById("int_mail3");
				int_mail3.value=info[20];
				int_nam4 = document.getElementById("int_nam4");
				int_nam4.value=info[21];
				int_phn4 = document.getElementById("int_phn4");
				int_phn4.value=info[22];
				int_cell4 = document.getElementById("int_cell4");
				int_cell4.value=info[23];
				int_adds4 = document.getElementById("int_adds4");
				int_adds4.value=info[24];
				int_mail4 = document.getElementById("int_mail4");
				int_mail4.value=info[25];*/

				switch (info[27]){
					case 'M':
						generom = document.getElementById("generom");
						generom.checked = true;
					break;
					case 'F':
						generof = document.getElementById("generof");
						generof.checked = true;
					break;
				}
				eps = document.getElementById("eps");
				eps.value=info[28];
				liga = document.getElementById("liga");
				liga.value=info[29];
				if(liga.value==3){
					validaclub = document.getElementById("validaclub");
					validaclub.value=1;
					club = document.getElementById("club");
					club.disabled = "";
					club.value=info[30];
				}
				emailemer = document.getElementById("emailem");
				emailemer.value=info[31];

			}
		}
		ajax.send(null);
	}
}

function setDia(obj, valor){
	obj.value = valor;
}

function cargaContenido1(diass)
{
	var anoss=document.getElementById("int_anio").options[document.getElementById("int_anio").selectedIndex].value;
	var valor=document.getElementById("int_mes").options[document.getElementById("int_mes").selectedIndex].value;
	if(valor==0)
	{
		// Si el usuario eligio la opcion "Elige", no voy al servidor y pongo todo por defecto
		combo=document.getElementById("int_dia");
		combo.length=0;
		var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="D�a";
		combo.appendChild(nuevaOpcion);	combo.disabled=true;
	}
	else
	{

		ajax=nuevoAjax();
		ajax.open("GET", "admin/includes/select_dependientes_fechap.php?tipo="+diass+"&anos="+anoss+"&seleccionado="+valor+"&pro=1", true);
		ajax.onreadystatechange=function()
		{
			if (ajax.readyState==1)
			{
				// Mientras carga elimino la opcion "Elige pais" y pongo una que dice "Cargando"
				combo=document.getElementById("int_dia");
				combo.length=0;
				var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Cargando...";
				combo.appendChild(nuevaOpcion); combo.disabled=true;
			}
			if (ajax.readyState==4)
			{
				document.getElementById("fila_2").innerHTML=ajax.responseText;
			}
		}
		ajax.send(null);
	}
}
function cargaContenido2(diass)
{
	var anoss=document.getElementById("int_anio").options[document.getElementById("int_anio").selectedIndex].value;
	var valor=document.getElementById("int_mes").options[document.getElementById("int_mes").selectedIndex].value;
	if(valor==0)
	{
		// Si el usuario eligio la opcion "Elige", no voy al servidor y pongo todo por defecto
		combo=document.getElementById("int_dia");
		combo.length=0;
		var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="D�a";
		combo.appendChild(nuevaOpcion);	combo.disabled=true;
	}
	else
	{

		ajax=nuevoAjax();
		ajax.open("GET", "../admin/includes/select_dependientes_fechap.php?tipo="+diass+"&anos="+anoss+"&seleccionado="+valor+"&pro=1", true);
		ajax.onreadystatechange=function()
		{
			if (ajax.readyState==1)
			{
				// Mientras carga elimino la opcion "Elige pais" y pongo una que dice "Cargando"
				combo=document.getElementById("int_dia");
				combo.length=0;
				var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Cargando...";
				combo.appendChild(nuevaOpcion); combo.disabled=true;
			}
			if (ajax.readyState==4)
			{
				document.getElementById("fila_2").innerHTML=ajax.responseText;
			}
		}
		ajax.send(null);
	}
}
function validaCompra(obj){
	ok = false;

	if((obj.valorins!=null && obj.valorins.checked!=true) && (obj.valorcarne!=null && obj.valorcarne.checked!=true)){
		alert("Debe seleccionar el o los servicios que desea pagar.");
		obj.valorins.focus();
	}else{
		ok = true;
	}
	return ok;
}

function marcar(obj)
{
  for (i=0; ele = obj.form.elements[i]; i++)
	if (ele.type=='checkbox')
	  ele.checked = obj.checked;
}

function addRow(tableID,idt)
{
	var tableRef = document.getElementById(tableID);
	numRows = tableRef.rows.length;
	var newRow   = tableRef.insertRow(numRows-1);
	var x = tableRef.rows[numRows-1].cells;
	var add = document.getElementById("add");
	add.disabled = true;
	for(var i=0;i<1;i++){
	 	//mostrar resultados en esta capa
		newRow.appendChild(newRow.insertCell(i));
		x[i].innerHTML = "<input type='text' name='jugadores' id='jugadores'>";
		newRow.appendChild(newRow.insertCell(i++));

		x[i].innerHTML = '<input type="file" name="archivo" id="archivo">';
		newRow.appendChild(newRow.insertCell(i++));
		x[i].innerHTML = '<input type="hidden" name="idt" id="idt" value="'+idt+'">';
		newRow.appendChild(newRow.insertCell(i++));
		x[i].innerHTML = '<input type="submit" name="guardar" id="guardar" value="Guardar">';
	}
}

function modificaResultado(jugadores, idr, archivo,i,nr){
	var jug = "jug"+i;
	var arc = "arc"+i;
	var mod = "mod"+i;
	var idrn = "idr"+i;

	var inputjug 	= document.getElementById(jug);
	var inputarc 	= document.getElementById(arc);
	var inputmod 	= document.getElementById(mod);
	var inputidr 	= document.getElementById(idrn);
	var add 		= document.getElementById("add");

	add.disabled 	= true;

	for(c=0;c<=nr;c++){
		var bmod = document.getElementById("bmod"+c);
		if(bmod!=null){
			bmod.disabled = true;
		}
	}

	inputjug.innerHTML = "<input type='text' name='jugador' id='jugador' value='"+jugadores+"'>";
	inputarc.innerHTML = "<input type='file' name='archivo' id='archivo'><input type='hidden' name='archivoact' id='archivoact' value='"+archivo+"'>";
	inputmod.innerHTML = "<input type='hidden' name='idrm' id='idrm' value='"+idr+"'>";
	inputidr.innerHTML = "<input type='submit' name='modificar' id='modificar' value='Modificar'>";

}

function mostrarSencilloM(){

	var sencillos = document.getElementById("sencillomostrar");
	sencillos.style.display = '';
	var dobles = document.getElementById("doblemostrar");
	dobles.style.display = 'none';
}

function mostrarDobleM(){

	var sencillos = document.getElementById("sencillomostrar");
	sencillos.style.display = 'none';
	var dobles = document.getElementById("doblemostrar");
	dobles.style.display = '';
}

function mostrarSencilloF(){

	var sencillos = document.getElementById("sencillofmostrar");
	sencillos.style.display = '';
	var dobles = document.getElementById("doblefmostrar");
	dobles.style.display = 'none';
}

function mostrarDobleF(){

	var sencillos = document.getElementById("sencillofmostrar");
	sencillos.style.display = 'none';
	var dobles = document.getElementById("doblefmostrar");
	dobles.style.display = '';
}

function confirmaEliminacion(){
	if(confirm("Esta Seguro de eliminar estos registros?")){
		return true;
	}else{
		return false;
	}
}

function habilitaclub(obj){
	var club = document.getElementById("club");
	var validaclub = document.getElementById("validaclub");
	if(obj.value==3){
		club.disabled = "";
		validaclub.value="1";
	}else{
		club.disabled = "disabled";
		validaclub.value="0";
	}
}

function validaform(obj){
	//alert("esta");
	ok = false;
	checked = false;
	for ( var i = 0; i < obj.nivel.length; i++ ) {
	    if (obj.nivel[i].checked) {
	    	checked = true;
	    }
	}

	checked2 = false;
	for ( var i = 0; i < obj.juegatenis.length; i++ ) {
	    if (obj.juegatenis[i].checked) {
	    	inf=obj.juegatenis[i].value;
	    	checked2 = true;
	    }
	}

	checked3 = false;
	for ( var i = 0; i < obj.actfisica.length; i++ ) {
	    if (obj.actfisica[i].checked) {
	    	checked3 = true;
	    }
	}

	var pattern = "^[0-9\�\�\\!\"�\$%&\/\(\)=?�|@#�\'�]";
	//alert("a validar");
	if(obj.int_nam!=null && obj.int_nam.value==""){
		alert("Escriba su nombre por favor");
		obj.int_nam.focus();
	}else if(obj.int_ape!=null && obj.int_ape.value==""){
		alert("Escriba sus apellidos por favor");
		obj.int_ape.focus();
	}else if(obj.int_anio.options[document.getElementById("int_anio").selectedIndex].value==0){
		alert("Debe seleccionar un anio en su fecha de nacimiento.");
		obj.int_anio.focus();
	}else if(obj.int_mes.options[document.getElementById("int_mes").selectedIndex].value==0){
		alert("Debe seleccionar un mes en su fecha de nacimiento.");
		obj.int_mes.focus();
	}else if(obj.int_dia.options[document.getElementById("int_dia").selectedIndex].value==0){
		alert("Debe seleccionar un dia en su fecha de nacimiento.");
		obj.int_dia.focus();
	}else if(obj.int_age.value < 16){
		alert("Recuerde que solo se deben registrar mayores de 16 anios");
		obj.int_age.focus();
	}else if(obj.int_phn1!=null && obj.int_phn1.value==""){
		alert("Escriba su numero de telefono");
		obj.int_phn1.focus();
	}else if(obj.int_mail!=null && obj.int_mail.value==''){
		alert("Escriba su correo electronico.");
		obj.int_mail.focus();
	}else if(!valida_email2(obj.int_mail)){
		alert("El email no es valido");
		obj.int_mail.focus();
	}else if(obj.int_adds!=null && obj.int_adds.value==''){
		alert("Escriba su direccion.");
		obj.int_adds.focus();
	}else if(checked==false){
		alert("Seleccione su nivel");
		obj.nivel[0].focus();
	}else if(checked2==false){
		alert("Seleccione una de las opciones en Juega al Tenis");
		obj.juegatenis[0].focus();
	}else if(obj.peso!=null && obj.peso.value==""){
		alert("Escriba su peso por favor");
		obj.peso.focus();
	}else if(obj.grasa!=null && obj.grasa.value==""){
		alert("Escriba su % grasa por favor");
		obj.grasa.focus();
	}else if(checked3==false){
		alert("Seleccione una de las opciones en Tipo de actividad fisica");
		obj.actfisica[0].focus();
	}else if(obj.int_eps!=null && obj.int_eps.value==""){
		alert("Escriba el nombre de su EPS");
		obj.int_eps.focus();
	}else if(inf=='si'){
			if(obj.int_ctime!=null && obj.int_ctime.value==""){
				alert("Escriba durante cuanto tiempo practica tenis");
				obj.int_ctime.focus();
			}else if(obj.int_categ!=null && obj.int_categ.value==""){
				alert("Escriba su categoria");
				obj.int_categ.focus();
			}else{
				ok =true;
			}
	}else{
		ok =true;
	}
	//return false;
	return ok;
}
