function cargarDatos(selEl) {
	var comSel = selEl.options[selEl.selectedIndex].value;
	if(comSel=="INICIO") {
		location.href="don_ant.html";
	} else {
		cargarDatos1(comSel);
	}
}

function cargarDatos1(comSel) {
	var tmpArr = new Array();
	var x = xmlDoc.getElementsByTagName('centro');
	document.getElementById("newData").innerHTML = "<h3>"+comSel+"</h3>";
	for(var i=0; i<x.length; i++) {
		if (x[i].childNodes[0].nodeType != 1) {
			if(x[i].childNodes[1].firstChild.nodeValue==comSel) {
				var tmpLink = "";
				if(x[i].childNodes[11].firstChild.nodeValue!="null")
					tmpLink = "<a href='"+x[i].childNodes[11].firstChild.nodeValue+"' target='_blank'>"+x[i].childNodes[3].firstChild.nodeValue+"</a>";
				else
					tmpLink = x[i].childNodes[3].firstChild.nodeValue;
				var tmpText = "<b>"+tmpLink+"</b><br />"+x[i].childNodes[5].firstChild.nodeValue+"<br />"+x[i].childNodes[7].firstChild.nodeValue+"<br />"+x[i].childNodes[9].firstChild.nodeValue;
				tmpText += "<br /><br />";
				document.getElementById("newData").innerHTML += tmpText.replace(/\*\*\*\*/gi,"<br />");
				
			}
		} else {
			if(x[i].childNodes[0].firstChild.nodeValue==comSel) {
				var tmpLink = "";
				if(x[i].childNodes[5].firstChild.nodeValue!="null")
					tmpLink = "<a href='"+x[i].childNodes[5].firstChild.nodeValue+"' target='_blank'>"+x[i].childNodes[1].firstChild.nodeValue+"</a>";
				else
					tmpLink = x[i].childNodes[1].firstChild.nodeValue;
				var tmpText = "<b>"+tmpLink+"</b><br />"+x[i].childNodes[2].firstChild.nodeValue+"<br />"+x[i].childNodes[3].firstChild.nodeValue+"<br />"+x[i].childNodes[4].firstChild.nodeValue;
				tmpText += "<br /><br />";
				document.getElementById("newData").innerHTML += tmpText.replace(/\*\*\*\*/gi,"<br />");
			}
		}
	}
	document.getElementById("newData").innerHTML += "<br /><br /><a href='don_des.html'><img src='img/consultarotracomunidad.gif' border='0'></a>";
	document.getElementById("imprimir_txt").innerHTML = "<nobr><a href='pdf/don_des/despues_"+comSel.replace(/ /gi,"_").toLowerCase()+".pdf' class='a2' target='_blank'>Imprimir PDF</a>&nbsp;&nbsp;&nbsp; </nobr>";
	document.getElementById("imprimir_img").innerHTML = "<img src='img/imprimir.gif' />&nbsp; "
				
}

function init() {
	importXML("don_des.xml");
}