function validaForma(form,loading,required_label,wrong_mail_label,wrong_section_label){
	try{
		var _loading = document.getElementById(loading);
		if(_loading)
			_loading.style.visibility="visible";
		this.setTimeout("validaFormaImp('"+form+"','"+loading+"','"+required_label+"','"+wrong_mail_label+"','"+wrong_section_label+"')", 1000);
	}catch(ex){}
}

function validaFormaImp(form,loading,required_label,wrong_mail_label,wrong_section_label){
	form = document.getElementById(form);//alert('aqdqwd');
	if(isEmpty(form.elements["nombre_principal"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}/*
	if(isEmpty(form.elements["apellido_paterno"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}
	if(isEmpty(form.elements["correo_electronico"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}else{
		if(isInvalidEmail(form.elements["correo_electronico"].value)){
			showError(wrong_mail_label);
			document.getElementById(loading).style.visibility="hidden";
			return;
		}
	}*/
	if(isEmpty(form.elements["contrasena"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}
	if(!form.elements["sexo"][0].checked && !form.elements["sexo"][1].checked){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}
	if(isNotSelected(form.elements["dia"]) || isNotSelected(form.elements["mes"]) || isNotSelected(form.elements["anio"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}else{
		var dia = form.elements["dia"].value;
		var mes = form.elements["mes"].value;
		var anio = form.elements["anio"].value;
		/*
		if(isAdult(dia,mes,anio)){
			if(isEmpty(form.elements["seccion"])){
				showError(required_label);
				document.getElementById(loading).style.visibility="hidden";
				return;
			}else{
				if(!isInteger(form.elements["seccion"].value)){
					showError(wrong_section_label);
					document.getElementById(loading).style.visibility="hidden";
					return;
				}
			}
		}
		*/
	}
	/*
	if(isNotSelected(form.elements["estado"]) || isNotSelected(form.elements["delegacion"])){
		showError(required_label);
		document.getElementById(loading).style.visibility="hidden";
		return;
	}
	if(!isEmpty(form.elements["seccion"])){
		if(!isInteger(form.elements["seccion"].value)){
			showError(wrong_section_label);
			document.getElementById(loading).style.visibility="hidden";
			return;
		}
	}*/
	document.altaCiudadano.submit();
}

function showSeccionTooltip(){
	var path="consultaSeccion.do";
	var ajax = new accesoAJAX.CargadorDeDatos("POST",path,
								function(data){
										var _contenido = document.getElementById("tooltip");
										if(_contenido){
											_contenido.innerHTML= data;
											showTooltip();
										}
								});
}

function olvidoContrasenia(loading){
	try{
		var _loading = document.getElementById(loading);
		if(_loading)
			_loading.style.visibility="visible";
		this.setTimeout(olvidoContraseniaImp(loading), 1);
	}catch(ex){}
}

function olvidoContraseniaImp(loading){
	var path="olvidoContrasenia.do";
	var ajax = new accesoAJAX.CargadorDeDatos("POST",path,
								function(data){
										var _contenido = document.getElementById("tooltip");
										if(_contenido){
											_contenido.innerHTML= data;
											showTooltip();
											document.getElementById(loading).style.visibility="hidden";
										}
								});
}







