function select_all( name, valor ){ var arr = document.getElementsByName( name ); for( i = 0; i < arr.length; i++ ){ arr[i].checked = valor; } } function get_array( variable ){ var arr = document.getElementsByName( variable ); var aux = ''; var sep = ''; for( i = 0; i < arr.length; i++ ){ if( arr[i].checked == true ){ aux += sep + arr[i].value; sep = ','; } } return aux; } function selected_count( variable ){ var arr = document.getElementsByName( variable ); var count = 0; for( i = 0; i < arr.length; i++ ){ if( arr[i].checked == true ) count++; } return count; } function mapa( id ){ window.open( 'https://www.clicguia.com/mapa/' + id, 'mapa', 'toolbar=no, menubar=no, scrollbars=no, width=605, height=490, noresize' ); } function consulta( id ){ window.open( 'https://www.clicguia.com/consulta/?tipo=consulta&ids=' + id, 'consulta', 'toolbar=no, menubar=no, scrollbars=yes, width=630, height=490, noresize' ); } function tepasoeldato( ids ){ window.open( 'https://www.clicguia.com/te-paso-el-dato/?ids=' + ids, 'tepasoeldato', 'toolbar=no, menubar=no, scrollbars=yes, width=630, height=350, noresize' ); } function imprimir( ids ){ window.open( 'https://www.clicguia.com/imprimir/?ids=' + ids, 'imprimir', 'toolbar=no, menubar=no, scrollbars=yes, width=630, height=320, noresize' ); } function enter( next, e ){ var tecla = (document.all) ? e.keyCode : e.which; if( tecla == 13 ) { eval( next ); } } function cambiar_solapa( id, pagina, titulo, descripcion ){ var solapas = document.getElementById( 'detalle_solapas' ); var divs = document.getElementById( id ).parentNode.parentNode; // Solapas for( i = 0; i < solapas.childNodes.length; i++ ){ if( solapas.childNodes[i].tagName == 'UL' || solapas.childNodes[i].tagName == 'ul' ){ // Desactivamos todas las solapas for( x = 0; x < solapas.childNodes[i].childNodes.length; x++ ){ if( solapas.childNodes[i].childNodes[x].tagName == 'LI' || solapas.childNodes[i].childNodes[x].tagName == 'li' ){ solapas.childNodes[i].childNodes[x].className = ''; } } } } if( pagina == 'empresa' || pagina == 'blob' || pagina == 'productos' || pagina == 'oportunidad' ){ for( i = 0; i < divs.childNodes.length; i++ ){ if( divs.childNodes[i].tagName == 'DIV' || divs.childNodes[i].tagName == 'div' ){ if( divs.childNodes[i].id == 'titulo' ){ // Cambiamos titulo divs.childNodes[i].innerHTML = document.getElementById( 'solapa_' + id ).childNodes[0].innerHTML; } else if( divs.childNodes[i].className == 'contenido' ){ // Ocultamos divs for( x = 0; x < divs.childNodes[i].childNodes.length; x++ ){ if( divs.childNodes[i].childNodes[x].tagName == 'DIV' || divs.childNodes[i].childNodes[x].tagName == 'div' ){ divs.childNodes[i].childNodes[x].style.display = 'none'; } } } } } if( pagina == 'empresa' ){ document.form_empresa.solapa.value = id; } else if( pagina == 'blob' ) { document.form_blob.solapa.value = id; document.form_agregar.solapa.value = id; } else if( pagina == 'oportunidad' ){ /*No hacemos nada*/ } else { document.form_producto.solapa.value = id; document.form_oferta.solapa.value = id; document.form_agregar.solapa.value = id; } // Titulo y Descripcion if( pagina == 'empresa' || pagina == 'blob' || pagina == 'productos' ){ document.getElementById( 'titulo_item' ).innerHTML = titulo; document.getElementById( 'texto' ).innerHTML = descripcion; } } if( pagina == 'detalle' ){ document.getElementById( 'detalle_principal' ).style.display = 'none'; document.getElementById( 'detalle_productos' ).style.display = 'none'; document.getElementById( 'detalle_ofertas' ).style.display = 'none'; document.getElementById( 'detalle_imagenes' ).style.display = 'none'; document.getElementById( 'detalle_videos' ).style.display = 'none'; document.getElementById( 'detalle_descargas' ).style.display = 'none'; document.getElementById( 'detalle_sucursales' ).style.display = 'none'; document.getElementById( 'detalle_contacto' ).style.display = 'none'; } document.getElementById( id ).style.display = 'block'; document.getElementById( 'solapa_' + id ).className = 'activo'; } var FormSubmit = 0; function check_submit( next ){ if( FormSubmit == 0 ){ if( next != '' ) eval( next ); FormSubmit = 1; return true; } else { alert( 'El formulario ya ha sido enviado esta operación puede demorar varios minutos dependiendo de su conexión a internet.' ); return false; } } function show( obj ){ document.getElementById( obj ).style.display = 'block'; } function hide( obj ){ document.getElementById( obj ).style.display = 'none'; } function unload(){ if( FormSubmit == true ){ var txt = 'Has enviado un formulario ¿Esta seguro que deseas continuar con la solicitud?'; if( confirm( txt ) ){ return true; } else { return false; } } return true; } function buscar_faq( url, id_seccion ){ location.href = url + '?srch_faq=' + document.getElementById( 'srch_faq' ).value + '&id_seccion=' + id_seccion; } function confirmar( texto, next ){ if( confirm( texto ) ){ eval( next ); } } function agregar_option( id, texto, valor, seleccionada ){ var opcion = document.createElement( 'option' ); opcion.text = texto; opcion.value = valor ; var lista = document.getElementById( id ); try { lista.add( opcion, null ); // standards compliant; doesn't work in IE } catch(ex) { lista.add( opcion ); // IE only } if( seleccionada == 1 ){ lista.selectedIndex = lista.length - 1; } } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function multiple_functions( funcion, check, titulo, variable ){ if( 0 || !check ){ var aux = get_array( variable ); if( aux == '' && funcion != 'multiconsulta' ){ alert( 'Debe seleccionar al menos 1 ' + titulo + '.' ); } else if( selected_count( variable ) < 2 && funcion == 'multiconsulta' ) { alert( 'Debe seleccionar al menos 2 ' + titulo + 's.' ); } else { if( funcion == 'tepasoeldato' ){ tepasoeldato( aux ); } if( funcion == 'imprimir' ){ imprimir( aux ); do_imprimir( aux ); } if( funcion == 'multiconsulta' ){ do_multiconsulta( aux ); } if( funcion == 'eliminar_proveedores' ){ do_eliminar_proveedores( aux ) } if( funcion == 'agregar_proveedores' ){ do_agregar_proveedores( aux ); } } } else { alert( 'Debe estar registrado y logueado para utilizar esa herramienta.' ); } } function buscar(){ var r = document.getElementById( 'srch_rubro' ); var u = document.getElementById( 'srch_ubicacion' ); try{ var sr = document.getElementById( 'solo_rubro' ).checked; } catch(all){ var sr = false; } if( r.value == '' || r.value.length < 3 || ( u.value != '' && u.value.length < 3 ) ){ alert( 'Ingrese un texto a buscar por Empresa, negocio o rubro.\nDebe ingresar al menos 3 caracteres tanto para Rubros como para Ubicación.' ); r.focus(); } else { var home = 'https://www.clicguia.com/buscar/?srch_rubro=' + r.value; if( u.value != '' ){ home += '&srch_ubicacion=' + u.value; } location.href = home; } } function ismaxlength(obj){ var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "" if (obj.getAttribute && obj.value.length>mlength) obj.value=obj.value.substring(0,mlength) }