function jBuscar(frm) { var strTexto = document.getElementById("ctl00_CPH_tbxBusqueda0").value; var strURL='http://www.qdq.com/' + "scripts/QDQResultados.aspx?lang=es&Que=" + strTexto; location.href = strURL; } function jBuscarAvanzada(frm) { var strActividad = document.getElementById("ctl00_CPH_tbxActividad").value; var strNombre = document.getElementById("ctl00_CPH_tbxNombre").value; var strProvincia = document.getElementById("ctl00_CPH_ddlProvincia1").value; var strMunicipio = document.getElementById("ctl00_CPH_ddlMunicipio1").value; var strBarrio = document.getElementById("ctl00_CPH_tbxBarrio").value; var strCalle = document.getElementById("ctl00_CPH_tbxCalle1").value; var strNumero = document.getElementById("ctl00_CPH_tbxNúmero1").value; var strURL='http://www.qdq.com/' + "scripts/QDQResultadosAvanzadas.aspx?lang=es&Que=" + strActividad + "&Quien=" + strNombre+ "&CodProv=" + strProvincia+ "&CodMunicipio=" + strMunicipio+ "&Barrio=" + strBarrio+ "&Calle=" + strCalle+ "&Numero=" + strNumero; location.href = strURL; } function MostrarMapa() { LogTagMi('P', 'RESULT'); } function jLogBanner(sUdac, ref) { LogTagMi(sUdac, ref); } function SelectProvincia(frm, strCodProv, strProv) { LogTagMi('FIL', 'PROV'); document.getElementById("ctl00_CPH_hfCodProvincia").value = strCodProv; document.getElementById("ctl00_CPH_hfProvincia").value = strProv; document.getElementById("ctl00_CPH_hfCodMunicipio").value = ""; document.getElementById("ctl00_CPH_hfMunicipio").value = ""; document.getElementById("ctl00_CPH_hfCodLocalidad").value = ""; document.getElementById("ctl00_CPH_hfLocalidad").value = ""; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfOff").value = "0"; ValidaForm(); } function SelectMunicipio(frm, strCodMunicipio, strMun) { LogTagMi('FIL', 'MUN'); document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfCodMunicipio").value=strCodMunicipio; document.getElementById("ctl00_CPH_hfMunicipio").value=strMun; document.getElementById("ctl00_CPH_hfCodLocalidad").value=""; document.getElementById("ctl00_CPH_hfLocalidad").value=""; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; ValidaForm(); } function SelectLocalidad(frm, strCodLocalidad, strLoc) { LogTagMi('FIL', 'LOC'); document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfCodLocalidad").value=strCodLocalidad; document.getElementById("ctl00_CPH_hfLocalidad").value=strLoc; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; ValidaForm(); } function unSelectNombre(frm) { document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfPag").value="0"; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; ValidaForm(); } function unSelectAll(tipo) { LogTagMi('MIG', 'ALL'); document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfPag").value="0"; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfCodMunicipio").value=''; document.getElementById("ctl00_CPH_hfMunicipio").value=''; document.getElementById("ctl00_CPH_hfCodProvincia").value=''; document.getElementById("ctl00_CPH_hfProvincia").value=''; document.getElementById("ctl00_CPH_hfActividad").value=''; document.getElementById("ctl00_CPH_hfCodActividad").value=''; document.forms[0].action = location.href; document.forms[0].submit(); } function unSelectProvincia(tipo) { LogTagMi('MIG', 'PROV'); document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfPag").value="0"; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfCodMunicipio").value=''; document.getElementById("ctl00_CPH_hfMunicipio").value=''; ValidaForm(); } function unSelectCorrelato(tipo) { LogTagMi('MIG', 'ACT'); document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfPag").value="0"; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfCodMunicipio").value=''; document.getElementById("ctl00_CPH_hfMunicipio").value=''; document.getElementById("ctl00_CPH_hfCodProvincia").value=''; document.getElementById("ctl00_CPH_hfProvincia").value=''; document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; ValidaForm(); } function unSelectMunicipio(tipo) { LogTagMi('MIG', 'PROV'); document.getElementById("ctl00_CPH_hfOff").value='0'; document.getElementById("ctl00_CPH_hfPag").value='0'; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfCodMunicipio").value=''; document.getElementById("ctl00_CPH_hfMunicipio").value=''; document.getElementById("ctl00_CPH_hfRazonSocial").value=''; document.getElementById("ctl00_CPH_hfNumRazonSocial").value=''; ValidaForm(); } function unSelectMunicipioAv() { LogTagMi('MIG', 'PROV'); document.getElementById("ctl00_CPH_hfOff").value='0'; document.getElementById("ctl00_CPH_hfPag").value='0'; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfCodMunicipio").value=''; document.getElementById("ctl00_CPH_hfMunicipio").value=''; ValidaForm2(); } function unSelectLocalidad(tipo) { LogTagMi('MIG', 'MUN'); document.getElementById("ctl00_CPH_hfOff").value='0'; document.getElementById("ctl00_CPH_hfPag").value='0'; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; document.getElementById("ctl00_CPH_hfRazonSocial").value=''; document.getElementById("ctl00_CPH_hfNumRazonSocial").value=''; ValidaForm(); } function unSelectLocalidadAv() { LogTagMi('MIG', 'MUN'); document.getElementById("ctl00_CPH_hfOff").value='0'; document.getElementById("ctl00_CPH_hfPag").value='0'; document.getElementById("ctl00_CPH_hfCodLocalidad").value=''; document.getElementById("ctl00_CPH_hfLocalidad").value=''; ValidaForm2(); } function Natv(frm,strCodAct,strAct,strOrigen) { LogTagMi('FIL', 'ACT'); document.getElementById("ctl00_CPH_hfCodActividad").value=strCodAct; document.getElementById("ctl00_CPH_hfActividad").value=strAct; document.getElementById("ctl00_CPH_hfOff").value="0"; if (strOrigen == "PROXIMIDAD") { if (strCodAct == '99999') { document.getElementById("ctl00_CPH_hfCodActividad").value=''; document.getElementById("ctl00_CPH_hfActividad").value=''; } ValidaFormProximidad(); } if (strOrigen == "FULL") { document.getElementById("ctl00_CPH_hfRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfNumRazonSocial").value = ""; document.getElementById("ctl00_CPH_hfBusquedaTratada").value = ""; document.getElementById("ctl00_CPH_hfQue").value = strAct; var strDonde = ''; if (document.getElementById("ctl00_CPH_hfLocalidad").value == '') { if (document.getElementById("ctl00_CPH_hfMunicipio").value == '') { if (document.getElementById("ctl00_CPH_hfProvincia").value != '') { strDonde = document.getElementById("ctl00_CPH_hfProvincia").value; } } else { strDonde = document.getElementById("ctl00_CPH_hfMunicipio").value; } } else { strDonde = document.getElementById("ctl00_CPH_hfLocalidad").value; } var strActMod = replaceAll1(strAct,'+',' '); document.getElementById("ctl00_CPH_tbxBusqueda0").value = strActMod + ' ' + strDonde; document.getElementById("ctl00_CPH_HiddenField_PreventRazon").value = "1"; ValidaForm(); } if (strOrigen == "AVANZADAS") { document.getElementById("ctl00_CPH_hfCodActividad").value=""; ValidaForm2(); } } function replaceAll1( text, busca, reemplaza ){ while (text.toString().indexOf(busca) != -1){ text = text.toString().replace(busca,reemplaza); } return text;} function seleccionar(act) { var strUrl='http://www.qdq.com/' + "Index.aspx?act=" + act; location.href = strUrl; } function Nave(frm,offset,pagnum) { document.getElementById("ctl00_CPH_hfOff").value = offset; document.getElementById("ctl00_CPH_hfPag").value = pagnum; document.forms[0].action = window.location.href; document.forms[0].submit(); } function SubmitFiltroCallejeroAmbiguedad(urlResuelveAmbiguedad, municipio, calle, numero, cp, x, y) { if (urlResuelveAmbiguedad!="Centro") { document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfActividad").value="" document.getElementById("ctl00_CPH_hfCodActividad").value=""; document.getElementById("ctl00_CPH_hfMunicipio").value=municipio; document.getElementById("ctl00_CPH_hfCalle").value=calle; document.getElementById("ctl00_CPH_hfNumero").value=numero; document.getElementById("ctl00_CPH_hfCPostal").value=cp; } else { document.getElementById("ctl00_CPH_hfOff").value="0"; document.getElementById("ctl00_CPH_hfActividad").value="" document.getElementById("ctl00_CPH_hfCodActividad").value=""; document.getElementById("ctl00_CPH_hfMunicipio").value=municipio; document.getElementById("ctl00_CPH_hfCalle").value=calle; document.getElementById("ctl00_CPH_hfNumero").value=numero; document.getElementById("ctl00_CPH_hfCPostal").value=cp; document.getElementById("ctl00_CPH_hfX").value=x; document.getElementById("ctl00_CPH_hfY").value=y; } document.forms[0].submit(); } function ValidaForm() { var strActividad=''; var strProvincia=''; var strMunicipio=''; var strLocalidad=''; var strBarrio=''; var strCadSEO=''; if (document.getElementById("ctl00_CPH_hfActividad").value != '') { strActividad = replaceAll(document.getElementById("ctl00_CPH_hfActividad").value, " ", "+"); } else { strActividad = document.getElementById("ctl00_CPH_hfBusquedaNoAdivinada").value; if (strActividad == '') { strActividad = replaceAll(document.getElementById("ctl00_CPH_hfQue").value, " ", "+"); } } if (document.getElementById("ctl00_CPH_hfProvincia").value != '') { strProvincia = "/" + document.getElementById("ctl00_CPH_hfProvincia").value ; } if (document.getElementById("ctl00_CPH_hfMunicipio").value != '') { strMunicipio = "/" + document.getElementById("ctl00_CPH_hfMunicipio").value; } if (document.getElementById("ctl00_CPH_hfLocalidad").value != '') { strLocalidad = "/" + document.getElementById("ctl00_CPH_hfLocalidad").value; } strCadSEO = strActividad + strProvincia + strMunicipio + strLocalidad; var strURL; if (document.domain.indexOf("localhost") != -1) { strURL='http://www.qdq.com/' } else { strURL="http://" + document.domain + "/"; } strURL = strURL + strCadSEO + "/"; document.forms[0].action = strURL; document.forms[0].submit(); } function ValidaForm2() { var strActividad = document.getElementById("ctl00_CPH_hfActividad").value; var strNombre = document.getElementById("ctl00_CPH_hfQuien").value; var strProvincia = document.getElementById("ctl00_CPH_hfProvincia").value; var strMunicipio = document.getElementById("ctl00_CPH_hfMunicipio").value; var strBarrio = document.getElementById("ctl00_CPH_hfLocalidad").value; var strCalle = document.getElementById("ctl00_CPH_hfCalle").value; var strNumero = document.getElementById("ctl00_CPH_hfNumero").value; var strFiltroNom = document.getElementById("ctl00_CPH_hfFiltroNombre").value; var strCadSEO; if (document.getElementById("ctl00_CPH_hfActividad").value != '') { strActividad = "actividad/" + replaceAll(document.getElementById("ctl00_CPH_hfActividad").value, " ", "+") + "/"; } if (document.getElementById("ctl00_CPH_hfQuien").value != '') { strNombre= "nombre/" + replaceAll(document.getElementById("ctl00_CPH_hfQuien").value, " ", "+") + "/"; if (document.getElementById("ctl00_CPH_hfFiltroNombre").value != '') { strFiltroNom = "/filtro/" + document.getElementById("ctl00_CPH_hfFiltroNombre").value; } } if (document.getElementById("ctl00_CPH_hfProvincia").value != '') { strProvincia = document.getElementById("ctl00_CPH_hfProvincia").value; } if (document.getElementById("ctl00_CPH_hfMunicipio").value != '') { strMunicipio = "/" + document.getElementById("ctl00_CPH_hfMunicipio").value; } if (document.getElementById("ctl00_CPH_hfLocalidad").value != '') { strBarrio = "/" + document.getElementById("ctl00_CPH_hfLocalidad").value; } if (document.getElementById("ctl00_CPH_hfCalle").value != '') { strCalle = "/" + "calle/" + document.getElementById("ctl00_CPH_hfCalle").value; if (document.getElementById("ctl00_CPH_hfNumero").value != '') { strNumero = "/" + "num/" + document.getElementById("ctl00_CPH_hfNumero").value; } } strCadSEO = strActividad + strNombre + strProvincia + strMunicipio + strBarrio + strCalle + strNumero + strFiltroNom; var strURL; if (document.domain.indexOf("localhost") != -1) { strURL='http://www.qdq.com/' } else { strURL="http://" + document.domain + "/"; } strURL = strURL + strCadSEO + "/"; document.forms[0].action = strURL; document.forms[0].submit(); } function ValidaFormProximidad() { var strActividad=''; var strProvincia=''; var strMunicipio=''; var strCalle=''; var strNumero=''; var strCadSEO=''; if (document.getElementById("ctl00_CPH_hfActividad").value != '') { strActividad = "Actividad/" + document.getElementById("ctl00_CPH_hfActividad").value; } if (document.getElementById("ctl00_CPH_hfProvincia").value != '') { strProvincia = "/" + document.getElementById("ctl00_CPH_hfProvincia").value ; } if (document.getElementById("ctl00_CPH_hfMunicipio").value != '') { strMunicipio = "/" + document.getElementById("ctl00_CPH_hfMunicipio").value; } if (document.getElementById("ctl00_CPH_hfCalle").value != '') { strCalle = "/" + document.getElementById("ctl00_CPH_hfCalle").value; } if (document.getElementById("ctl00_CPH_hfNumero").value != '') { strNumero = "/" + document.getElementById("ctl00_CPH_hfNumero").value; } strCadSEO = "Proximidad/" + strActividad + strProvincia + strMunicipio + strCalle + strNumero; var strURL; if (document.domain.indexOf("localhost") != -1) { strURL='http://www.qdq.com/' } else { strURL="http://" + document.domain + "/"; } strURL = strURL + strCadSEO + "/"; document.forms[0].action = strURL; document.forms[0].submit(); } function jsCargando(que) { lang = 'es' var texto = 'Cargando'; if (lang=="es") {texto='Cargando';} if (lang=="en") {texto='Loading';} if (lang=="ek") {texto='Cargando';} if (lang=="ct") {texto='Cargando';} if (lang=="fr") {texto='Cargando';} if (lang=="gl") {texto='Cargando';} if (lang=="pt") {texto='Cargando';} if (lang=="vl") {texto='Cargando';} if (que == 'mc') {combobox = document.getElementById("ctl00_CPH_ddlMunicipio1");} if (que == 'ma') {combobox = document.getElementById("ctl00_CPH_ddlMunicipio1");} if (que == 'la') {combobox = document.getElementById("ctl00_CPH_ddlLocalidad1");} if (que == 'mfa') {combobox = document.getElementById("ctl00_CPH_ddlMunicipio");} if (que == 'lfa') {combobox = document.getElementById("ctl00_CPH_ddlLocalidad");} if (que == 'map') {combobox = document.getElementById("ctl00_CPH_ddlMunicipio2");} if (que == 'lap') {combobox = document.getElementById("ctl00_CPH_ddlLocalidad2");} if (que == 'ddlMunicipio') {combobox = document.getElementById("ddlMunicipio");} for (var i = (combobox.options.length-1); i >= 0; i--){combobox.options[i]=null;} combobox.options.add(new Option(texto,1)); } function replaceAll( text, str1, str2 ) { var command = "text.replace(/"+str1+"/g,\""+str2+"\")"; return eval(command); } function ClickBann(udac, ref) { var url=''; var strURL=''; strURL=replaceAll(location.href, 'http:', '') if (document.domain.indexOf("localhost") != -1) { url = "http://www.qdq.com//scripts/Anuncio.aspx?anuncio.aspx?p=Q&t=CLBAN&r=" + ref + "&d="+(Math.random()*100000); } else { url = "http://" + document.domain + "/scripts/Anuncio.aspx?Lang=es&p=Q&t=CLBAN&r=" + ref + "&d="+(Math.random()*100000); } $.get(url); } function LogTagMi(type, ref) { var url=''; var strURL=''; strURL=replaceAll(location.href, 'http:', '') if (document.domain.indexOf("localhost") != -1) { url = "http://www.qdq.com//scripts/Anuncio.aspx?Lang=" + "es" + "&p=Q&t=" + type + "&r=" + ref + "&OR=" + strURL.substring(2) + "&d="+(Math.random()*100000); } else { url = "http://" + document.domain + "/scripts/Anuncio.aspx?Lang=" + "es" + "&p=Q&t=" + type + "&r=" + ref + "&OR=" + strURL.substring(2) + "&d="+(Math.random()*100000); } $.get(url); }