function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } window.onload = function(){ var banner = document.getElementById('bottom_banner'); conectar_elegir_db(); $selec1 = $my_DB -> query("select * from avisos where avisos_activo=1 order by rand()"); if ($row = mysql_fetch_array($selec1)) { $incremento = 1; $incremento +=$row["avisos_display"]; $my_DB -> query("update avisos set avisos_display = ".$incremento." where avisos_id=".$row[avisos_id]); $imagen = "banner.style.backgroundImage='url(../nueva/imagenes/avisos/$row[avisos_imagen])';"; echo $imagen; $vinculo = "banner.onclick = function() { window.location = 'http://www.webelectronica.com.ar/nueva/ir_aviso.php?id=".$row[avisos_id]."'}"; echo $vinculo; } $my_DB -> desconectar(); ?> var pseudoBottom = 175; var i = 1; function animate(){ //alert(banner.offsetHeight); if(pseudoBottom > banner.offsetHeight){ banner.style.height = i + 'px'; i=i+2; //++pseudoBottom; interval = window.setTimeout(animate, 5); }else{ clearTimeout(interval) } } interval = window.setTimeout(animate, 2500); } function destroycatfish() /* catfish closer function */ { var catfish = document.getElementById('bottom_banner'); document.body.removeChild(catfish); /* clip catfish off the tree */ document.getElementsByTagName('html')[0].style.padding= '0'; /* reset the padding at the bottom */ return false; /* disable the link's 'linkiness' -- so it won't jump you up the top of the page */ } function closelink() /* attach the catfish closer function to the link */ { var closelink = document.getElementById('closeme'); /* find the 'close this' link */ closelink.onclick = destroycatfish; /* attach the destroy function to it's 'onclick' */ } addLoadEvent(function() { closelink(); });