/* functions 
zoomImg(imgname, t, n, x1, y1)
function resizeImg1(imgname, dx, dy, x1, y1) 
*/

var ival, imgname, total, steps, maxx, maxy, currentx, currenty, dx, dy;
var                t, dt, n,     x1,   y1,   x0,       y0,       x,  y;
var imgref;

function zoomImg(imgname, t, n, x1, y1)	{
// imgref = document.getElementsByName(imgname)[0];
 imgref = eval("document." +imgname);

 t = t * 1000; 	

 x0 = imgref.width;
 y0 = imgref.height;

 dx = (x1 - x0 ) / n;
 dy = (y1 - y0 ) / n;
 dt = t / n;

 functionRef = "resizeImg1('"+imgname+"', "+dx+", "+dy+", "+x1+", "+y1+")";
 ival = setInterval(functionRef, dt);
}

function resizeImg1(imgname, dx, dy, x1, y1) {
// imgref = document.getElementsByName(imgname)[0];
 imgref = eval("document." +imgname);

 x = imgref.width;
 y = imgref.height;
 if (  ( ( dx < Math.abs(x1-x) ) 
       && ( dy < Math.abs(y1-y) ) 
       ) 
    ) {  imgref.width = x + dx; 
         imgref.height = y + dy
      }
 else {
  clearInterval(ival);
  imgref.width = x1;
  imgref.height = y1;
     }
}
