 // impostazione della tipologia del browser
 var ie4=document.all;
 var ie6=document.getElementById;
 var ns4=document.layers;
 var ns6=document.getElementById && !document.all;

 // impostazione delle variabili per il movimento
  var finale =200;
  var inizio=-500;
  var corrente=-500;
  var bounce=100;
  var i=0;

// funzione necessaria alla chiusura della casella
 function chiudi(){
    if ((ns6)||(ie6)) eval("document.getElementById('postit').style.top='"+inizio+"px';");
    else if (ie4) eval("document.all.postit.style.top="+inizio+";");
    else if (ns4) eval("document.postit.top="+inizio+";");
}

 function sposta(){
    dy=Math.round(finale-corrente)/2;
    corrente += dy;

  if ((dy<1)&&(dy>-1)) {
     i+=1;
     bounce = -(bounce/i);
     finale += bounce;
  }

  if ((ns6)||(ie6)) eval("document.getElementById('postit').style.top='"+corrente+"px';");
  else if (ie4) eval("document.all.postit.style.top="+corrente+";");
  else if (ns4) eval("document.postit.top="+corrente+";");

  if (i<20) setTimeout("sposta()", 10);
 }

setTimeout("sposta()", 1000);
