function objAjax() { var xmlhttp=false; 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 loadOpts(selFather,selSon,itemType,sContainer) { var oSrc = document.getElementById(selFather.name); var iSelected = oSrc.options[oSrc.selectedIndex]; var oDst = document.getElementById(selSon); var sPais = document.getElementById('pais'); if (oDst) { var ajax = new objAjax(); ajax.open("GET", 'index.php?mod=gd&type='+itemType+'&sub='+iSelected.value+'&cy='+sPais.value, true); ajax.onreadystatechange = function () { if (ajax.readyState == 4 && ajax.status == 200) { while (oDst.firstChild) { oDst.removeChild(oDst.firstChild); } var sEntradas = new String(); sEntradas = ajax.responseText; if (sEntradas=='' || sEntradas=='undefined') { document.getElementById(sContainer).style.display='none'; } else { var aContenidos = new Array(); aContenidos = sEntradas.split("|"); var sItems = new String(); var aItems = new Array(); /* Para agregar selectores vacios */ var sDesc; switch (itemType) { case "cat": sDesc = "una categoria"; break; case "sec": sDesc = "un sector"; break; case "pro": sDesc = "un producto"; break; case "sub": sDesc = "un sub-producto"; break; } var oOption = document.createElement("option"); oOption.value = ''; oOption.innerText = '-- Seleccione '+sDesc+' --'; oOption.text = '-- Seleccione '+sDesc+' --'; oOption.name = 'optSel'; oDst.appendChild(oOption); for (idx = 0 ; idx < aContenidos.length ; idx++) { sItems = aContenidos[idx]; aItems = sItems.split(":"); var oOption = document.createElement("option"); oOption.value = aItems[0]; /* innerText lo tengo que usar por culpa de M$... */ oOption.innerText = aItems[1]; /* Este otro es el valido segun w3c */ oOption.text = aItems[1]; oOption.name = 'opt'+idx; oOption.id = 'opt'+idx; oDst.appendChild(oOption); } } } } ajax.send(null); } } function beginSearch() { /* Armado de la consulta */ return 0; } function hideTrs(sParent) { if (sParent=="trCats") { hideTr('trSecs'); hideTr('trPros'); hideTr('trSubs'); } if (sParent=="trSecs") { hideTr('trPros'); hideTr('trSubs'); } if (sParent=="trPros") { hideTr('trSubs'); } } function hideTr(sWhich) { document.getElementById(sWhich).style.display='none' } if (!document.getElementById) { // non-W3C compliant document.getElementById = function(strId) { if (document.layers) return document[strID]; // NS 4.x if (document.all) return document.all[strID]; // IE 3.x and up return null; // expect the unexpected } } function toggle(nr) { if (document.layers) { try { current = (document.layers[nr].display == 'none') ? '' : 'none'; document.layers[nr].display = current; } catch (e) { window.status='No hay subitems disponibles'; } } else if (document.getElementById) { try { vista = (document.getElementById(nr).style.display == 'none') ? '' : 'none'; document.getElementById(nr).style.display = vista; } catch (e) { window.status='No hay subitems disponibles'; } } else if (document.all) { try { current = (document.all[nr].style.display == 'none') ? '' : 'none'; document.all[nr].style.display = current; } catch (e) { window.status='No hay subitems disponibles'; } } } function mostrarEmpresa(id,s) { xpos=(screen.width/2)-395; ypos=(screen.height/2)-295; window.open('index.php?mod=me&id='+id+'&s='+s,'shEnt','directories=no,top='+ypos+',left='+xpos+',width=790,height=570,location=no,status=no,border=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no'); } // END