var timerCloseAll=0; var timerCloseAd=0; var timerRido=0; var timerFade=0; var opacity=0; var ClosedAd=0; var window_width=0; var window_height=0; var imgOrWarning='ADIMG'; var adlayers= new Array('ADHEAD','ADIMG'); /***************** redirect *****************/ myreg = new RegExp("lycos\.es","i"); /***************** frameset *****************/ function calc_client_window_size() { var sfMax = 0; var sf,frameMax; var ad=1; if (self.innerWidth) { window_width = self.innerWidth; window_height = self.innerHeight; } else if (document.documentElement && document.documentElement.clientWidth) { window_width = document.documentElement.clientWidth; window_height = document.documentElement.clientHeight; } else if (document.body) { window_width = document.body.clientWidth; window_height = document.body.clientHeight; } if (document.layers||navigator.userAgent.toLowerCase().indexOf("gecko")>=0) window_width-=15; if ( top != self || top.frames.length != 0 ) { ad=0; if (document.all) { sf = (top.document.body.clientWidth * top.document.body.clientHeight) / (self.document.body.clientWidth * self.document.body.clientHeight); if (sf<3) { ad=1; } } else { function getSurface(w) { if (!w.sf) w.sf = w.innerWidth * w.innerHeight; if (w.sf >= sfMax) { sfMax = w.sf; frameMax = w; } } function findFrameMax(w) { var i; if (w.frames.length == 0) getSurface(w); else for (i = 0; i < w.frames.length; i++) { if (w.frames[i].frames.length > 0) { findFrameMax(w.frames[i]); } else { getSurface(w.frames[i]); } } } if ((top != self) || (top.frames.length==0)) { findFrameMax(top); if (frameMax == self) ad=1; } } } if (window_width<468) ad=0; if (window_height<60) ad=0; return ad; } /***************** layers functions *****************/ function findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0) { timerFade = setTimeout('fadeLayer('+fadeStep+')',100); } } } function setpos(layer,left,top) { var obj = findObj(layer); if (obj.style) { if (document.all) { if (left!='') obj.style.pixelLeft=left; if (top!='') obj.style.pixelTop=top; } else { if (left!='') obj.style.left=left; if (top!='') obj.style.top=top; } } else { if (left!='') obj.left=left; if (top!='') obj.top=top; } } function rido(i,bound,way) { if (timerRido) clearTimeout(timerRido); else showHideLayers('ADCLOSE','hide','ADHEAD','show',imgOrWarning,'show'); if (i>bound) i=bound; switch (way) { case 1: setpos(imgOrWarning,window_width-i,''); break; case 2: setpos(imgOrWarning,'',i); break; case 3: setpos(imgOrWarning,i,''); break; case 4: setpos(imgOrWarning,'',window_height-i); break; } if (i!=bound) timerRido = setTimeout("rido("+(i+15)+","+bound+","+way+")",10); } function closeAll() { if (timerCloseAll) clearTimeout(timerCloseAll); if (timerCloseAd) clearTimeout(timerCloseAd); showHideLayers(imgOrWarning,'hide','ADHEAD','hide','ADCLOSE','hide'); ClosedAd=2; } function closeAd() { if (timerFade) clearTimeout(timerFade); if (timerRido) clearTimeout(timerRido); if (timerCloseAll) clearTimeout(timerCloseAll); if (timerCloseAd) clearTimeout(timerCloseAd); opacity=100; fadeLayer(1); showHideLayers(imgOrWarning,'hide','ADHEAD','hide','ADCLOSE','show'); timerCloseAll=setTimeout("closeAll()",10000); ClosedAd=1; } function closeWarning() { if (imgOrWarning!='ADIMG') { showHideLayers(imgOrWarning,'hide'); if (ClosedAd==0) showHideLayers('ADIMG','show'); imgOrWarning='ADIMG'; } } function openAd() { ClosedAd=0; if (timerOpenAd) clearTimeout(timerOpenAd); showHideLayers('ADCLOSE','hide','ADHEAD','show',imgOrWarning,'show'); if (timerFade) clearTimeout(timerFade); if (timerCloseAll) clearTimeout(timerCloseAll); if (timerCloseAd) clearTimeout(timerCloseAd); fadeLayer(1); timerCloseAd = setTimeout("closeAd()",10000); } function reloadPage(init) { //reloads the window if NS4 resized if (init==true) with (navigator) { if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; } } else if (innerWidth!=document.pgW || innerHeight!=document.pgH) { if (ClosedAd==0) location.reload(); } if (calc_client_window_size) { setpos('ADCLOSE',window_width-300,''); setpos('ADIMG',window_width-491,''); } } /***************** init layers *****************/ function createLayers() { document.writeln(''); document.writeln(''); document.writeln(''); document.close(); reloadPage(true); timerOpenAd = setTimeout("openAd()",500); } if (calc_client_window_size()) createLayers(); function detenerError(){ return true } window.onerror=detenerError; document.writeln('');