// JavaScript Document
var larghF = 246;
var altezF = 360;
var dimenF = 'yes';
var distaX = 10;
var distaY = 50;
var spostX = 100;
var spostY = 80;
var speedF = 30;
var pagina = "pubblicita.html"
var titolo = "popUpWindow"
var aperturaAutomatica = true;

function Fluttuante(finestra,maxx,maxy,vel) {this.xn = 0;this.yn = 0;this.xm = maxx;this.ym = maxy;if 
(maxx<0) this.xd = -1;else if (maxx>0) this.xd = 1;else this.xd = 0;if (maxy<0) this.yd = -1;else if 
(maxy>0) this.yd = 1;else this.yd = 0;this.ww = finestra;this.sp = vel;}function muovi(fin) 
{if (!fin.ww.closed) {  fin.ww.moveBy(fin.yd,fin.xd);  fin.xn++; fin.yn++;  
if ((fin.xd!=0)&&(fin.xn>fin.xm)) { fin.xn=0; fin.xd *= -1; }  
if ((fin.yd!=0)&&(fin.yn>fin.ym)) { fin.yn=0; fin.yd *= -1; }  
setTimeout("muovi(finestraFluttuante)",finestraFluttuante.sp); }}function changeStatus(fin) 
{  if (!fin.ww.closed) fin.ww.close();  
else {   window.popUp1 = window.open(window.pagina,window.titolo, 
"width="+window.larghF+",height="+window.altezF+",resizable="+window.dimenF);   
window.popUp1.moveTo(window.distaX,window.distaY);   window.finestraFluttuante 
= new Fluttuante(window.popUp1,window.spostX,window.spostY,window.speedF);   
window.muovi(finestraFluttuante);  }}var popUp1 = new Object();popUp1.closed 
= true;var finestraFluttuante = new Fluttuante(popUp1,spostX,spostY,speedF);
if (aperturaAutomatica) changeStatus(finestraFluttuante);