// JavaScript Document
function setZoom(img, dir, width, height, margin, zIndex, delay) {
  setTimeout(function() {
    if (img.dir==dir) {
      img.style.width=width;
      img.style.height=height;
      img.style.margin=margin;
      img.style.zIndex=zIndex;
      img.parentNode.parentNode.style.zIndex=zIndex;
    }
  }, delay);
}

function larger(img, width, height, id) {
document.getElementById('showcase').style.display = "none";
document.getElementById('showcase').innerHTML = document.getElementById(id).innerHTML;

var queue = Effect.Queues.get('global');
queue.each(function(e) { e.cancel() });
new Effect.Appear(document.getElementById('showcase'), {duration:0.4, queue:'end'});
  //document.getElementById(id).style.display = "block";
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  for (i=now+1; i<=10; i++) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now));
  }
}

function smaller(img, width, height, id) {
//new Effect.Fade(document.getElementById('showcase'), {duration:0.0, queue:'end'});
  //document.getElementById(id).style.display = "none";
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  for (i=now-1; i>=0; i--) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'ltr', w, h, m, i, 20*(now-i));
  }
}  



//letters = new Array('a','b','c','d','e');
//    for (p=0; p<=4; p++) {
//	    for (c=1; c<=5; c++) {
//			z = letters[p] + c;
//		  document.getElementById(z).style.display = "none";
//			
//		}
//	}


