var nomcanal="Shopall.cl"; 
var idcanal=1744; 
var xtracolor=""; 
var MesAbr = new Array("","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"); 
var DiaSemana = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"); 
var Meses = new Array ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); 
var fecha = new Date(); 
var anyo = fecha.getFullYear(); 
var shopall_me = false; 
var _abrev_cattops=Array(11356,11111,6660,4744,6613,339,4788,4762,319,11384,11466); 
var _abrev_excl_cats=Array(334,17,11266,11264,11261,19,11265,16,333,21, 
11126,4754,4748,10420,4759,4756,11115,11270,11382,11381,11379,11383,5143,4856,4891,10421,11114, 
10179,10180,10181,10176,10169,10182,10173,10170,10177,10175,10183,10178,10184,10168,10171,10174,10172,10186,10187,10501, 
10197,10193,10190,10188,10189,10194,10192,10195,10196,10191,10199,10503, 
303,3395); 
var _exclude_cattops=Array(4744,4788); 
var _exclude_excl_cats=Array(11126,4754,4748,10420,4759,4756,11115,11270,11382,11381,11379,11383,5143,4856,4891,10421, 
10180,10181,10176,10169,10182,10173,10170,10177,10175,10183,10178,10184,10168,10171,10174,10172,10186,10187,10501, 
10197,10193,10190,10188,10189,10194,10192,10195,10196,10191,10199,10503,3395,303); 
var _nopre_cattops=Array(11384,11466); 
function OnloadCBN() { 
//var iNumKeyworks=arrayKeywords.length; 
//var iPos=Math.floor(iNumKeyworks*Math.random()); 
//document.buscar.k.value=arrayKeywords[iPos]; 
//sFocus(); 
if(document.getElementById("topsrch")) setupRecentlyUpdated(); 
//try { reset_buscador(); } catch (err) { } 
//try { datePicker_cats(); } catch (err) { } 
emulate_disabled(); 
loadImgSrc(); 
detectAnchor(); 
} 
onload=OnloadCBN; 
var src_ads = []; 
var geosites = []; 
function detectAnchor() { 
if(location.hash=="#opinion"&&document.getElementById('content')&&(document.getElementById('main-divider')||document.getElementById('side-divider'))) { 
document.getElementById('content').style.overflow='visible'; 
document.getElementById('content').style.position='relative'; 
if(document.getElementById('main-divider')) document.getElementById('main-divider').style.height=document.getElementById('content').offsetHeight-40; 
if(document.getElementById('side-divider')) document.getElementById('side-divider').style.height=document.getElementById('content').offsetHeight-40; 
} 
} 
function loadImgSrc() { 
if (src_ads.length == 0) return; 
for (var i=0; i < src_ads.length; i++) { 
var obj; 
if(!src_ads[i].src.length || !(obj=document.getElementById("src_"+src_ads[i].id))) continue; 
var imag = document.createElement("img"); 
imag.setAttribute("width", "80"); 
imag.setAttribute("height", "80"); 
imag.setAttribute("src", src_ads[i].src); 
obj.appendChild(imag); 
} 
} 
function sDameFecha() { 
var sFechaDeHoy=DiaSemana[fecha.getDay()] + ", " + fecha.getDate() + " " + Meses[fecha.getMonth()] + " "+ anyo; 
document.write(sFechaDeHoy); 
} 
function sGenNumRandom() { 
var numRandom = fecha.getTime()+""+Math.floor(Math.random()*16777216)+1; 
return numRandom; 
} 
function Leyenda(url_go,ancho,alto) { 
var ancho = 140; 
var alto = 160; 
posicionX = (screen.width-ancho)/2; 
posicionY = (screen.height-alto)/2; 
window.open(url_go,"Leyenda","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width="+ancho+",height="+alto+",left="+posicionX+",top="+posicionY); 
} 
function lssi() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("/share-ht/lssi.pdf","LSSI","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function Centro() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("http://www.shopall.cl/es_ES/centropri.html","CentroPriva","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function condiACompras() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("http://www.shopall.cl/es_ES/condiacompras.html","CondiACompras","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function condiAComunidad() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("http://www.shopall.cl/es_ES/condiacomunidad.html","CondiAComunidad","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function Condic() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("http://www.shopall.cl/condiSMS.html","cond","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function CondicWap() { 
posicionX = (screen.width-400)/2; 
posicionY = (screen.height-350)/2; 
window.open("http://www.shopall.cl/condiWAP.html","condwap","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,resizable=1,dependent=0,width=400,height=350,left="+posicionX+",top="+posicionY); 
} 
function Comprar(rproducto,icomercio,ncomercio,uproducto,idproducto,precio,ts,fr,kw,referer,parg) { 
if (!fr) fr=4; 
if (!kw) kw=_kw; 
if (!kw) kw=''; 
if (!referer) referer=''; 
if (!parg) parg=''; 
var url_comercio = "http://www.shopall.cl/share-ht/product.php?idd=1744&idp="+escape(idproducto)+"&prc="+escape(precio)+"&r="+escape(rproducto)+"&ic="+icomercio+"&nc="+escape(ncomercio)+"&u="+escape(uproducto)+"&ts="+ts+"&fr="+fr+"&kw="+kw+"&referer="+escape(referer)+"&pa="+escape(parg); 
var propiedades = "scrollbars=1,toolbar=1,location=1,directories=1,menubar=1,resizable=1,status=1,left=10,top=10"; 
window.open(url_comercio, idproducto,propiedades); 
} 
function Comprar2(rproducto,icomercio,ncomercio,uproducto,idproducto,precio,fr,kw,referer,parg) { 
if (!fr) fr=4; 
if (!kw) kw=_kw; 
if (!kw) kw=''; 
if (!referer) referer=''; 
if (!parg) parg=''; 
ts=sGenNumRandom(); 
var url_comercio = "http://www.shopall.cl/share-ht/product.php?idd=1744&idp="+escape(idproducto)+"&prc="+escape(precio)+"&r="+escape(rproducto)+"&ic="+icomercio+"&nc="+escape(ncomercio)+"&u="+escape(uproducto)+"&ts="+ts+"&fr="+fr+"&kw="+kw+"&referer="+escape(referer)+"&pa="+escape(parg); 
var propiedades = "scrollbars=1,toolbar=1,location=1,directories=1,menubar=1,resizable=1,status=1,left=10,top=10"; 
window.open(url_comercio, idproducto,propiedades); 
} 
function VentanaFoto(url_go) { 
var ancho=150; 
var alto=150; 
posicionX = (screen.width-ancho)/2; 
posicionY = (screen.height-alto)/2; 
IdVentana=open(url_go,"Foto","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,dependent=0,width="+ancho+",height="+alto+",left="+posicionX+",top="+posicionY); 
} 
function Ventana(url_go,ancho,alto) { 
posicionX = (screen.width-ancho)/2; 
posicionY = (screen.height-alto)/2; 
IdVentana=open(url_go,"Info","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,dependent=0,width="+ancho+",height="+alto+",left="+posicionX+",top="+posicionY); 
} 
function ValorarCom(idd,ic,nc,lc,tc) { 
//window.location='/share-ht/oComN.php?i='+idd+'&ic='+ic+'&nc='+escape(nc)+'&lc='+escape(lc); 
ajax_load_get('/share-ht/valorar.php?tpl=ModuloNoBorder.tpl&i='+idd+'&ic='+ic+'&nc='+escape(nc)+'&lc='+escape(lc)+'&tc='+tc+'&locale=es_ES','content','',''); 
} 
function OpinarCom(idd,ic,nc,lc) { 
//window.location='/share-ht/foroN.php?i='+idd+'&ic='+ic+'&nc='+escape(nc)+'&lc='+escape(lc); 
window.location='/share-ht/opinac.php?idd='+idd+'&ic='+ic+'&nc='+escape(nc)+'&lc='+escape(lc); 
} 
function sFraseBienvenida(cname) { 
var sCookieVal=getCookie(cname); 
if (sCookieVal) 
return "&nbsp;¡Bienvenido <b>"+sCookieVal+"</b>!.&nbsp;"; 
else 
return ""; 
} 
function formulario_contacto(txt,qry) { 
frmNav = document.getElementById('frmNav_'+qry); if (!frmNav) return; 
if ((frmNav.txtNombre.value!='')&&(frmNav.txtEmail.value!='')&&(frmNav.txtAsunto.value!='')&&(frmNav.txtMensaje.value!='')&&(frmNav.check_code.value!='')) { 
emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/ 
if (!emailRe.test(frmNav.txtEmail.value)) alert("El e-mail introducido no es válido. Por favor, compruébalo."); 
else if(confirm('¿Estas seguro/a que quieres enviar este mensaje?')) { 
frmNav.redirect_url.value='share-cgi/search.ftcb?&tpl=ResultadosBuscaContactoOK.tpl&id=1744&k='+txt; 
frmNav.submit(); 
} 
} 
else { 
if(frmNav.txtNombre.value=='') alert('Por favor introduce tu nombre.'); 
else if(frmNav.txtEmail.value=='') alert('Por favor introduce tu e-mail.'); 
else if(frmNav.txtAsunto.value=='') alert('Por favor introduce el asunto.'); 
else if(frmNav.txtMensaje.value=='') alert('Por favor introduce el mensaje.'); 
else if(frmNav.check_code.value=='') alert('Por favor introduce el número en la imagen.'); 
} 
} 
function addRnd(id) { 
var rn=Math.floor(Math.random()*50); 
eval("document.frmNav_"+id+".imagecode.value="+rn); 
var img=document.getElementById("img_"+id); 
img.src="/share-ht/validationImg.php?x="+rn; 
img.width="150"; 
img.height="30"; 
} 
function formulario_alertas(qry) 
{ 
frmAlerta = document.getElementById('frmAlerta_'+qry); if (!frmAlerta) return; 
emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/ 
if ((frmAlerta.producto.value!='')&&(emailRe.test(frmAlerta.mail.value))&&(frmAlerta.max.value!='')&&(frmAlerta.min.value!='')) 
{ 
window.open('','alertas','width=400,height=200,location=0,scrollbars=0,left='+((screen.width-400)/2)+',top='+((screen.height-200)/2) ); 
frmAlerta.submit(); 
frmAlerta.mail.value=''; 
frmAlerta.producto.value=''; 
frmAlerta.min.value=''; 
frmAlerta.max.value=''; 
} 
else 
{ 
if(frmAlerta.producto.value=='') alert('Por favor introduce el producto a buscar.'); 
else if(!emailRe.test(frmAlerta.mail.value)) alert('Por favor introduce tu e-mail.'); 
else if(frmAlerta.max.value=='') alert('Por favor introduce el precio máximo.'); 
else if(frmAlerta.min.value=='') alert('Por favor introduce el precio mí­nimo.'); 
} 
} 
function addFriend(idf,idfn) { 
if(!idf) return; 
if(confirm("¿Deseas incorporar a "+idfn+" a tu grupo de amigos?")) { 
url='/share-ht/addfriend.php?idc=1744&lc=es_ES&idf='+idf; 
window.open(url,'addfriend','width=430,height=200,location=0,scrollbars=0,left='+((screen.width-430)/2)+',top='+((screen.height-200)/2) ); 
} 
} 
function exclude_cats(cattop,cat,cont,query) { 
if (_exclude_cattops.in_array(cattop)) { 
if (_exclude_excl_cats.in_array(cat)) { 
set_layer_display('tr1_producto_'+cont+'_'+query,0); 
set_layer_display('tr2_producto_'+cont+'_'+query,0); 
} 
} 
} 
function abrev_cats(cattop,cat,cont,query) { 
if (_nopre_cattops.in_array(cattop)) 
set_layer_display('tr_producto_pre_'+cont+'_'+query,0); 
} 
function abrev_cats_biblia(cattop,cat,cont,query,head) { 
if (_abrev_cattops.in_array(cattop)) { 
if (!_abrev_excl_cats.in_array(cat)) { 
set_layer_display('td1_'+head+'_'+cont+'_'+query,0); 
set_layer_display('td2_'+head+'_'+cont+'_'+query,0); 
set_layer_display('td3_'+head+'_'+cont+'_'+query,0); 
} 
} 
} 
function reversestring(s) { 
var cnt,out=''; 
for(cnt=s.length;cnt>0;cnt--) out = out + s.charAt(cnt-1); 
return out; 
} 
function writereversed(s) { 
document.writeln(reversestring(s)); 
} 
function writeemail(s,s2,s3,htmlextra) { 
if(s3.length==0) s3=s; 
document.writeln('<a href="mailto:'+s+s2+'" '+htmlextra+'>'+s3+'</a>'); 
} 
function writereversedemail(s,s2,s3,htmlextra) { 
var sr=reversestring(s),sr3; 
if(s3.length==0) s3=s; 
sr3=reversestring(s3); 
writeemail(sr,s2,sr3,htmlextra); 
} 
function esSuperfiltrado(a,b,c,d,e){ 
if(a != '' || b != '' || c != '' || d != '' || e != '') 
return true; 
else 
return false; 
} 
function emulate_disabled() { 
if (document.getElementsByTagName) { 
var s = document.getElementsByTagName("select"); 
if (s.length > 0) { 
window.select_current = new Array(); 
for (var i=0, select; select = s[i]; i++) { 
if(select.name=="c" && select.className=="formulario") { 
select.onfocus = function(){ window.select_current[this.id] = this.selectedIndex; } 
select.onchange = function(){ restore(this); } 
emulate(select); 
} 
} 
} 
} 
} 
function restore(e) { 
if (e.options[e.selectedIndex].disabled) { 
e.selectedIndex = window.select_current[e.id]; 
} 
} 
function emulate(e) { 
for (var i=0, option; option = e.options[i]; i++) { 
if (option.disabled) 
option.style.color = "#CFCCC2"; 
} 
} 
//Activacion del menu resultados en IE 
function startList(ident) { 
if (document.all&&document.getElementById) { 
navRoot = document.getElementById("nav_"+ident); 
for (i=0; i<navRoot.childNodes.length; i++) { 
node = navRoot.childNodes[i]; 
if (node.nodeName=="LI") { 
node.onmouseover=function() { 
this.className+=" over"; 
} 
node.onmouseout=function() { 
this.className=this.className.replace(" over", ""); 
} 
} 
} 
} 
} 
function sFocus() { 
if(!document.getElementById("layout_busca")) { 
try { 
document.search.k.focus(); 
} catch (e) { } 
} 
} 
//Modulo flotante de categorías en portada 
function SCats(o) { 
o.blur(); 
var oDiv = document.getElementById("listMoreCat"); 
var oWt = document.getElementById("whiteMoreCat"); 
if(oDiv.style.display!="block") { 
oDiv.style.display="block"; 
oWt.style.display="block"; 
o.firstChild.src=""; 
} 
else { 
oDiv.style.display="none"; 
oWt.style.display="none"; 
o.firstChild.src=""; 
} 
return false; 
} 
function rmClass(element,classToRemove) { 
if(!element) return; 
var className=element.className; 
var classList=className.split(/\s+/); 
newClassName=""; 
for(var i=0;i<classList.length;i++){ 
if(classList[i]!=classToRemove) newClassName+=classList[i]+" "; 
} 
element.className=newClassName.replace(/\s*$/,""); 
} 
function adClass(element,classToAdd) { 
if(!element) return; 
var className=element.className; 
var classList=className.split(/\s+/); 
for(var i=0;i<classList.length;i++){ 
if(classList[i]==classToAdd) return; 
} 
element.className+=" "+classToAdd; 
element.className=element.className.replace(/^\s+/,""); 
} 
//Tops 
function topClick(elem) { 
var lnkPila = elem.getElementsByTagName("A"); 
var i = 0; 
while (lnkPila.length > i && (/^javascript:ValorarCom\(/i).test(lnkPila[i].href)) 
++i; 
if (lnkPila.length && lnkPila.length > i) { 
var ul=lnkPila[i].href; 
if(lnkPila[i].target && (lnkPila[i].target=="_blank"||lnkPila[i].target=="_new")) 
window.open(ul); 
else 
top.location = ul; 
} 
} 
function rmCl(v) { 
var e=null; 
if(this.tagName) 
e=this; 
else if(v.srcElement) 
e=v.srcElement; 
e.className=""; 
} 
function adCl(v) { 
var e=null; 
if(this.tagName) 
e=this; 
else if(v.srcElement) 
e=v.srcElement; 
e.className="sel"; 
} 
function addEvent(event, elem, func, useCapture) { 
if (elem.addEventListener) { // W3C DOM 
event = event=="mouseenter" ? "mouseover" : (event=="mouseleave" ? "mouseout" : event); 
elem.addEventListener(event, func, useCapture); 
return true; 
} 
else if (elem.attachEvent) { // IE DOM 
var r = elem.attachEvent("on"+event, func); 
return r; 
} 
else { 
return false; 
} 
} 
function removeEvent(event, elem, func, useCapture) { 
if (elem.removeEventListener){ // W3C DOM 
event = event=="mouseenter" ? "mouseover" : (event=="mouseleave" ? "mouseout" : event); 
elem.removeEventListener(event, func, useCapture); 
return true; 
} 
else if (elem.detachEvent){ // IE DOM 
var r = elem.detachEvent("on"+event, func); 
return r; 
} else { 
return false; 
} 
} 
function loadTopEvents(id,clkk,clss) { 
if(!document.getElementById(id)) return; 
var Pila = document.getElementById(id).getElementsByTagName("LI"); 
if (Pila.length) { 
for(var i=0;i<Pila.length;i++){ 
var oLi=Pila[i]; 
if (oLi.className=='co') continue; 
addEvent("mouseenter", oLi, function(v) { 
var e=null; 
if(this.tagName) 
e=this; 
else if(v.srcElement) 
e=v.srcElement; 
e.className=typeof clss=="string"?clss:"sel"; 
}, false); 
addEvent("mouseleave", oLi, function(v) { 
var e=null; 
if(this.tagName) 
e=this; 
else if(v.srcElement) 
e=v.srcElement; 
e.className=typeof clss=="string"?e.className.replace(clss,""):""; 
}, false); 
if (clkk) oLi.onclick = function() { topClick(this); } 
} 
} 
} 
function loadTopEventsLight(id) { 
if(!document.getElementById(id)) return; 
var Pila = document.getElementById(id).getElementsByTagName("DIV"); 
if (Pila.length) { 
for(var i=0;i<Pila.length;i++){ 
var oLi=Pila[i]; 
if (oLi.className!='clearfix') continue; 
oLi.onclick = function() { topClick(this); } 
} 
} 
} 
function select_buscador(num,ev) { 
num*=1; 
setCookie("Origin",num,0); 
o = document.getElementById("cb_sel" + num); 
if(!o) return false; 
o.blur(); 
var oLogo = document.getElementById("cblogoH"); 
var oSearch = document.getElementById("elemSearch"); 
var oDiv = document.getElementById("cb_left"); 
for (i=0; i<oDiv.childNodes.length; i++) { 
var node = oDiv.childNodes[i]; 
if (node.nodeName=="A") { 
rmClass(node, "cb_on"); 
adClass(node, "cb_off"); 
} 
} 
if(o.parentNode.nodeName!="LI") { rmClass(o, "cb_off"); adClass(o, "cb_on"); } 
var oForm = document.search; 
var text = oForm.k.value; 
var wideInp = "\n<input type=\"text\" name=\"k\" maxlength=\"100\" class=\"cbinputW\" value=\"\">\n"; 
var localInp = "\n<label for=\"k\">\n<input type=\"text\" name=\"k\" maxlength=\"100\" class=\"cbinput\" value=\"\">\n</label>\n<label class=\"text\" for=\"kl\">en</label>\n<label for=\"kl\">\n<input type=\"text\" id=\"kl\" name=\"kl\" maxlength=\"100\" class=\"cbinputL\" value=\"\">\n</label>\n"; 
set_layer_display("cbsearcher", 1); 
set_layer_display("cbhotel", 0);  set_layer_display("cbflight", 0);  set_layer_display("cbcarhire", 0); 
switch (num) { 
case 1: 
oForm.v.value = ""; 
oForm.tb.value = "1744-compras"; 
if(oLogo) oLogo.className = "logoC"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "0"; 
break; 
case 6: 
oForm.v.value = "8"; 
oForm.tb.value = "1744-negocios"; 
if(oLogo) oLogo.className = "logoNyS"; 
oSearch.innerHTML = localInp; 
oForm.c.value = "0"; 
oForm.kl.value = _kl; 
break; 
case 9: 
oForm.v.value = ""; 
oForm.tb.value = "1744-inmobiliaria"; 
oForm.c.value = ""; 
if(oLogo) oLogo.className = "logoInm"; 
oSearch.innerHTML = "<label for=\"c\"><select name=\"c\" id=\"cat\"><option value=\"4915\">Alquiler</option><option value=\"4907\">&nbsp;&bull; Áticos</option> <option value=\"4908\">&nbsp;&bull; Chalets</option> <option value=\"4909\">&nbsp;&bull; Duplex</option> <option value=\"4910\">&nbsp;&bull; Estudios</option> <option value=\"4911\">&nbsp;&bull; Garajes</option> <option value=\"4912\">&nbsp;&bull; Locales</option> <option value=\"4913\">&nbsp;&bull; Naves Industriales</option> <option value=\"4914\">&nbsp;&bull; Oficinas</option> <option value=\"4915\">&nbsp;&bull; Pisos</option> <option value=\"4916\">&nbsp;&bull; Solares</option> <option value=\"387\">&nbsp;&bull; Vacaciones</option><option value=\"4926\">Venta</option><option value=\"4918\">&nbsp;&bull; Áticos</option> <option value=\"4919\">&nbsp;&bull; Chalets</option> <option value=\"4920\">&nbsp;&bull; Duplex</option> <option value=\"4921\">&nbsp;&bull; Estudios</option> <option value=\"4922\">&nbsp;&bull; Garajes</option> <option value=\"4923\">&nbsp;&bull; Locales</option> <option value=\"4924\">&nbsp;&bull; Naves Industriales</option> <option value=\"4925\">&nbsp;&bull; Oficinas</option> <option value=\"4926\">&nbsp;&bull; Pisos</option> <option value=\"4927\">&nbsp;&bull; Solares</option> <option value=\"385\">&nbsp;&bull; Vacaciones</option></select></label><label class=\"text\" for=\"k\">en</label><label for=\"k\"><input type=\"text\" id=\"k\" name=\"k\" maxlength=\"100\" class=\"cbinputS\" value=\"\"></label>"; 
break; 
case 10: 
oForm.v.value = ""; 
oForm.tb.value = "1744-empleo"; 
if(oLogo) oLogo.className = "logoEm"; 
oSearch.innerHTML = "\n<label for=\"ke\">\n<input type=\"hidden\" name=\"k\" value=\"\"><input type=\"text\" name=\"ke\" maxlength=\"100\" class=\"cbinput\" value=\"\">\n</label>\n<label class=\"text\" for=\"kle\">en</label>\n<label for=\"kle\">\n<input type=\"text\" id=\"kle\" name=\"kle\" maxlength=\"100\" class=\"cbinputL\" value=\"\">\n</label>\n"; 
oForm.c.value = "11384"; 
oForm.ke.value = text; 
break; 
case 15: 
oForm.v.value = ""; 
oForm.tb.value = "1744-motor"; 
oForm.c.value = ""; 
if(oLogo) oLogo.className = "logoMot"; 
oSearch.innerHTML = "<div><input type=\"radio\" name=\"c\" value=\"4744\" checked=\"\"><span>Coches</span><br><input type=\"radio\" name=\"c\" value=\"4788\"><span>Motos</span></div><label for=\"k\"><input type=\"text\" id=\"k\" name=\"k\" maxlength=\"100\" class=\"cbinputM\" value=\"\"></label>"; 
break; 
case 16: 
oForm.v.value = ""; 
oForm.tb.value = "1744-viajes"; 
if(oLogo) oLogo.className = "logoVj"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "319"; 
break; 
case 17: 
document.getElementById("cbhotel").innerHTML=""; 
document.getElementById("cbcarhire").innerHTML=""; 
if (shopall_me && !document.getElementById("cbflight").innerHTML.length) { 
shopall_me = "cbflight"; 
load_js("http://www.easyvols.org/codigobarras/formulaire/580x250_Array/580x250_mev.js"); 
} 
oForm.v.value = ""; 
oForm.tb.value = "1744-vuelos"; 
if(oLogo) oLogo.className = "logoFly"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "0"; 
set_layer_display("cbsearcher", 0); 
set_layer_display("cbflight", 1); 
break; 
case 18: 
document.getElementById("cbflight").innerHTML=""; 
document.getElementById("cbcarhire").innerHTML=""; 
if (shopall_me && !document.getElementById("cbhotel").innerHTML.length) { 
shopall_me = "cbhotel"; 
load_js("http://www.easyvols.org/codigobarras/formulaire/580x250_Array/580x250_meh.js"); 
} 
oForm.v.value = ""; 
oForm.tb.value = "1744-hoteles"; 
if(oLogo) oLogo.className = "logoHot"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "0"; 
set_layer_display("cbsearcher", 0); 
set_layer_display("cbhotel", 1); 
break; 
case 19: 
document.getElementById("cbflight").innerHTML=""; 
document.getElementById("cbhotel").innerHTML=""; 
if (shopall_me && !document.getElementById("cbcarhire").innerHTML.length) { 
shopall_me = "cbcarhire"; 
load_js("http://www.easyvols.org/codigobarras/formulaire/580x250_Array/580x250_mec.js"); 
} 
oForm.v.value = ""; 
oForm.tb.value = "1744-alquiler de coches"; 
if(oLogo) oLogo.className = "logoAlq"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "0"; 
set_layer_display("cbsearcher", 0); 
set_layer_display("cbcarhire", 1); 
break; 
default: 
oForm.v.value = ""; 
oForm.tb.value = "1744-pais"; 
if(oLogo) oLogo.className = "logoNul"; 
oSearch.innerHTML = wideInp; 
oForm.c.value = "0"; 
} 
oForm.k.value = text; 
return false; 
} 
function goSearch(oForm) { 
if(oForm.c && oForm.c.value=="11384") 
oForm.k.value = oForm.ke.value + " " + oForm.kle.value; 
} 
function whichSearch() { 
if(getCookie("Origin")) 
select_buscador(parseInt(getCookie("Origin"))); 
else 
select_buscador(1); 
} 
function rst_buscador(ict,ic) { 
ict*=1; ic*=1; 
var node = document.getElementById("pest1"); 
if (ict==6613 || (ict>=4907 && ict<=4927) || ict==385 || ict==387) { 
select_buscador(9); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Inmobiliaria"); 
if ((ict>=4907 && ict<=4916) || ict==387) { 
var cats = new Array(4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,387); 
for(var i=0;i<cats.length;i++) { 
if (ict==cats[i]) { 
var oSel = document.getElementById("cat"); 
oSel.options[i+1].selected = 1; 
break; 
} 
} 
} 
else { 
var cats = new Array(4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,385); 
for(var i=0;i<cats.length;i++) { 
if (ict==cats[i]) { 
var oSel = document.getElementById("cat"); 
oSel.options[i+13].selected = 1; 
break; 
} 
} 
} 
} 
else if ((ict>=11384 && ict<=11415) || ict==9826) { 
select_buscador(10); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Empleo"); 
} 
else if (ict==4744 || ict==4788) { 
select_buscador(15); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Motor"); 
if (ict==4744) 
document.search.c[1].checked=true; 
else 
document.search.c[2].checked=true; 
} 
else if (ict==319 || ict==321 || ict==4745) { 
select_buscador(16); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Viajes"); 
} 
else if (ict==323) { 
select_buscador(17); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Vuelos"); 
} 
else if (ict==325) { 
select_buscador(18); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Hoteles"); 
} 
else if (ict==345) { 
select_buscador(19); 
node.firstChild.firstChild.innerHTML = node.firstChild.firstChild.innerHTML.replace(/^[^:]*/,"Alquiler de coches"); 
} 
} 
//Buscador con más pestanyas 
function cls_buscador(b) { 
var oLs = document.getElementById("listMore"); 
oLs&&oLs.style.display=="block"&&opn_buscador(b) 
} 
function opn_buscador(b) { 
var oSp = document.getElementById("spanMore"); 
var oLs = document.getElementById("listMore"); 
(b||window.event).cancelBubble=true; 
!document.onclick&&(document.onclick=cls_buscador); 
//oSp.className = (oSp.className=="pestana_more")?"pestana_less":"pestana_more"; 
oLs.style.display = (oLs.style.display!="block")?"block":"none"; 
oLs.style.left=(oSp.offsetLeft-4)+"px"; 
oLs.style.top=(document.getElementById('cb_begin').offsetHeight-1)+"px"; 
} 
function isset(variable_name) { 
try { 
if (typeof(eval(variable_name)) != 'undefined') 
if (eval(variable_name) != null) 
return true; 
} catch(e) { } 
return false; 
} 
//Google function for Adsense google_afs_request_done. 
function google_afs_request_done(google_ads) { 
if (google_ads.length == 0 || !window.query_google_ad || window.query_google_ad.length == 0) return; 
 
var wideAds = '',narrowAds = '',nocpc=0; 
var opts = window.query_google_ad.shift(); 
if (document.getElementById("wide_ad_unit_nocpc"+opts.IdPeticion)&&posNull==1) nocpc=1; 
if (document.getElementById("wide_ad_unit_bottom"+opts.IdPeticion)) nocpc=1; 
if (opts.wide_ad_product) nocpc=1; 
var specialn = '<h3 class="section"><strong class="heading">PUBLICIDAD</strong><a href="http://services.google.com/feedback/online_hws_feedback" target="_blank">Anuncios Google</a></h3><div class="goog">'; 
var specialw = '<h3 class="section"><strong class="heading">PUBLICIDAD</strong><a href="http://services.google.com/feedback/online_hws_feedback" target="_blank">Anuncios Google</a></h3><div class="goog">'; 
var numW=0,numN=0; 
for(var i=0; i < google_ads.length; ++i) { 
if (google_ads[i].type=="text/wide") numW++; 
if (google_ads[i].type=="text/narrow") numN++; 
} 
 
var j=0,k=0; 
for(var i=0; i < google_ads.length; ++i) { 
if (google_ads[i].type=="text/wide") { 
j++; 
if (!nocpc) { 
wideAds += '<div'+(j==numW?' style="border:none" ':' ')+'onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.wide_ad_color?opts.wide_ad_color:'')+';font-weight:bold">' + google_ads[i].line1 + '</a><br>' + 
'<span style="color:#808080;font-weight:normal">'  + google_ads[i].line2 + '</span><br>' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.wide_ad_color?opts.wide_ad_color:'')+';font-weight:normal;">' + google_ads[i].visible_url + 
'</a></div>'; 
} else { 
wideAds += '<li onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<div class="item clearfix"><div class="item-ads"><span><a href="http://services.google.com/feedback/online_hws_feedback" target="_blank" style="color:'+(opts.wide_ad_color?opts.wide_ad_color:'')+';">ANUNCIOS GOOGLE</a></span></div><div class="item-details">' + 
'<p class="title"><a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.wide_ad_color?opts.wide_ad_color:'')+';">' + google_ads[i].line1 + '</a></p>' + 
'<p>'  + google_ads[i].line2 + '</p>' + 
'<p><a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.wide_ad_color?opts.wide_ad_color:'')+';font-weight:normal">' + google_ads[i].visible_url + '</a></p>' + 
'</div></div></li>'; 
} 
} 
else { 
k++; 
narrowAds += '<div'+(k==numN?' style="border:none" ':' ')+'onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.narrow_ad_color?opts.narrow_ad_color:'')+';font-weight:bold;">' + google_ads[i].line1 + '</a><br>' + 
'<span style="color:#808080;font-weight:normal">' + google_ads[i].line2 + '&nbsp;' + google_ads[i].line3 + '</span><br>' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.narrow_ad_color?opts.narrow_ad_color:'')+';font-weight:normal;">' + google_ads[i].visible_url + 
'</a></div>'; 
} 
} 
 
 
if (narrowAds != "") { 
narrowAds = specialn + narrowAds + '</div>'; 
} 
if (wideAds != "" && !nocpc) { 
wideAds = specialw + wideAds + '</div>'; 
} 
if (wideAds != "" && nocpc) { 
wideAds = '<ul class="top-list">' + wideAds + '</ul>'; 
} 
// Write HTML for wide and narrow ads to the proper <div> elements 
if (document.getElementById("wide_ad_unit_top"+opts.IdPeticion)) document.getElementById("wide_ad_unit_top"+opts.IdPeticion).innerHTML = wideAds; 
else if (document.getElementById("wide_ad_unit_nocpc"+opts.IdPeticion)&&posNull==1) document.getElementById("wide_ad_unit_nocpc"+opts.IdPeticion).innerHTML = wideAds; 
else if (document.getElementById("wide_ad_unit_bottom"+opts.IdPeticion)) document.getElementById("wide_ad_unit_bottom"+opts.IdPeticion).innerHTML = wideAds; 
else if (document.getElementById("wide_ad_unit"+opts.IdPeticion)) document.getElementById("wide_ad_unit"+opts.IdPeticion).innerHTML = wideAds; 
if (document.getElementById("narrow_ad_unit"+opts.IdPeticion) && narrowAds != "") document.getElementById("narrow_ad_unit"+opts.IdPeticion).innerHTML = narrowAds; 
posNull=0; 
return; 
} 
 
function google_ad_request_done(google_ads) { 
if (google_ads.length == 0 || !window.query_google_ad || window.query_google_ad.length == 0) return; 
 
var opts = window.query_google_ad.shift(); 
var s = '<h3 class="section"><strong class="heading">PUBLICIDAD</strong><a href="' + google_info.feedback_url + '" target="_blank">Anuncios Google</a></h3><div class="goog">'; 
for(var i=0; i < google_ads.length; ++i) { 
s += '<div'+(i==google_ads.length?' style="border:none" ':' ')+'onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.narrow_ad_color?opts.narrow_ad_color:'')+';font-weight:bold;">' + google_ads[i].line1 + '</a><br>' + 
'<span style="color:#808080;font-weight:normal">' + google_ads[i].line2 + '&nbsp;' + google_ads[i].line3 + '</a><br>' + 
'<a href="' + google_ads[i].url + '" target="_blank" onmouseover="window.status=\'' + google_ads[i].visible_url + '\';return true;" onmouseout="window.status=\'\';return true;" style="color:'+(opts.narrow_ad_color?opts.narrow_ad_color:'')+';font-weight:normal;">' + google_ads[i].visible_url + 
'</a></div>'; 
} 
 
s += '</div>'; 
 
if (document.getElementById("narrow_ad_unit"+opts.IdPeticion)) document.getElementById("narrow_ad_unit"+opts.IdPeticion).innerHTML = s; 
return; 
} 
function tpi_ads_request(tpi_ads) { 
if (tpi_ads.length == 0 || !window.query_tpi_ad || window.query_tpi_ad.length == 0) return; 
var opts = window.query_tpi_ad.shift(); 
var url_comercio = "/share-ht/product.php?idd=1744&ic=14647&fr=13&r=TravelCBN&nc=TPI&ts="+escape(sGenNumRandom())+"&u="; 
var s = '<div class="separador"></div><div class="separador"></div>' + 
'<div class="modulo">'  + 
'<div class="modulo_title">TE RECOMENDAMOS</div>' + 
'<div class="modulo_content">'; 
 
if(opts.tpi_ad_special) 
s = '<h3 class="section">Negocios relacionados con '+unescape(opts.tpi_ad_kw.replace(/\+/gi,"%20"))+'</h3><div class="googw">'; 
 
for(var i=0; i < tpi_ads.length; i++) { 
if(opts.tpi_ad_special) { 
s += '<div'+(i==tpi_ads.length-1?' style="border:none" ':' ')+'onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<a href="' + url_comercio + encodeURIComponent(tpi_ads[i].url) + '" target="_blank" style="color:'+(opts.tpi_ad_color?opts.tpi_ad_color:'')+';font-weight:bold;text-decoration:none">' + tpi_ads[i].title + '</a><br>' + 
'<a href="' + url_comercio + encodeURIComponent(tpi_ads[i].url) + '" target="_blank" style="color:#808080;font-weight:normal;text-decoration:none">'  + 
tpi_ads[i].descr + '<br>' + tpi_ads[i].scp + ' ' + tpi_ads[i].twn + '</a></div>'; 
} 
else { 
s += '<div style="padding:4px;">' + 
'<a href="' + url_comercio + encodeURIComponent(tpi_ads[i].url) + '" target="_blank">' + tpi_ads[i].title + '</a><br>' + 
'<a href="' + url_comercio + encodeURIComponent(tpi_ads[i].url) + '" style="color:black;font-weight:normal;text-decoration:none" target="_blank">' + 
tpi_ads[i].descr + '<br>' + tpi_ads[i].scp + ' ' + tpi_ads[i].twn + '</a></div>'; 
} 
} 
 
if(opts.tpi_ad_special) 
s += '</div>'; 
else 
s += '</div></div>' +	'<div class="separador"></div>'; 
 
if (document.getElementById("tpi_ad_unit"+opts.IdPeticion)) document.getElementById("tpi_ad_unit"+opts.IdPeticion).innerHTML = s; 
} 
 
function ebay_ads_request(ebay_ads) { 
if (ebay_ads.length == 0 || !window.query_ebay_ad || window.query_ebay_ad.length == 0) return; 
var opts = window.query_ebay_ad.shift(); 
var s = ""; 
for(var i=0; i < ebay_ads.length; ++i) { 
s += '<li onmouseover="this.style.background=\'#DBE7F2\'" onmouseout="this.style.background=\'white\'">' + 
'<div class="item clearfix"><div class="item-img"><a href="' + ebay_ads[i].url + '" target="_blank">'+(ebay_ads[i].img!=''?'<img src="' + ebay_ads[i].img + '" alt="" style="height:80px;width:80px;">':'')+'</a></div>' + 
'<div class="item-details"><p class="title"><a href="' + ebay_ads[i].url + '" target="_blank">' + ebay_ads[i].title + '</a></p></div>' + 
'<div class="item-merchant"><div><img height="30" width="90" alt="Ebay" src="/share-imgs/comercios/17771.gif"></div>' + 
'<div style="white-space:nowrap"><span class="price">' + ebay_ads[i].price + ' &euro;</span></div>' + 
'<div><a href="' + ebay_ads[i].url + '" target="_blank">Ir a la tienda</a></div></div>' + 
'</div></li>'; 
} 
if (s != "") 
s = '<ul class="top-list">' + s + '</ul>'; 
if (document.getElementById("ebay_unit_bottom"+opts.IdPeticion)) document.getElementById("ebay_unit_bottom"+opts.IdPeticion).innerHTML = s; 
return; 
} 
function shopall_searcher_request(easy_ads) { 
if (easy_ads.length == 0) return; 
 
for(var i=0; i < easy_ads.length; i++) { 
switch (easy_ads[i].type) { 
case "inline/javascript": 
eval(easy_ads[i].data); 
break; 
case "url/javascript": 
load_js(easy_ads[i].data); 
break; 
case "url/stylesheet": 
load_css(easy_ads[i].data); 
break; 
case "inline/html": 
easy_ads[i].data=easy_ads[i].data.replace(/>/g,">\n"); 
if (document.getElementById(shopall_me)) document.getElementById(shopall_me).innerHTML = easy_ads[i].data; 
break; 
} 
} 
} 
function loadExternal() { 
shopall_me = true; 
var or = getCookie("Origin"); 
if(or==17||or==18||or==19) 
whichSearch(); 
} 
//Nubes de tags 
function nube_rnd(id) { 
if(!document.getElementById(id)) return; 
var links = document.getElementById(id).getElementsByTagName("A"); 
var len = links.length; 
for(i=0;i<len;i++) { 
var rn=Math.floor(Math.random()*101); 
links[i].style.fontSize=(rn+100)+"%"; 
} 
} 
function nube_tiendas(id,max,min) { 
if(!document.getElementById(id)) return; 
var links = document.getElementById(id).getElementsByTagName("A"); 
var diff = (max-min)?(max-min):1; 
var robin = 8; 
var len = links.length; 
for(i=0;i<len;i++) { 
var num = parseInt(links[i].getElementsByTagName("B")[0].innerHTML); 
var fnt = Math.round((Math.pow(((num-min)/diff), (1/(1+robin))) +1) *100 ); 
links[i].style.fontSize=fnt + "%"; 
} 
} 
function showFG(oIframe,cont) { 
if (oIframe.contentWindow && oIframe.contentWindow.document.getElementsByTagName("*").length < 5) { 
if (document.getElementById(cont)) 
document.getElementById(cont).style.display = "none"; 
} else { 
if (document.getElementById(cont)) 
document.getElementById(cont).style.display = "block"; 
} 
} 
function logoNav() { 
var oLogo=document.getElementById("cblogoShopNav"); 
if(!oLogo || Math.floor(Math.random()*2)) return; 
oLogo.className="nav2"; 
} 
function switchTopic(id) { 
if(!document.getElementById("answr"+id)) return false; 
if(document.getElementById("answr"+id).style.display=="none") { 
Effect.SlideDown("answr"+id); 
new Effect.Opacity("answr"+id, { from: 0, to: 1, duration: 1.6 }); 
} 
else { 
Effect.SlideUp("answr"+id); 
new Effect.Opacity("answr"+id, { from: 1, to: 0, duration: 0.8 }); 
} 
return false; 
} 
function Affiliate() { window.top.location="/share-ht/afiliate/index.php?idc=1744&amp;lc=es_ES";} 
function resetPwd() { window.top.location="/share-ht/reset.php?idc=1744&lc=es_ES&sseo=1";} 
function fixPNG(el) { 
if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf('6.')>-1) { 
el=typeof el=="string"?document.getElementById(el):(typeof el=="object"?el:false); 
if(el && el.nodeName=="IMG" && el.src.substring(el.src.length - 3)=='png') { 
el.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='crop', src='" + el.src + "')"; 
el.style.width=el.width; 
el.style.height=el.height; 
el.src="/share-imgs/p.gif"; 
} 
} 
} 
function _shTrackTrans(href,NomComercio,RefProducto,NomProducto,CatProducto) { 
if(typeof _gaq!='undefined') { 
href=href.indexOf(location.host)>0?href.slice(href.indexOf(location.host)+location.host.length):href; 
_gaq.push(['_trackPageview',href]); 
var numRandom=sGenNumRandom(); 
_gaq.push(['_addTrans',numRandom,NomComercio,'0.02','0.0','0.0','','','']); 
_gaq.push(['_addItem',numRandom,RefProducto,NomProducto,CatProducto,'0.02','1']); 
_gaq.push(['_trackTrans']); 
} 
} 
//----------------------------------------------------- 
// dhtml.js 
//----------------------------------------------------- 
debug_level=1; 
function debug_echo(s) { 
debug_echol(s,1); 
} 
function debug_echol(s,l) { 
if (l=="") l=1; 
if (l>debug_level) return; 
if (document.debug_form) document.debug_form.debug_area.value+=s; 
} 
function debug_clean() { 
if (document.debug_form) document.debug_form.debug_area.value=''; 
} 
//----------------------------------------------------- 
function get_layer_obj(szDivID) { 
var obj = 0; 
if(document.layers) {				//NN4+ 
if (document.layers[szDivID]) obj = document.layers[szDivID]; 
} else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
if (document.getElementById(szDivID)) obj = document.getElementById(szDivID); 
} else if(document.all) {			// IE 4 
if (document.all[szDivID]) obj = document.all[szDivID]; 
} 
return obj; 
} 
function set_layer_display(szDivID, iState) {	// 1 inline, 0 none 
//alert("SETTING LAYER DISPLAY: "+iState); 
if(document.layers) {				//NN4+ 
if (document.layers[szDivID]) document.layers[szDivID].display = iState ? "inline" : "none"; 
else return 0; 
} else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
var obj = document.getElementById(szDivID); 
if (obj) obj.style.display = iState ? "inline" : "none"; 
else return 0; 
} else if(document.all) {			// IE 4 
if (document.all[szDivID]) document.all[szDivID].style.display = iState ? "inline" : "none"; 
else return 0; 
} 
return 1; 
} 
function set_layer_block(szDivID, iState) {	// 1 block, 0 none 
//alert("SETTING LAYER DISPLAY: "+iState); 
if(document.layers) {				//NN4+ 
if (document.layers[szDivID]) document.layers[szDivID].display = iState ? "block" : "none"; 
else return 0; 
} else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
var obj = document.getElementById(szDivID); 
if (obj) obj.style.display = iState ? "block" : "none"; 
else return 0; 
} else if(document.all) {			// IE 4 
if (document.all[szDivID]) document.all[szDivID].style.display = iState ? "block" : "none"; 
else return 0; 
} 
return 1; 
} 
function get_layer_display(szDivID) { 
if(document.layers)				//NN4+ 
display=document.layers[szDivID].display; 
else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
var obj = document.getElementById(szDivID); 
if (obj) display=obj.style.display; 
} else if(document.all)			// IE 4 
display=document.all[szDivID].style.display; 
if (display && display=='inline') return 1; 
else return 0; 
} 
function change_layer_display(szDivID) { 
display=get_layer_display(szDivID); 
if (display) set_layer_display(szDivID,0); 
else set_layer_display(szDivID,1); 
} 
function set_layer_visibility(szDivID, iState) {	// 1 visible, 0 hidden 
//alert("SETTING LAYER VISIBILITY: "+iState); 
if(document.layers) {				//NN4+ 
if (document.layers[szDivID]) document.layers[szDivID].visibility = iState ? "visible" : "collapse"; 
else return 0; 
} else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
var obj = document.getElementById(szDivID); 
if (obj) obj.style.visibility = iState ? "visible" : "collapse"; 
else return 0; 
} else if(document.all) {			// IE 4 
if (document.all[szDivID]) document.all[szDivID].style.visibility = iState ? "visible" : "collapse"; 
else return 0; 
} 
return 1; 
} 
function get_layer_visibility(szDivID) { 
if(document.layers)				//NN4+ 
visibility=document.layers[szDivID].visibility; 
else if(document.getElementById) {		//gecko(NN6) + IE 5+ 
var obj = document.getElementById(szDivID); 
if (obj) visibility=obj.style.visibility; 
} else if(document.all)			// IE 4 
visibility=document.all[szDivID].style.visibility; 
if (visibility && visibility=='visible') return 1; 
else return 0; 
} 
function change_layer_visibility(szDivID) { 
v=get_layer_visibility(szDivID); 
if (v) set_layer_visibility(szDivID,0); 
else set_layer_visibility(szDivID,1); 
} 
function set_layer_content(lname,html) { 
if (document.getElementById) { 
var lid=document.getElementById(lname); 
if (lid) lid.innerHTML=html; 
} 
} 
function get_layer_content(lname) { 
if (document.getElementById) { 
var lid=document.getElementById(lname); 
if (lid) return lid.innerHTML; 
} 
} 
function change_modulo_din(i) { 
var szDivID='modulo_din_'+i; 
var icon='modulo_din_icon_'+i; 
var title='modulo_din_title_'+i; 
v=get_layer_display(szDivID); 
if (v) { 
set_layer_display(szDivID,0); 
set_layer_display(title,1); 
if (document[icon]) document[icon].src=''; 
} else { 
set_layer_display(szDivID,1); 
set_layer_display(title,0); 
if (document[icon]) document[icon].src=''; 
} 
} 
Array.prototype.in_array=function(v) { 
var i=this.length; 
while (i--) if (this[i]===v) return true; 
return false; 
} 
if (!Array.prototype.indexOf) 
Array.prototype.indexOf = function(item, startIndex) { 
var len = this.length; 
if (startIndex == null) 
startIndex = 0; 
else if (startIndex < 0) { 
startIndex += len; 
if (startIndex < 0) 
startIndex = 0; 
} 
for (var i = startIndex; i < len; i++) { 
var val = this[i] || this.charAt && this.charAt(i); 
if (val == item) 
return i; 
} 
return -1; 
}; 
if (!Array.prototype.copy) 
Array.prototype.copy = function(arr) { 
var len = arr.length; 
this.splice(0,this.length); 
for (var i=0; i<len; i++) this.push(arr[i]); 
}; 
if (!String.prototype.trim) 
String.prototype.trim = function() { 
return this.replace(/^\s+|\s+$/g, ""); 
}; 
//----------------------------------------------------- 
function setCookie(name,value,days,path) { 
if (days) { 
var date = new Date(); 
date.setTime(date.getTime()+(days*24*60*60*1000)); 
var expires = "; expires="+date.toGMTString(); 
} else var expires = ""; 
if (!path) path="/"; 
document.cookie = name+"="+value+expires+"; path="+path; 
} 
function getCookie(name) { 
var cname=name+"="; 
var dc=document.cookie; 
if (dc.length>0) { 
begin=dc.indexOf(cname); 
if (begin!=-1) { 
begin+=cname.length; 
end=dc.indexOf(";", begin); 
if (end==-1) end=dc.length; 
return unescape(dc.substring(begin, end)); 
} 
} 
return null; 
} 
function delCookie(name,path) { 
setCookie(name,"",-1,path); 
} 
function showCookie(c) { alert("COOKIE "+c+" = "+getCookie(c)); } 
function showCookies() { alert(document.cookie); } 
function buscar() { 
delCookie("ModuloResultados"); 
return true; 
} 
//----------------------------------------------------- 
function load_js(f) { 
debug_echo("load_js: '"+f+"' ...\n"); 
var element = document.createElement("script"); 
element.setAttribute("type", "text/javascript"); 
element.setAttribute("src", f); 
var head=document.getElementsByTagName("body")[0]; 
head.appendChild(element); 
} 
function load_css(f) { 
var newSS = document.createElement("link"); 
newSS.setAttribute("rel", "stylesheet"); 
newSS.setAttribute("href", f); 
newSS.setAttribute("type", "text/css"); 
newSS.setAttribute("media", "screen"); 
document.getElementsByTagName( "head" )[0].appendChild(newSS); 
} 
//----------------------------------------------------- 
// ajax.js 
//----------------------------------------------------- 
function form_to_string(myform) { 
var resultado=''; 
for(i=0; i<myform.elements.length; i++) { 
var v=get_element_value(myform.elements[i]); 
if(v) resultado+='&'+myform.elements[i].name+"="+String(v).replace(/&/gi,"%26"); 
} 
return resultado; 
} 
function get_element_value(elm) { 
switch(elm.type){ 
case 'select-one': return elm.options[elm.selectedIndex].value; 
case "checkbox": 
case 'radio': 
if (elm.checked) return elm.value; 
break; 
case "hidden": 
case "text": 
case "textarea": 
case "password": return elm.value; 
} 
} 
function get_XMLHttpRequest() { 
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} 
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} 
try { return new XMLHttpRequest(); } catch(e) {} 
alert("XMLHttpRequest not supported"); 
return null; 
} 
function ajax_load_post(ul,id,myform,id2) { 
ajax_load(ul,id,myform,'POST',id2); 
} 
function ajax_load_get(ul,id,myform,id2) { 
ajax_load(ul,id,myform,'GET',id2); 
} 
function ajax_load_div(ul,oldpest,inh,loadfg) { 
return true; 
} 
function load_modulo_resultados_ajax(s,ul,ident,browse,flagver,biblia) { 
if (s) setCookie("ModuloResultados",s,0); 
else s=getCookie("ModuloResultados"); 
if (!s) { 
if (biblia!='') s = "&v=" + flagver + "&v2=10"; 
else return; 
} 
if (browse!='') browse = "&ti=1"; 
if (flagver!='') flagver = "&v=" + flagver; 
ajax_load(ul + browse + flagver + s + '&ib=-1&incs=UTF8&cs=ISO-8859-1&tpl=ResultadosBuscaLateral&tplnr=NoHayResultadosLateral&tpler=NoHayResultadosLateral','resultados_busca_'+ident,'','GET',''); 
} 
function ajax_load(ul,id,myform,method,id2) { 
var load_text = "Cargando ..."; 
var ajax_obj=get_XMLHttpRequest(); 
var obj=document.getElementById(id); 
obj.innerHTML="Conectando ..."; 
set_layer_display(id2,1); 
if (!method) method='POST'; 
ajax_obj.open(method, ul, true); 
ajax_obj.setRequestHeader("Method", method+" "+ ul+" HTTP/1.1"); 
ajax_obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
ajax_obj.setRequestHeader("Content-Length", "0"); 
ajax_obj.onreadystatechange=function() { 
/* 0: Uninitizalized, 1: Loading, 2: Loaded, 3: Interactive, 4: Finished */ 
if (ajax_obj.readyState==1) obj.innerHTML="<div style=\"margin:10px;margin-left:20px;padding:10px 0 12px 25px;background:url(/share-imgs/loading.gif) no-repeat left center;\"><span class=\"resul-nombre\">"+load_text+"</span></div>"; 
else if (ajax_obj.readyState==4) { 
try { 
if (ajax_obj.status>=400 || ajax_obj.responseText=='') { 
set_layer_display(id2,0); 
//alert("Error cargando AJAX: "+ul+" => "+ajax_obj.status); 
} 
else { 
obj.innerHTML=ajax_obj.responseText; 
ajax_eval_js(ajax_obj.responseText); 
//set_layer_display(id2,1); 
} 
} catch(e) { } 
} 
} 
if(myform=="[object HTMLFormElement]" || (myform=="[object]" && myform.elements)) ajax_obj.send(form_to_string(myform)); 
else ajax_obj.send(myform); 
} 
function ajax_eval_js(txt) { 
var ScriptFragment='(?:<script.*?>)((\n|\r|.)*?)(?:</script>)'; 
var match=new RegExp(ScriptFragment, 'img'); 
var scripts=txt.match(match); 
if (scripts) { 
var js=''; 
for(var s=0;s<scripts.length;s++) { 
var match=new RegExp(ScriptFragment, 'im'); 
js+=scripts[s].match(match)[1]+'\n'; 
} 
//alert(js); 
eval(js); 
} 
} 
detect_searchengine(); 
function detect_searchengine() 
{ 
referer = document.referrer; 
matches = referer.match(/([?&]*)(q|p|query)=([^&]*)/gi); 
if (matches!=null) 
{ 
smatches=matches.join(); 
smatches=smatches.replace('?',''); 
kws = smatches.split("="); 
//cbcmp,cbsrc,cbmdm,cbkw,cbcntnt,cbrfrr 
cookie_val='|searchengine_organic||'+kws[1]+'||'+referer; 
//alert(cookie_val); 
setCookie("MktgId",cookie_val,0); 
} 
} 
//----------------------------------------------------- 
/* 
* contentLoader.js 
* 
* Get the latest version from: 
* http://www.jsclasses.org/fast-content-loader 
* @(#) $Id: contentLoader.js,v 1.12 2010/11/11 23:50:49 mlemos Exp $ 
* 
* This LICENSE is in the BSD license style. 
* Copyright (c) 2010, Manuel Lemos 
* All rights reserved. 
* 
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
* 
*   Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
*   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
*   Neither the name of Manuel Lemos nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
* 
*  Portions of the code that implement document write capture are based on the Bezen library by Eric Brechemier licensed under the Creative Commons Attribution license 3.0: 
*  http://creativecommons.org/licenses/by/3.0/ 
*  http://bezen.org/javascript/ 
*/ 
if(typeof(ML) === 'undefined') 
var ML = {}; 
if(typeof(ML.content) === 'undefined') 
ML.content = {}; 
ML.content.contentLoader = function() 
{ 
var doNotRemoveThisGetTheLatestVersionFrom = 'http://www.jsclasses.org/fast-content-loader', 
content = [], 
update = null; 
this.debug = true; 
this.defaultInline = false; 
this.updateInterval = 10; 
this.contentPrefix = 'con'; 
this.delayedPrefix = 'del'; 
this.delayedContent = ''; 
var outputDebug = function(o, message) 
{ 
if(o.debug) 
{ 
if(console 
&& console.log) 
console.log(message); 
else 
alert(message); 
} 
return false; 
}; 
var replaceContent = function(o) 
{ 
var remaining = 0; 
for(var c in content) 
{ 
if(!content[c].loaded) 
{ 
var delayed = document.getElementById(content[c].delayed), 
place = document.getElementById(content[c].id); 
if(delayed 
&& place) 
{ 
delayed.parentNode.removeChild(delayed); 
place.parentNode.replaceChild(delayed, place); 
delayed.style.display = (content[c].inline ? 'inline' : 'block'); 
content[c].loaded = true; 
} 
else 
++remaining; 
} 
} 
if(remaining == 0) 
{ 
window.clearInterval(update); 
update = null; 
} 
return remaining; 
}; 
this.addContent = function(properties) 
{ 
if(!properties.content) 
return outputDebug(this, 'Content properties are missing'); 
properties.id = this.contentPrefix + content.length; 
properties.delayed = this.delayedPrefix + content.length; 
if(typeof(properties.inline) === 'undefined') 
properties.inline = this.defaultInline; 
properties.loaded = false; 
document.write('<div id="' + properties.id + '" style="' + (properties.width ? 'width: ' + properties.width + 'px;' : '') + (properties.height ? ' height: ' + properties.height + 'px;' : '') + ' overflow: none; display: ' + (properties.inline ? 'inline' : 'block') + '">' + this.delayedContent + '</div>'); 
content[content.length] = properties; 
return true; 
}; 
 
this.loadContent = function() 
{ 
var o = this; 
if(window.opera 
|| navigator.userAgent.indexOf('MSIE') != -1) 
{ 
var written = []; 
var write = function(html) 
{ 
written.push(html); 
}; 
var writeln = function(html) 
{ 
write(html + "\n"); 
}; 
var reportError = function(error, url, line) 
{ 
if(typeof error === 'object') 
{ 
reportError(error.message, error.fileName, error.lineNumber); 
return; 
} 
outputDebug(o, error + ' at ' + url + '[' + line + ']'); 
}; 
 
var catchError = function(func, description) 
{ 
description = description || 'error.catchError'; 
if(typeof func !== 'function') 
{ 
reportError(description + ': A function is expected, found ' + typeof func); 
return function() { }; 
} 
return(function() 
{ 
try 
{ 
return func.apply(this,arguments); 
} 
catch(e) 
{ 
if(window.onerror) 
window.onerror(description + ': ' + e.message + ' in ' + func, e.fileName, e.lineNumber, true); 
} 
}); 
}; 
var trim = function(text) 
{ 
return(text.replace(/^\s*/, '').replace(/\s*$/, '')); 
}; 
var hasAttribute = function(node, attribute) 
{ 
if(node.hasAttribute) 
return node.hasAttribute(attribute); 
 
var attributeNode = node.getAttributeNode(attribute); 
if(attributeNode === null) 
return false; 
return attributeNode.specified; 
}; 
var moveScript = function(script, target, callback) 
{ 
var safeCallback = catchError(callback, 'script.onload'); 
 
if(script.readyState 
&& script.onload !== null) 
{ 
script.onreadystatechange = function() 
{ 
if(script.readyState === 'loaded' 
|| script.readyState === 'complete') 
{ 
script.onreadystatechange = null; 
script.onerror = null; 
safeCallback(); 
} 
}; 
} 
else 
script.onload = safeCallback; 
target.appendChild(script); 
}; 
var moveScriptClone = function(script, target, callback) 
{ 
if(hasAttribute(script, 'src')) 
{ 
var externalScript = document.createElement('script'), 
i = 0; 
for (; i < script.attributes.length; ++i) 
{ 
var attribute = script.attributes[i]; 
if(hasAttribute(script, attribute.name)) 
externalScript.setAttribute(attribute.name, attribute.value); 
} 
externalScript.text = script.text; 
moveScript(externalScript, target, callback); 
} 
else 
{ 
var internalScript = script.cloneNode(false); 
internalScript.text = script.text; 
internalScript.type = 'any'; 
target.appendChild(internalScript); 
if(hasAttribute(script, 'type')) 
internalScript.setAttribute('type', script.type); 
else 
internalScript.removeAttribute('type'); 
var code = trim(internalScript.text); 
if(code.indexOf('<!--') === 0) 
{ 
code = code.substr(4); 
if(code.substr(code.length - 3) === '-->') 
code = code.substr(0, code.length - 3); 
} 
(new Function(code))(); 
callback(); 
} 
}; 
 
var moveNodes = function(source, target, callback) 
{ 
if(source === null) 
{ 
callback(); 
return; 
} 
var nextSource = null, 
nextTarget = target; 
var nextStep = function() 
{ 
moveNodes(nextSource, nextTarget, callback); 
}; 
 
if(source.nodeName === 'SCRIPT' 
&& (!source.language 
|| source.language.toLowerCase() === 'javascript') 
&& (!source.type 
|| trim(source.type).toLowerCase() === 'text/javascript')) 
{ 
setTimeout(function() 
{ 
moveScriptClone(source, target, function() 
{ 
insertWritten(target, nextStep); 
}); 
}, 0); 
} 
else 
{ 
var clone = source.cloneNode(false); 
target.appendChild(clone); 
setTimeout(nextStep, 0); 
if(source.firstChild) 
{ 
var scriptCount = source.getElementsByTagName('script').length; 
if(scriptCount === 0) 
{ 
if(source.nodeName === 'TABLE') 
clone.outerHTML = source.outerHTML; 
else 
clone.innerHTML = source.innerHTML; 
} 
else 
{ 
nextSource = source.firstChild; 
nextTarget = clone; 
} 
} 
} 
if(nextSource === null) 
nextSource = source.nextSibling; 
 
var sourceAncestor = source.parentNode; 
while(nextSource === null 
&& sourceAncestor !== null) 
{ 
nextSource = sourceAncestor.nextSibling; 
nextTarget = nextTarget.parentNode; 
sourceAncestor = sourceAncestor.parentNode; 
} 
}; 
var insertWritten = function(target, callback) 
{ 
if(written.length > 0) 
{ 
var div = document.createElement('div'); 
div.innerHTML = '<br>' + written.join(''); 
written = []; 
div.removeChild(div.firstChild); 
moveNodes(div.firstChild, target, callback); 
} 
else 
callback(); 
}; 
var load = function() 
{ 
var documentWrite = document.write, 
documentWriteln = document.writeln, 
c = 0; 
document.write = write; 
document.writeln = writeln; 
var loadContentElement = function (c) 
{ 
var div = document.getElementById(content[c].id); 
div.innerHTML = ''; 
write(content[c].content); 
insertWritten(div, function () 
{ 
content[c].loaded = true; 
++c; 
if(c < content.length) 
loadContentElement(c); 
else 
{ 
document.writeln = documentWriteln; 
document.write = documentWrite; 
} 
}); 
} 
loadContentElement(0); 
}; 
if(content.length) 
{ 
if(window.addEventListener) 
window.addEventListener('load', load, false); 
else 
{ 
if(window.attachEvent) 
window.attachEvent('onload', load); 
else 
{ 
if(document.addEventListener) 
document.addEventListener('load', load, false); 
else 
document.attachEvent('onload', load); 
} 
} 
} 
} 
else 
{ 
for(var c in content) 
{ 
if(!content[c].loaded) 
document.write('<div id="' + content[c].delayed + '" style="' + (content[c].width ? 'width: ' + content[c].width + 'px;' : '') + (content[c].height ? ' height: ' + content[c].height + 'px;' : '') + ' overflow: none; display: none">' + content[c].content + '</div>'); 
} 
if(replaceContent(this) 
&& update == null) 
{ 
update = window.setInterval(function() 
{ 
replaceContent(o); 
}, this.updateInterval); 
} 
} 
}; 
} 
//-----------------------------------------------------
