// impostazione della tipologia del browser

function bannerBottom()
{
   var ie4_b=document.all;
   ie6_b=document.getElementById;
   ns4_b=document.layers;
   ns6_b=document.getElementById && !document.all;
   // impostazione delle variabili per il movimento
   finale_b =getBrowserHeight()-69;
   larghezza=getBrowserWidth();
   //sottraggo il margine
   larghezza=larghezza-618;
   
   inizio_b=-200;
   corrente_b=-600;
   bounce_b=100;
   //imposto il banner a destra
   if (ns4_b) eval("document.box2.left=larghezza;");
   if ((ns6_b)||(ie6_b)) document.getElementById('box2').style.left=larghezza;
   j=0;
   
   setTimeout("sposta_b()", 3000);
}
// funzione necessaria alla chiusura della casella
function chiudi_b()
{
    //if (ie4) eval("document.all.box.style.top=inizio;");
    if (ns4_b) eval("document.box2.top=inizio;");
    if ((ns6_b)||(ie6_b)) document.getElementById('box2').style.top=inizio;
}
// funzione necessaria allo spostamento
function sposta_b()
{
   dy=Math.round(finale_b-corrente_b)/2;
   corrente_b += dy;
   if ((dy<1)&&(dy>-1)) 
   {
      j+=1;
      bounce_b = -(bounce_b/j);
      finale_b += bounce_b;
   }
   //if (ie4) eval("document.all.box2.style.top=corrente;");
   if (ns4_b) eval("document.box2.top=corrente_b;");
   if ((ns6_b)||(ie6_b)) document.getElementById('box2').style.top=corrente_b;
   if (j<20) setTimeout("sposta_b()", 40);
}
//funzione per calcolare altezza schermo
function getBrowserWidth ( ) 
{
    if ( window.innerWidth ) { return window.innerWidth; }
    else if ( document.documentElement && document.documentElement.clientWidth != 0 ) { return document.documentElement.clientWidth; }
    else if ( document.body ) { return document.body.clientWidth; }
    //return 0;
}
function getBrowserHeight ( ) 
{
    if ( window.innerHeight ) { return window.innerHeight; }
    else if ( document.documentElement && document.documentElement.clientHeight != 0 ) { return document.documentElement.clientHeight; }
    else if ( document.body ) { return document.body.clientHeight; }
    //return 0;
}
