var xmlHttp;function CreateXmlHttp(){if(xmlHttp==null){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(oc){xmlHttp=null}}if(!xmlHttp&&typeof XMLHttpRequest!="undefined")xmlHttp=new XMLHttpRequest}return xmlHttp}
function InvocarServidor(url){xmlHttp=CreateXmlHttp();xmlHttp.onreadystatechange=RetornarDeServidor;xmlHttp.open("GET",url,false);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1");xmlHttp.send(null)}function RetornarDeServidor(){if(xmlHttp.readyState==4&&xmlHttp.status==200)return xmlHttp.responseXML}
function CargarCombo(urlOrigen,combo){if(combo!=null){InvocarServidor(urlOrigen);var datos=xmlHttp.responseXML.documentElement;for(var count=combo.options.length-1;count>-1;count--)combo.options[count]=null;var nodo=datos.getElementsByTagName("Item");var textValue;var textTitulo;var optionItem;for(var count=0;count<nodo.length;count++){var opcion=nodo[count];var valor=opcion.getAttribute("Id");var titulo=opcion.getAttribute("Nombre");optionItem=new Option(titulo,valor,false,false);combo.options[combo.length]=
optionItem}}}function CargarProvincias(){var idComunidad=comunidad.value;var provincia=document.getElementById("<%= ddlProvincia.ClientID %>");var paginaActual="<%= this.GetUrlPagina() %>"+"?Comunidad="+idComunidad;InvocarServidor(paginaActual);CargarCombo(provincia,xmlHttp.responseXML.documentElement)};

