/* affiche une image en changeant sa taille dynamiquement */

function animImage (id, X0, Y0, X1, Y1, dur) {
  var img = document.getElementById(id);
  img.width = X0;
  img.height = Y0;
  img.pasX = (X1-X0)/dur;
  img.pasY = (Y1-Y0)/dur;
  //alert(img.pasX+' - '+img.pasY);
  runAnim(id, X1, Y1, dur);
}

function runAnim (id, X1, Y1, dur) {
  var img = document.getElementById(id);
  var w = img.width;
  var h = img.height;
  w += img.pasX;
  h += img.pasY;
  img.width = w;
  img.height = h;
  img.style.width = w+'px';
  img.style.height = h+'px';
  if (dur >0
      && Math.round(img.width)<X1 && img.pasX>0 || Math.round(img.width)>X1 && img.pasX<0
      && Math.round(img.height)<Y1 && img.pasY>0 || Math.round(img.height)>Y1 && img.pasY<0){
    setTimeout("runAnim(\"" + id + "\", "+X1+", "+Y1+", " + (dur -1) + ");", 1);
  }
}

/* changement de taille basic */

function tailleImg (id, X, Y) {
  var img = document.getElementById(id);
  img.width = X;
  img.height = Y;
  img.style.width = X+'px';
  img.style.height = Y+'px';
  alert(img.width+'+'+img.height+'+'+img.style.width+'+'+img.style.height);
  return true;
}
