function initAJAXObject(){
	try {         
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");     
	}
	catch (e) {
		try {             
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");         
		}
		catch (E) {             
			xmlhttp = false;         
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {         
		xmlhttp = new XMLHttpRequest();     
	}
	return xmlhttp;
}

function openPopup(url,tag,params){
	object = initAJAXObject();
	object.open("GET",url+"?"+params,true); //abrir procesador
	object.onreadystatechange=function() { //funcion controlador
		if (object.readyState==4) //control de estados del proceso
		{
			//si se da un status 200 (TERMINADO CON EXITO)
			if(object.status==200){               
				popup = object.responseText;
				document.getElementById(tag).innerHTML = popup;
			}
		}
	}                       
	object.send(null); //envío nulo de variables
}

function openPopupNull(url,params){
	object = initAJAXObject();
	object.open("GET",url+"?"+params,true); //abrir procesador
	object.onreadystatechange=function() { //funcion controlador
		if (object.readyState==4) //control de estados del proceso
		{
			//si se da un status 200 (TERMINADO CON EXITO)
			if(object.status==200){               
				popup = object.responseText;
			}
		}
	}                       
	object.send(null); //envío nulo de variables
}

function getINMLocs(url,tag,params){
	object = initAJAXObject();
	object.open("GET",url+"?"+params,true); //abrir procesador
	object.onreadystatechange=function() { //funcion controlador
		if (object.readyState==4) //control de estados del proceso
		{
			//si se da un status 200 (TERMINADO CON EXITO)
			if(object.status==200){               
				popup = object.responseText;
				popup = "<select name='idloc' class='selBlocks' onChange='window.open(\"http://www.inm.es/cgi-bin/locali.cgi?ig=\"+this.options[this.selectedIndex].value,\"_blank\")'>" + popup + "</select>";
				document.getElementById(tag).innerHTML = popup;
			}
		}
	}                       
	object.send(null); //envío nulo de variables
}