// --- START --- Traer los ID's de las celdas para cambiarles el nombre al CLASS --------------------------
function bringImas(imaM,imaL,imaR){
	btnL = document.getElementById(imaL);
	btnR = document.getElementById(imaR);
	btnM = document.getElementById(imaM);
	btnL.className = (btnL.className == 'btnLActive') ? 'btnLInactive' : 'btnLActive';
	btnR.className = (btnR.className == 'btnRActive') ? 'btnRInactive' : 'btnRActive';
	btnM.className = (btnM.className == 'btnActive') ? 'btnInactive' : 'btnActive';
	}
// --- END --- Traer los ID's de las celdas para cambiarles el nombre al CLASS ----------------------------

//--- START Función que abre un link en una pagina nueva---------------------------------------------------
function openInBlank(url){
	var newWindow = window.open(url,"_blank","width=810,height=550,left=10,top=10,location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes");
}
//--- End -------------------------------------------------------------------------------------------------

//--- START Función que abre un link en una pagina nueva---------------------------------------------------
function openInBlankAll(url){
	var newWindow = window.open(url,"_blank","width=810,height=550,left=1,top=1,location=no,menubar=no,status=no,resizable=yes,toolbar=no,scrollbars=yes");
}
//--- End -------------------------------------------------------------------------------------------------

//--- START Función que abre un link en una pagina nueva---------------------------------------------------
function openInPopUp(url){
	var newWindow = window.open(url,"_blank","width=300,height=370,left=300,top=150,location=no,menubar=no,status=no,resizable=no,toolbar=no,scrollbars=no");
}
//--- End -------------------------------------------------------------------------------------------------


//--- START ---Función que Borra el formulario-------------------------------------------------------------
function clearForm(){
	if(confirm("¿Esta seguro que desea borrar todos los campos del formulario?")){
		document.forms[0].reset();
		}
}
//--- End -------------------------------------------------------------------------------------------------

//--- START ---Función que Envía el formulario de la página------------------------------------------------
function doSubmit(formIndex){
	document.forms[formIndex].submit();
}
//--- End -------------------------------------------------------------------------------------------------

//--- START Función que abre un link en la página de upload---------------------------------------------------
function NewUpload(egestion){
	var url = "upload.php?t=egestion&id="+egestion;
	var wupload = window.open(url,"_wupload","width=450,height=550,left=150,top=100,location=no,menubar=no,status=no,resizable=yes,toolbar=no,scrollbars=yes");
}
//--- End -------------------------------------------------------------------------------------------------//--- START ---Función para navegar entre el asistente de documentos------------------------------------------------
function SelectArchivero(parametros){
	document.upload.action = "upload.php?"+parametros;
	document.upload.submit();
}
//--- End -------------------------------------------------------------------------------------------------

//Función qu controla el pop up de fecha
function SetDate(field){
	var url = "calendar.php?c="+field;
	var _fecha = window.open(url,"_fecha","width=205,height=214,left=300,top=100,location=no,menubar=no,status=no,resizable=yes,toolbar=no,scrollbars=no");
}
//--- End -------------------------------------------------------------------------------------------------

//Función para explorar las acciones de una instrucción
function DetailIns(){
	var campo = document.forms[0].id_instruccion.value;
	var explota = campo.split("|");
	var id = explota[0];
	var porcentaje = explota[1];
	document.forms[0].porcentaje_global.value = porcentaje;
	document.forms[0].porcentaje_global_new.value = porcentaje;
	if(porcentaje=="100.0"){
		alert('Ya no puede agregar acciones a esta instrucción ya que tiene un nivel de 100%');
		document.forms[0].enviar.disabled = true;
	}else{		
		var url = "inst_detail.php?id="+id;
		document.all.idetail.src= url;
		document.forms[0].enviar.disabled = false;
	}
}
//--- End -------------------------------------------------------------------------------------------------

//Función para sumar valores
function SetPecent(field1,field2,fieldr){
	var value1 = new Number(field1.value);
	var value2 = new Number(field2.value);
	var valueT = value1 + value2;
	fieldr.value = valueT;
}
//--- End -------------------------------------------------------------------------------------------------

// --- START --- Función que valida los radios de un formulario dinámico -----------------------------
function validateDRadios(){
	// Variables de la función
	var inputsColl = document.getElementsByTagName('input');
	var hiddensColl = new Array();
	var cont = 0;
	var flag = 0;
	var doSubmit = "";
	// Creación de Array hiddensColl, que contiene los strings de los nombres de las colecciones de radios
	for(i=0; i<inputsColl.length; i++){
		if(inputsColl[i].type == "hidden"){
			hiddensColl[cont] = inputsColl[i].id;
			cont++;
		}
	}
	// Barrido del Array para validar que esten chequeados todos los radio-groups
	for(j=0; j<hiddensColl.length; j++){
		var currentItem = document.getElementsByName(hiddensColl[j]);
		for(x=0; x<currentItem.length; x++){
			if(currentItem[x].checked == true){
				flag = 1;
				break;
			}
			else{
				flag=  0;
			}
		}
		if(flag == 0){
			var idP = hiddensColl[j];
			var idPregunta = document.getElementById(idP);
			alert("No respondió la pregunta No. "+ idPregunta.name);
			//alert("No respondió la "+hiddensColl[j].substr(0,hiddensColl[j].length));
			break;
		}
	}
	if(flag == 1){
		// Si todos los radio-groups estan checheados hace Submit
		document.forms[0].submit();
	}
}
// --- END -------------------------------------------------------------------------------------------------
function resetForm(){
	if(confirm("¿Esta seguro que desea borrar el formulario?")){
		document.forms[0].reset();
	}
}
// - Recibe dos parámetros txtField = "nombre del campo" y apply = "número de implementación"
function setMySQLDate(txtField,apply){
	var d = "dia"+apply;
	var m = "mes"+apply;
	var a = "anyo"+apply;
	
	var txt = document.getElementById(txtField);
	var dia = document.getElementById(d).value;
	var mes = document.getElementById(m).value;
	var anyo = document.getElementById(a).value;
	
	txt.value = anyo+"-"+mes+"-"+dia;
}
// --- END ------------------------------------------------------------------------------------------------
////--- Funcion que muestra un elemneto a display true
function showElemento(idElemento){
	var elemento = document.getElementById(idElemento);
	elemento.style.visibility = "visible";
}
///---- END ------------------------------------------------------------------------------------------
///- Valida Mail
function validaMail(idCampo){
	var campMail = document.getElementById("mail_txt").value;
	var arrobaValida = campMail.indexOf("@");
	var puntoValido = campMail.indexOf(".");
	if (campMail==""){
		alert("Escriba una cuenta de correo electrónico válido...");
		return (false); 
	}else{
		if(arrobaValida== -1){
			alert("Escriba una cuenta de correo electrónico válido...\n Falta el @");	
			return (false);
		}else{
			if(puntoValido== -1){
				alert("Escriba una cuenta de correo electrónico válido...");	
			}else{
				return (true);
			}
		}
	}
}
///--- END -----------------------------------------------------------------------------------------
///-- Funcion que valida el campo de respuesta secreta
function validaResp(idResp,resp2Id){
	var resp = document.getElementById(idResp).value;
	var radio2 = document.getElementById(resp2Id).checked;
	if(radio2){
		if(resp!=""){
			document.forms[0].submit();	
		}else{
			alert("Escriba su respuesta secreta!!!");	
		}
	}else{
		document.forms[0].submit();	
	}
}
///--- END -----------------------------------------------------------------------------------------
///-- Funcion que valida las claves de acceso al ser cambiadas
function validaClaves(idNick,Clave1,Clave2){
	var nick = document.getElementById(idNick).value;	
	var c1 = document.getElementById(Clave1).value;	
	var c2 = document.getElementById(Clave2).value;
	if(nick=="" || c1=="" || c2==""){
		alert("Debe de llenar todos los campos para poder cambiar sus claves de acceso!!!");	
	}else{
		if(c1==c2){
			document.forms[0].submit();
		}else{
			alert("Los dos campos de contraseña deben ser exactamente iguales!!!");
		}
	}
}
///--- END -----------------------------------------------------------------------------------------
/////// Start ---- Funcion para buscar usuarios Por Nombre En AJAX
function ajaxSearchSocios(){
	var c1 = document.getElementById("nombre");
	var c2 = document.getElementById("paterno");
	var c3 = document.getElementById("materno");
	llamarasincrono('ajax/ajaxRealSearchSocios.php?n1='+c1.value+'&n2='+c2.value+'&n3='+c3.value,'resultSearchUsers');
}
/////-----------END-------------------------------------------------------------------------------------------
///---- Funcion que muestra la cedula profesionla de un socio en un confirm
showCedula = function(campoCedula,idSocio){
	var cedula = document.getElementById(campoCedula);
	var b1 = document.getElementById('continua');
	var evento = document.getElementById('idEvento');
	if(confirm("¿Es esta su cédula profesional correcta?\n\n"+cedula.value)){
		//llamarasincrono('modules/ajaxValidaInscripcionInevent.php?id_evento='+evento.value+'&idSocio='+idSocio,'validEventoInsc_'+idSocio);
		b1.style.display = 'inline';
	}else{
		alert("Le pedimos que llame a los teléfonos de Alianza Médica en donde será atendido por nuestro Centro de Atención Personalizada (CAP)\n\n53.74.99.60 DF y área metropolitana\n01800 215 3559 Lada sin costo del interior de la república");
		b1.style.display = 'none';
	}
} 
//// ------------END------------------------------------------------------------------------------------------
////--- Funcion AJAX -------------------------------------------------------------------------------------
// Esta función cargará las paginas
function llamarasincrono(url, id_contenedor,mist){
	
	if(mist){
		showMist();
	}
var pagina_requerida = false

if (window.XMLHttpRequest) {// Si es Mozilla, Safari etc
pagina_requerida = new XMLHttpRequest()
} else if (window.ActiveXObject){ // pero si es IE
try {
pagina_requerida = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){ // en caso que sea una versión antigua
try{
pagina_requerida = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
pagina_requerida.onreadystatechange=function(){ // función de respuesta
cargarpagina(pagina_requerida, id_contenedor)
}
pagina_requerida.open('GET', url, true) // asignamos los métodos open y send
pagina_requerida.send(null)
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina(pagina_requerida, id_contenedor){
	//var PaginaShow;
if (pagina_requerida.readyState == 4 && (pagina_requerida.status==200 || window.location.href.indexOf("http")==-1))
	if(pagina_requerida.responseText!='undefined'){
	var PaginaShow = unescape(pagina_requerida.responseText);
	var PaginaShowFinal = PaginaShow.replace(/\+/gi," ");
	
	//document.getElementById(id_contenedor).innerHTML=PaginaShowFinal;
	//if(mist){
		//resetMist();
	//}
	document.getElementById(id_contenedor).innerHTML=PaginaShowFinal;
	//document.getElementById(id_contenedor).innerHTML=pagina_requerida.responseText;
	}
}
/////-----------END-------------------------------------------------------------------------------------------
// --- START --- Función para mostrar la niebla y el loader -
function showMist(){
	
// --- Variables - 
	// - Asignación el div de la niebla
	var mistDiv = document.getElementById('mist');
	// - Asignación el div del loader
	var loaderDiv = document.getElementById('loader');
	// - Asignación el ancho del cliente
	var docWidth = document.documentElement.clientWidth;
	// - Asignación el alto del cliente
	var docHeight = document.documentElement.clientHeight;
	// - Asignación el alto del documento
	var docTotalHeight = document.body.scrollHeight;
// --- Mostrar niebla -
	// - Si el alto del del documento es mayor al alto del cliente
	if(docHeight > docTotalHeight){
		mistDiv.style.height = docHeight+"px";
	}else{
		mistDiv.style.height = docTotalHeight+30+"px";
	}
	mistDiv.style.width = docWidth+"px";
	mistDiv.style.visibility = "visible";
	// - Mostrar loader 
	loaderDiv.style.visibility = "visible";
	loaderDiv.style.left = docWidth/2-75+"px";
	loaderDiv.style.top = docHeight/2-100+"px";
}
// --- END ---
// --- START --- Función para redimesionar la niebla y reacomodar el loader -
function resizeMist(){
// --- Variables - 
	// - Asignación el div de la niebla
	var mistDiv = document.getElementById('mist');
	// - Asignación el div del loader
	var loaderDiv = document.getElementById('loader');
	// - Asignación el ancho del cliente
	var docWidth = document.documentElement.clientWidth;
	// - Asignación el alto del cliente
	var docHeight = document.documentElement.clientHeight;
	// - Asignación el alto del documento
	var docTotalHeight = document.body.scrollHeight;
// --- Reacomodar niebla -
	// - Si el alto del del documento es mayor al alto del cliente
	if(docHeight > docTotalHeight){
		mistDiv.style.height = docHeight+"px";
	}else{
		mistDiv.style.height = docTotalHeight+30+"px";
	}
	mistDiv.style.width = docWidth+"px";
	// - Reacomodar loader -
	loaderDiv.style.left = docWidth/2-75+"px";
	loaderDiv.style.top = docHeight/2-100+"px";
}
// --- START --- Función para ocultar la niebla y el loader -
function resetMist(){
// --- Variables - 
	// - Asignación el div de la niebla
	var mistDiv = document.getElementById('mist');
	// - Asignación el div del loader
	var loaderDiv = document.getElementById('loader');
	// - Ocultar niebla 
	mistDiv.style.width = "0px";
	mistDiv.style.height = "0px";
	mistDiv.style.visibility = "hidden";
	// - Ocultar loader 
	loaderDiv.style.visibility = "hidden";
	loaderDiv.style.left = "0px";
	loaderDiv.style.top = "0px";
}
// --- END ---
//// ---- funcion Ajax Sin el MIST 
// Esta función cargará las paginas
function ajaxSinMist(url, id_contenedor)
{
	//showMist();
	var noCache = 1+Math.round(Math.random()*99999999999999999);
	url = url+"&nocache="+noCache;
	
	var pagina_requerida = false
	if (window.XMLHttpRequest) 
	{
		// Si es Mozilla, Safari etc
		pagina_requerida = new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{ // pero si es IE
		try 
		{
			pagina_requerida = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e)
		{
			// en caso que sea una versión antigua
			try
			{
				pagina_requerida = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e)
			{
			}
		}
	}
	else
	{
		return false
	}
	pagina_requerida.onreadystatechange=function()
	{ // función de respuesta}
		//alert(pagina_requerida.readyState);
		//alert(pagina_requerida.status);
		cargarpagina(pagina_requerida, id_contenedor)
	}
	pagina_requerida.open('GET', url, true) // asignamos los métodos open y send
	pagina_requerida.send(null)
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina1(pagina_requerida, id_contenedor)
{
	//var PaginaShow;
	if (pagina_requerida.readyState == 4 && (pagina_requerida.status==200 || window.location.href.indexOf("http")==-1))
	if(pagina_requerida.responseText!='undefined'){
	var PaginaShow = unescape(pagina_requerida.responseText);
	var PaginaShowFinal = PaginaShow.replace(/\+/gi," ");
	
	document.getElementById(id_contenedor).innerHTML=PaginaShowFinal;
	//resetMist();
	//document.getElementById(id_contenedor).innerHTML=pagina_requerida.responseText;
	}
}
/////-----------END-------------------------------------------------------------------------------------------
/////////////// START ----------- Envio de Fomrularios Via POST con AJAT's
function enviarFormularioResponse(url, formid){
	showMist();
         var Formulario1 = document.getElementById(formid); 
         var longitudFormulario1 = Formulario1.elements.length; 
         var cadenaFormulario1 = ""; 
         var sepCampos1;
		 var peticion1 = false
		 var seEnvio1 = true;
	if (window.XMLHttpRequest) {// Si es Mozilla, Safari etc
	peticion1 = new XMLHttpRequest()
	} else if (window.ActiveXObject){ // pero si es IE
		try {
		peticion1 = new ActiveXObject("Msxml2.XMLHTTP")
	} 
		catch (e){ // en caso que sea una versión antigua
		try{
		peticion1 = new ActiveXObject("Microsoft.XMLHTTP")
	}
		catch (e){}
	}
}
else
//return false
         sepCampos1 = "" 
         for (var i=0; i < Formulario1.elements.length;i++) { 
			 cadenaFormulario1 += sepCampos1+Formulario1.elements[i].name+'='+escape(Formulario1.elements[i].value); 
			 sepCampos1="&"; 
		} 
		  peticion1.open("POST", url, true); 
		  peticion1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1'); 
		  peticion1.send(cadenaFormulario1); 
  		  peticion1.onreadystatechange = function () { 
		 if (peticion1.readyState == 4) {
			 resetMist();
			 var resultados = unescape(peticion1.responseText);
			 var resultadosshowInPage = resultados.replace(/\+/gi," ");
		 	document.getElementById('results').innerHTML = resultadosshowInPage;
			if(peticion1.responseText!='undefined'){
				//return seEnvio;
				//return peticion.responseText;
			}
			//return seEnvio;
		} 
	} 
	
}
// --- END ----------------------------------------------------------------------------------------------
///// Funcion que trae el codigo postal
function getAsentamiento(cpText,idTable){
	var t1 = document.getElementById(cpText);
	var cpValido = parseInt(t1.value.length);
	if(cpValido==5){
		llamarasincrono('ajax/getAsentamientos.php?codigoPostal='+t1.value,idTable);
	}
}
// --- END ----------------------------------------------------------------------------------------------
///// Funcion que trae el codigo postal
function getAsentamientoProm(cpText,idTable){
	var t1 = document.getElementById(cpText);
	var cpValido = parseInt(t1.value.length);
	if (t1.value!=""){
		if(cpValido==5){
			llamarasincrono('ajax/getAsentamientos.php?codigoPostal='+t1.value,idTable);
		}
	}else{
		alert("EScriba su código postal");
	}
}
// --- END ----------------------------------------------------------------------------------------------
/*Funcion que Valida los Radios de las ONGs*/
function validaRadiosOngs(){
	var radiosOngs = document.getElementsByName("ong");
	var existeListado = document.getElementById("noExist");
	if(existeListado.value=="true"){
	for(var i=0;i<radiosOngs.length;i++){
		if(radiosOngs[i].checked){
			return true;
			break;	
		}
	}
	}else{
		return true;
	}
}
// --- END ----------------------------------------------------------------------------------------------
/////////funcion que valida el fomrulario de inscripcion por beca
function validaInscripcionBecada(){
	var validos = new Array();
	var envia = true;
	validos[0] = {Valor:false,Str:"Debe de Especificar si pertenece a una ONG o no"};
	validos[1] = {Valor:false,Str:"Debe de escribir el nombre de su ONG"};
	validos[2] = {Valor:true,Str:"Debe de seleccionar una ONG o Agregar una nueva"};
	validos[3] = {Valor:true,Str:"Debe de escribir el nombre de la ONG que desea agregar"};
	validos[4] = {Valor:true,Str:"Debe de escribir la CLUNI de la ONG que desea agregar"};
	validos[5] = {Valor:false,Str:"Debe de escribir su nombre en el campo Nombre"};
	validos[6] = {Valor:false,Str:"Debe de escribir su Apellido Paterno en el campo Apellido Paterno"};
	validos[7] = {Valor:false,Str:"Debe de escribir su Apellido Materno en el campo Apellido Materno"};
	validos[8] = {Valor:false,Str:"Debe seleccionar su Sexo"};
	validos[9] = {Valor:false,Str:"Debe seleccionar el tipo de identificación que nos dejará"};
	validos[10] = {Valor:false,Str:"Escriba el No. De Identificación"};
	validos[11] = {Valor:false,Str:"Escriba Su Lada"};
	validos[12] = {Valor:false,Str:"Escriba Su Número Telefonico"};
	validos[13] = {Valor:false,Str:"Escriba Su Email"};
	validos[14] = {Valor:false,Str:"Debe de escribir su calle y número"};
	validos[15] = {Valor:false,Str:"Debe de escribir su código postal"};
	validos[16] = {Valor:false,Str:"Debe seleccionar su asentamiento"};
	validos[17] = {Valor:false,Str:"Debe de especificar el nombre de usuario con el cual desea ingresar a PBP"};
	validos[18] = {Valor:false,Str:"Debe de especificar la contraseña con la cual desea ingresar a PBP"};
	var radios1 = document.getElementsByName("ongExist");
	var nameSearxhOng = document.getElementById("nameOng");
	var nuevaOng;
	nuevaOng = document.getElementById("newOng");
	var contentSearchOng = document.getElementById("searchOng");
	var namePerson = document.getElementById("nombre");
	var paternoPerson = document.getElementById("paterno");
	var maternoPerson = document.getElementById("materno");
	var sexoRadios = document.getElementsByName("sexo");
	var tipoIdentifica = document.getElementById("tipoIdentificacion");
	var identificaNum = document.getElementById("identificacion");
	var ladaNum = document.getElementById("lada");
	var telNum = document.getElementById("telefono");
	var strMail = document.getElementById("email");
	var strCalleNum = document.getElementById("domicilio");
	var cpNumber = document.getElementById("codigoPos");
	var acentaId = document.getElementById("asentamiento");
	var usrStr = document.getElementById("usr");
	var passStr = document.getElementById("clave");
	/*Aqui validamos los campos de texto*/
	if(namePerson.value!=""){
		validos[5].Valor = true;
	}
	if(paternoPerson.value!=""){
		validos[6].Valor = true;
	}
	if(maternoPerson.value!=""){
		validos[7].Valor = true;
	}
	for(var s=0;s<sexoRadios.length;s++){
		if(sexoRadios[s].checked){
			validos[8].Valor = true;
			break;
		}	
	}
	if(tipoIdentifica.value!=""){
		validos[9].Valor = true;
	}
	if(identificaNum.value!=""){
		validos[10].Valor = true;
	}
	if(ladaNum.value!=""){
		validos[11].Valor = true;
	}
	if(telNum.value!=""){
		validos[12].Valor = true;
	}
	if(strMail.value!=""){
		validos[13].Valor = true;
	}
	if(strCalleNum.value!=""){
		validos[14].Valor = true;
	}
	if(cpNumber.value!=""){
		validos[15].Valor = true;
	}
	if(acentaId.value!=""){
		validos[16].Valor = true;	
	}
	if(usrStr.value!=""){
		validos[17].Valor = true;
	}
	if(passStr.value!=""){
		validos[18].Valor = true;
	}
	/*Aqui validamos por si se va a agregar una ONG Nueva*/
	if(nuevaOng!=null && contentSearchOng.style.display != 'none'){
		validos[3].Valor = false;
		validos[4].Valor = false;
		var nameNewOng = document.getElementById("ongName");
		var cluniNew = document.getElementById("cluni");
		if(nameNewOng.value !=""){
			validos[3].Valor = true;
		}
		if(cluniNew.value !=""){
			validos[4].Valor = true;
		}
	}
	/*Validacion 1*/
	if(contentSearchOng.style.display != 'none'){
	if(nameSearxhOng.value!=""){
		validos[1].Valor = true;
	}
	}else{
		validos[1].Valor = true;
	}
	/*Validacion 0  y 2*/
	for(var i = 0;i<radios1.length;i++){
		if(radios1[i].checked){
			validos[0].Valor = true;
			if(radios1[i].value==1){
				validos[2].Valor = false
				if(validaRadiosOngs()){
					validos[2].Valor = true;
				}
			}
			break;	
		}
	}
	/*Aqui validamos todo el array de elementos*/
	var totalValidos = validos.length;
	for(var j=0;j<totalValidos;j++){
		if(!validos[j].Valor){
			envia = false;
			alert(validos[j].Str);
			break;	
		}	
	}
	if(envia){
		document.forms[0].submit();	
	}
}
// --- END ----------------------------------------------------------------------------------------------
/*Funcioqne que vuelve a mostrar los comentarios*/
function reloadComents(confId){
	llamarasincrono("../ajax/blogByConf.php?conferencia="+confId,"showblog",false);
	//alert("cargaaaaaaaaaaa");
}
// --- END ----------------------------------------------------------------------------------------------
/*Funcion que envia el comentario de la conferencia*/
function sendComment(conf){
	var c1 = document.getElementById("campodeComentario");
	if(c1.value!=""){
		enviarFormularioResponse('setComentInconf.php', 'enviacoment');
		setTimeout("reloadComents('"+conf+"')",4000);
	}else{
		alert('Debe de escribir un comentario');	
	}
}
// --- END ----------------------------------------------------------------------------------------------
////////////funcion para cambiar el fondo del TD
function fCambiaColorTD(pObj, pColorNuevo) 
{
                pObj.style.backgroundColor = pColorNuevo;
}
// --- END ----------------------------------------------------------------------------------------------
/*Funcion que llama a pagina en AJAX desde una busqueda por elimincacion*/
function getOngByName(strName){
	if(strName.length>3){
		var randomnumber=Math.floor(Math.random()*11);
		var URL = 'ajax/getAllOngsByName.php?ongName='+strName+'&noCache='+randomnumber;
		llamarasincrono(URL,'showOngs',false);
	}
	
}
/*// --- END ----------------------------------------------------------------------------------------------*/
/*Funcion que muestra un elemento asegun el valor del parametro accion*/
function showHideElemento(valueAction,elemento){
	var c1 = document.getElementById(elemento);
	if(valueAction==1){
		c1.style.display = 'inline';	
	}
	if(valueAction==0){
		c1.style.display = 'none';
	}
}
/*// --- END ----------------------------------------------------------------------------------------------*/
/*Funcion que muestra el formulario de nueva ONG y oculta la busqueda de Ong*/
function showFormOng(){
	var URL1 = 'ajax/newOng.php';
	llamarasincrono(URL1,'showOngs',true);
}
/*// --- END ----------------------------------------------------------------------------------------------*/
/*Funcion que replica el Value en otro campo*/
function replyValue(campo1,campo2){
	var c1 = document.getElementById(campo1);
	var c2 = document.getElementById(campo2);
	c2.value = c1.value;
}
/*// --- END ----------------------------------------------------------------------------------------------*/
/*Funcion que valida el formulario del BLOG*/
function validaFormBlog(){
	var oC1 = document.getElementById('titulo');
	var oC2 = document.getElementById('comentario');
	if(oC1.value == "" || oC2.value==""){
		alert("ERROR\nDebe de escribir un titulo y un comentario para poder enviar la información");	
	}else{
		document.forms[0].submit();
	}
}
/*// --- END ----------------------------------------------------------------------------------------------*/
//-- Validacion de Formulario de Adicion de Conferecnia-----------
function validaForm(indexForm){
	var inputElements = document.getElementsByTagName('input');
	var selectElements = document.getElementsByTagName('select');
	var textAreas = document.getElementsByTagName('textarea');
	var totalInputs = inputElements.length;
	var totalSelects = selectElements.length;
	var totalTextAreas = textAreas.length;
	v = 0;
	for(i=0;i<totalInputs;i++){
		if(inputElements[i].value==""){
			//inputElements[i].select = true;
			alert("Falta Dato en el campo: "+inputElements[i].name);
			break;
		}
	}
	if(i==totalInputs){	
	for(j=0;j<totalSelects;j++){
		if(selectElements[j].value==0){
			//inputElements[i].select = true;
				alert("Falta Dato en el campo: "+selectElements[j].name);
				break;
			}else{
				v++;	
			}
		}
	}
	if(v==totalSelects){
		document.forms[indexForm].submit();	
	}
}
//--- END -----------------------------------------------------------------------------------------------
// --- START --- Muestra y/u oculta contenidos ------------------------------------------------------------
/*function login(){
	//alert("keke");
		if(formLogin.style.display == 'none'){
			formLogin.style.display = 'inline';
		}else{
			formLogin.style.display = 'none';
		}
}
/* ----------------------------------------------------------------- 
function login2(){
	//alert("keke");
		if(formLogin.style.display == 'none'){
			formLogin.style.display = 'inline';
		}else{
			formLogin.style.display = 'none';
		}
}
/* ----------------------------------------------------------------- */

/* validamos el login*/
function validaLogin(){
	var sUsuario = $('#usuario').val();
	var sPass = $('#contrasena').val();
	var noCache = 1+Math.round(Math.random()*99999999999999999);
	if(sUsuario != "" && sPass != ""){
		document.ingresa.submit();
	}else{
		alert("ERROR!!!\nDebe de escribir su usuario y contraseña");	
	}
}
// --- START --- Función que elimina los caracteres alfabéticos de un capo de texto --------------------
function justNumbers(fieldName){
	var allowedKeys = new Array("0","1","2","3","4","5","6","7","8","9");
	var contentArray = new Array();
	var finalArray = new Array();
	var fieldContent = fieldName.value;
	var cont = 0;
	var filteredContent = "";
	
	// Creación de un arreglo con los caracteres del campo de texto
	for(i=0; i<=fieldContent.length; i++){
		contentArray[i] = fieldContent.substring(i,i+1);
	}
	
	for(j=0; j<=contentArray.length; j++){
		for(x=0; x<=allowedKeys.length; x++){
			if(contentArray[j] == allowedKeys[x]){
				finalArray[cont] = contentArray[j];
				cont++;
			}
		}
	}

	for(z=0; z<=finalArray.length-2; z++){
		filteredContent += finalArray[z];
	}
	fieldName.value = filteredContent;
}
// --- END ----------------------------------------------------------------------------------------------

/* código para mostrar las cuotas, estados ys edes de los eventos */
function agregarCuotasEstados(oIdCurso) 
{
  var idCurso=document.getElementById('id_curso').value;
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  
  var URL = '../ajax/cuotas.php?id_curso='+idCurso+'&noCache='+randomnumber;
  llamarasincrono(URL,'showCostos',false);
	
  var URL1 = '../ajax/estados.php?id_curso='+idCurso+'&noCache='+randomnumber;
  llamarasincrono(URL1,'showEstados',false);
}

/* código para llenar los municipios de el curso */
function agregarMunicipios(oIdEdo) 
{
  var idEstado=document.getElementById('estado').value;
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../ajax/municipios.php?id_estado='+idEstado+'&noCache='+randomnumber;
  llamarasincrono(URL,'muestraMunicipios',false);
  
}
/* código para llenar las sedes de el curso */
function agregarSedes(estado,oIdCurso) 
{
  var idEstado=document.getElementById('id_estado').value;  
  var idCurso=document.getElementById('id_curso').value;
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../ajax/sedes.php?id_estado='+idEstado+'&id_curso='+idCurso+'&noCache='+randomnumber;
  llamarasincrono(URL,'muestraSedes',false);
}
/* ------------------------------------------ */

/* valido el formualrio de captura promotores */
function valFormPromotor(formulario){
	var elementosForm = new Array();
	var envia = true;
	elementosForm[0] = {Label:"Campo vacio: Apellido paterno",Elemento:document.getElementById('ap_paterno')};
	elementosForm[1] = {Label:"Campo vacio: Apellido materno",Elemento:document.getElementById('ap_materno')};
	elementosForm[2] = {Label:"Campo vacio: Nombre",Elemento:document.getElementById('nombre')};
	elementosForm[3] = {Label:"Campo vacio: Domicilio",Elemento:document.getElementById('domicilio')};
	elementosForm[4] = {Label:"Campo vacio: Codigo Postal",Elemento:document.getElementById('codigoPos')};
	elementosForm[5] = {Label:"Campo vacio: Colonia",Elemento:document.getElementById('id_asentamiento')};
	elementosForm[6] = {Label:"Campo vacio: Telefono de Casa",Elemento:document.getElementById('tel_casa')};
	elementosForm[7] = {Label:"Campo vacio: E-mail",Elemento:document.getElementById('correo')};
	elementosForm[8] = {Label:"Campo vacio: Usuario",Elemento:document.getElementById('nick')};
	elementosForm[9] = {Label:"Campo vacio: Contrasena",Elemento:document.getElementById('clave')};
	elementosForm[10] = {Label:"Campo vacio: Genero",Elemento:document.getElementById('sexo')};
	elementosForm[11] = {Label:"Campo vacio: Profesion",Elemento:document.getElementById('idProfesion')};
	elementosForm[12] = {Label:"Campo vacio: Identificacion",Elemento:document.getElementById('identificacion')};
	elementosForm[13] = {Label:"Campo vacio: No. de Identificacion",Elemento:document.getElementById('valor_identificacion')};
	elementosForm[14] = {Label:"Campo vacio: Estado",Elemento:document.getElementById('id_estado')};
	var totalElementos = elementosForm.length;
	for(var i=0;i<totalElementos;i++){
		if(elementosForm[i].Elemento.value==""){
			alert(elementosForm[i].Label);
			return (false); 
			break; 	
		}	
	}
    if ((document.getElementById('correo').value.indexOf ('@', 0) == -1)||(document.getElementById('correo').length < 5)) { 
		 alert("Escriba una dirección de correo válida en el campo \"Correo electrónico\"."); 
		return (false); 
	}
	  var x = $(":radio:checked").length;
      var iRadio = parseInt(x,10);
	  if (iRadio==" " ){
		  alert("Por favor seleccione un grupo");
		  return (false);
	  }

}
/*
$(document).ready(function(){
   $("#10").click(function(evento){
      if ($("#10").attr("checked")){
         $("#10").css("display", "block");
		 //$("#voluntarios").css("display", "none");
		 //$("#promotores").css("display", "none");
      }
   });
});*/
/*function enviaFormMensaje(){
	var nombre=document.getElementById('nombre').value;
	var email=document.getElementById('email').value;
	var comentarios=document.getElementById('comentarios').value;
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	if (nombre == "" || email == "" || comentarios == ""){
		alert("ERROR!!!\nFavor de completar todos los datos...");
	}else{
		var URL = 'comentarios.php?nombre='+nombre+'&email='+email+'&comentarios='+comentarios+'&noCache='+randomnumber;
		llamarasincrono(URL,'enviaForm',false);
	}
}
 SE ELIMINÓ PORQUE CAMBIÓ EL FORMULARIO DE PROMOTORES EN EL LISTADO DE LOS GRUPOS NO APLICA
function activeTextBox(){
	document.getElementById('grupo').disabled=false;
}
*/
function showMyGroup(){
	var id_estado=document.getElementById('id_estado').value;
	/*var textSearch=document.getElementById('grupo').value;
	var divToShow = document.getElementById('ShowSerachGroup');*/
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	/*if (textSearch == ""){
		divToShow.style.display = 'none';
	}else{
		divToShow.style.display = 'inline';*/
		var URL = 'ajax/searchGroup.php?id_estado='+id_estado+'&noCache='+randomnumber;
		llamarasincrono(URL,'ShowSerachGroup',false);
	//}
}

/* codigo para validar formualrio CAP por ajax */
function validaRegistroCAP(formulario){
	var elementosForm = new Array();
	var envia = true;
	elementosForm[0] = {Label:"Campo vacio: Apellido paterno",Elemento:document.getElementById('ap_paterno')};
	elementosForm[1] = {Label:"Campo vacio: Apellido materno",Elemento:document.getElementById('ap_materno')};
	elementosForm[2] = {Label:"Campo vacio: Nombre",Elemento:document.getElementById('nombre')};
	elementosForm[3] = {Label:"Campo vacio: Profesion",Elemento:document.getElementById('idProfesion')};
	elementosForm[4] = {Label:"Campo vacio: Indentificacion",Elemento:document.getElementById('identificacion')};
	elementosForm[5] = {Label:"Campo vacio: Numero de identificacion",Elemento:document.getElementById('valor_identificacion')};
	elementosForm[6] = {Label:"Campo vacio: Domicilio",Elemento:document.getElementById('domicilio')};
	elementosForm[7] = {Label:"Campo vacio: Codigo Postal",Elemento:document.getElementById('codigoPos')};
	elementosForm[8] = {Label:"Campo vacio: Asentamiento",Elemento:document.getElementById('id_asentamiento')};
	elementosForm[9] = {Label:"Campo vacio: Telefono de Casa",Elemento:document.getElementById('tel_casa')};
	elementosForm[10] = {Label:"Campo vacio: Telefono de Oficina",Elemento:document.getElementById('tel_ofna')};
	elementosForm[11] = {Label:"Campo vacio: Correo electronico",Elemento:document.getElementById('correo')};
	elementosForm[12] = {Label:"Campo vacio: Nick",Elemento:document.getElementById('nick')};
	elementosForm[13] = {Label:"Campo vacio: Clave",Elemento:document.getElementById('clave')};
	elementosForm[14] = {Label:"Campo vacio: Genero",Elemento:document.getElementById('sexo')};
	elementosForm[15] = {Label:"Campo vacio: Tipo de usuario",Elemento:document.getElementById('idUser')};
	elementosForm[16] = {Label:"Campo vacio: Curso",Elemento:document.getElementById('id_curso')};
	elementosForm[17] = {Label:"Campo vacio: Cuota",Elemento:document.getElementById('id_cuota')};
	elementosForm[18] = {Label:"Campo vacio: Numero de movimiento",Elemento:document.getElementById('num_movimiento')};
	elementosForm[19] = {Label:"Campo vacio: Observaciones",Elemento:document.getElementById('observaciones')};
	elementosForm[20] = {Label:"Campo vacio: Estado",Elemento:document.getElementById('id_estado')};
	elementosForm[21] = {Label:"Campo vacio: Sede",Elemento:document.getElementById('id_sede')};
	var totalElementos = elementosForm.length;
	for(var i=0;i<totalElementos;i++){
		if(elementosForm[i].Elemento.value==""){
			alert(elementosForm[i].Label);
			return (false); 
			break; 	
		}	
	}
}
/* --------------------------------------------------- */
function desactivaEnter(e){
	tecla = (document.all) ? e.keyCode : e.which;
 	if (tecla==13){
		return (false); 
	}
}
function limpiarData(){
  var divToShow = document.getElementById('detalles');
  divToShow.style.display = 'none';
}

function buscaSocio(ap_paterno,ap_materno,nombre,valor_indentificacion) 
{
	var divToShow = document.getElementById('detalles');
	divToShow.style.display = 'inline';
   var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../ajax/showDataSocio.php?ap_paterno='+ap_paterno+'&ap_materno='+ap_materno+'&nombre='+nombre+'&valor='+valor_indentificacion+'&noCahe='+randomnumber;
  llamarasincrono(URL,'showInfoSocio',false);
}
/* --------------------------------------------------------------- */
/* funciones para buscar socios
/*----------------------------------------------------------------*/
function valSocio(e){
		var ob1=document.getElementById('ap_paterno');
		var ob2=document.getElementById('ap_materno');
		var ob3=document.getElementById('nombre');
		var ob4=document.getElementById('valor_identificacion');
		//limpiarData();
		if (ob1.value!='' || ob2.value!='' || ob3.value !='' || ob4.value !=''){
			buscaSocio(ob1.value,ob2.value,ob3.value,ob4.value);
		}
} // end function 
//------------------------------------------------------------------------------------------------------
/* funciones para mostrar datos del socio */
/* ----------------------------------------------------------------------------------------------------*/
function seleccion(idSocio) 
{
  var divToShow = document.getElementById('detalles');
  divToShow.style.display = 'inline';
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../ajax/AjaxmuestraDatos.php?id='+idSocio+'&noCache='+randomnumber;
  llamarasincrono(URL,'detalles',false);
}
function FillName(nom,paterno,materno) 
{
	document.registro.ap_paterno.value=paterno;
	document.registro.ap_materno.value=materno;
	document.registro.nombre.value=nom;
}
/* ---------------------------------------------------------*/
/*Layer Detalle Edo*/
function DetalleEdo(id){
	var val_layer = document.getElementById('val_layer');
	
	if(val_layer.value==0 ){
		val_layer.value = id;
		}
	else{
			var divToShow = document.getElementById('MuestraEdo'+val_layer.value);
			if(divToShow.style.display == 'none'){
				divToShow.style.display = 'inline';
			}else{
				divToShow.style.display = 'none';
			}
			val_layer.value = id;
		}
		  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
		  var URL = '../ajax/showDetalleEdo.php?id='+id+'&noCahe='+randomnumber;
		  var layer="MuestraEdo"+id;
		  llamarasincrono(URL,layer,false);
	
	}
///// Funcion que trae el codigo postal
function getAsentamiento(cpText,idTable){
	var t1 = document.getElementById(cpText);
	var cpValido = parseInt(t1.value.length);
	if(cpValido==5){
		llamarasincrono('../ajax/getAsentamientos.php?codigoPostal='+t1.value,idTable);
	}
}
///////////////Carga Video	
function CargaVideo(layer_2,URL_destino,layer_muestra){
	//layer_muestra   		: Capa donde se muestra los resultados
	//layer_2 		: Puede ser el contenedor de layer_muestra
	//URL_destino 	: Axas que carga
	  var selectedElement = document.getElementById(layer_2);
	//var btn = document.getElementById('ok_button');
	if(selectedElement){
		  selectedElement.style.display = "inline";
	}
		  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
		  var URL = 'ajax/'+URL_destino+'.php?noCahe='+randomnumber;
		  llamarasincrono(URL,layer_muestra,false);
		 
	}	
function CargaVideoInvasivo(layer_2,URL_destino,layer_muestra,tipoCurso){
	//layer_muestra   		: Capa donde se muestra los resultados
	//layer_2 		: Puede ser el contenedor de layer_muestra
	//URL_destino 	: Axas que carga
	  var selectedElement = document.getElementById(layer_2);
	//var btn = document.getElementById('ok_button');
	if(selectedElement){
		  selectedElement.style.display = "inline";
	}
		  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
		  var URL = 'ajax/'+URL_destino+'.php?idTipoCurso='+tipoCurso+'&noCahe='+randomnumber;
		  llamarasincrono(URL,layer_muestra,false);
		 
	}	
	
function hideElement(elementId){
	var selectedElement = document.getElementById(elementId);
	//var btn = document.getElementById('ok_button');
	selectedElement.style.display = "none";
	//btn.disabled = false;
	 var oTselectedElement = document.getElementById('MVideo');
	 if(oTselectedElement){
		oTselectedElement.style.display = "none";
	 }
}

/*Funcion que llama a la tabla del protocolo 1*/
function callTablaPreguntas(idPregunta,idRespuesta,url,IteradorRespuestas){
	var oGetNumIntegrantes = document.getElementById("respuestaParaPregunta_"+idPregunta+"|"+idRespuesta+"|"+IteradorRespuestas);
	var valor = parseInt(oGetNumIntegrantes.value,10);
	var randomnumber = Math.floor(Math.random()*99999999999999999999999999);
	var URL = url+"?itotalIntegrantes="+valor+"&noCache="+randomnumber;
	if(valor>0){
		llamarasincrono(URL,'forAjax_'+idPregunta+"|"+idRespuesta,false);
	}
}
/*Funcion que muestra el campo de especificar en un combo*/
/*Funcion que muestra el campo de especificar en un combo*/
function getOtro(oCombo,optionOtro){
	var valorCombo = oCombo.value;
	var OpcionParaEspecificar = optionOtro;
	var getIdToShowCampoOtro = oCombo.name.split("_");
	//alert("especificarTxt_"+getIdToShowCampoOtro[1]+"|"+optionOtro);
	var divtoShow = document.getElementById("especificarTxt_"+getIdToShowCampoOtro[1]+"|"+optionOtro);
		divtoShow.style.display = 'none';
	//alert(getIdToShowCampoOtro[1]);
	if(valorCombo==OpcionParaEspecificar){
		divtoShow.style.display = 'inline';
	}
//alert(getIdToShowCampoOtro[1]);
}
/* valido a los promotores */
/* funciones para buscar socios
/* funciones para buscar promotores
/*----------------------------------------------------------------*/
function valSocioPromotor(e){
		var ob1=document.getElementById('ap_paterno');
		var ob2=document.getElementById('ap_materno');
		var ob3=document.getElementById('nombre');
		//limpiarData();
		if (ob1.value!='' || ob2.value!='' || ob3.value !=''){
			document.getElementById('showInfoPromotor').style.display = 'inline';
			buscaPromotor(ob1.value,ob2.value,ob3.value);
		}
} // end function 
//------------------------------------------------------------------------------------------------------
function buscaPromotor(ap_paterno,ap_materno,nombre) 
{
   var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = 'ajax/showDataPromotor.php?ap_paterno='+ap_paterno+'&ap_materno='+ap_materno+'&nombre='+nombre+'&noCahe='+randomnumber;
  llamarasincrono(URL,'showInfoPromotor',false);
}
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
function valComentario(formulario){
	var elementosForm = new Array();
	var envia = true;
	elementosForm[0] = {Label:"Por favor escriba su nombre",Elemento:document.getElementById('nombre')};
	elementosForm[1] = {Label:"Escriba su e-mail",Elemento:document.getElementById('email')};
	elementosForm[2] = {Label:"Escriba su comentario",Elemento:document.getElementById('comentarios')};
	var totalElementos = elementosForm.length;
	for(var i=0;i<totalElementos;i++){
		if(elementosForm[i].Elemento.value==""){
			alert(elementosForm[i].Label);
			return (false); 
			break; 	
		}	
	}
}
function ocultarInfo(){
	document.getElementById('showInfoPromotor').style.display = 'none';
}
/* valido radio seleccionado */
function valRadioVacio(formulario){
  var x = $(":radio:checked").length;
  var iRadio = parseInt(x,10);
  if (iRadio==" " ){
	  alert("Por favor seleccione la opción");
	  return (false);
  }
}

function GrabaComentario(id_blog,id_conferencia){
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	var elem = 'ComentarioBlog_'+id_blog;
	var blog = document.getElementById(elem).value;
	var URL = 'backEnds/setComentblog.php?Coment_blog='+blog+'&id_blog='+id_blog+'&noCahe='+randomnumber;
	//llamarasincrono(URL,'showInfoComent',false);
	llamarasincrono(URL,elem,false);
	setTimeout("reloadComents('"+id_conferencia+"')",1000);

	}
function VerComentarios(id_div)	{
	var elem = 'Leermas_'+id_div;
	alert("id_div "+id_div);
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	var URL = 'backends/LeerBlog.php?id_blog='+id_div+'&noCahe='+randomnumber;
	llamarasincrono(URL,elem,false);
	}
function ShowComentaC(elem){
	var btnNam  ='btnComen_'+elem;
	var formNam ='ComentarioComentados_'+elem;
	if(	document.getElementById(formNam).style.display == "inline"){
		document.getElementById(formNam).style.display = "none";
		document.getElementById(btnNam).value = "Mostrar Comentarios";
		}
	else{
		document.getElementById(formNam).style.display = "inline";
		document.getElementById(btnNam).value = "Ocultar Comentarios";
		}	
	}

/* sedes en las métricas */
function showSedes(estado,oIdCurso) 
{
  var idEstado=document.getElementById('id_estado').value;  
  var idCurso=document.getElementById('id_curso').value;
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../Graficas/ajax/sedes.php?id_estado='+idEstado+'&id_curso='+idCurso+'&noCache='+randomnumber;
  llamarasincrono(URL,'muestraSedes',false);
}
/* ------------------------------------------ */
/* sedes en las métricas */
function showGrafica() 
{
  var idSede=document.getElementById('id_sede').value; 
  var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
  var URL = '../Graficas/ajax/AllInscritosxSede.php?id_sede='+idSede+'&noCache='+randomnumber;
  llamarasincrono(URL,'showGrafica',false);
}
/* ------------------------------------------ */
	/* funcion que obtiene los municipios según el estado seleccionado */
function showMunicipios(idEdo){
	var id_estado = document.getElementById("estado").value;
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	var URL = 'Ajax/municipios.php?idEstado='+id_estado+'&noCache='+randomnumber;
	llamarasincrono(URL,'showMunicipio',false);
}
/* funcion que obtiene las localidades según el municipio seleccionado */
function showLocalidades(idMunic){
	var id_localidad = document.getElementById("id_municipio").value;
	var randomnumber=Math.floor(Math.random()*99999999999999999999999999);
	var URL = 'Ajax/localidades.php?idMunicipio='+id_localidad+'&noCache='+randomnumber;
	llamarasincrono(URL,'showLocalidad',false);
}


