/**
 * Powiększa obrazek o 100%
 * Powiększa obrazek o 100%
 *
 
<img src="obrazek" width="70" height="70"
	style="width: 70px; height: 70px; z-index: 0; position: absolute;"
	onmouseover="larger(this,100,100)"
	onmouseout="smaller(this,70,70)"
>

Uwaga - POSITION ABSOLUTE więc wymaga nadrzędnego kontenera aby móc go pozycjonować (może być <SPAN>).

 
 * @author Diabl0
*/


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) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  bw = img.width;
  bh = img.height;
  sw = (width - bw) / 10;
  sh = (height - bh) / 10;
  for (i=now+1; i<=10; i++) {
    w= (bw + (sw*i) )+'px';
    h= (bh + (sh*i) )+'px';
    m=(-i)+'px 0 0 -'+(  (sw*i) /2 )+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now));
  }
}

function smaller(img, width, height) {
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  bw = img.width;
  bh = img.height;
  
  sw = (bw - width)/10;
  sh = (bh - height) / 10;
  for (i=now-1; i>=0; i--) {
    w= (bw - (sw*(10-i)) )+'px';
    h= (bh - (sh*(10-i)) )+'px';
    m=(-i)+'px 0 0 -'+(  (sw*i) /2 )+'px';
    setZoom(img, 'ltr', w, h, m, i, 20*(now-i));
  }
}
