var hauteur=0;
var temps=30;
var max=30;
function position(left,top,width,height,contenu) {
hauteur=height;
var Z="<DIV id='CalqueImage' style='position:absolute;left:"+left+"; top:"+top+";width:"+width+"; height:"+height+"'>"+contenu+"</DIV>";
document.write(Z);
setTimeout("Start()",temps);
}
function Start() {
DeplacerImage("CalqueImage",Postionimage("CalqueImage"));
setTimeout("Start()",temps);
}
function DeplacerImage(nom,top) {
document.getElementById(nom).style.top = top;
}
function Postionimage(nom) {
var pos=parseInt(document.getElementById(nom).style.top);
var wintop=parseInt(document.body.scrollTop);
var dispo=document.body.clientHeight;
var diff=Math.ceil((pos-(wintop+dispo-hauteur)));
if (diff>max) {diff=max;}
if (diff<-1*max) {diff=-1*max;}
var top=pos-diff;
return top;
}