/* This Code Free To Use As Long As These Lines Remain */
/* DOM Image Rollover Code */
/* Created by Chris Poole <http://www.chrispoole.com> */
/* Featured at <http://www.DesignerWiz.com> */
/* Development Resource & JavaScript Public Archive Center */
function initImgHover() {


	if (!document.getElementById) return

	var imgOriginSrc;
	var imgTemp = new Array();
	var imgarr = document.getElementsByTagName('img');
	
	for (var i = 0; i < imgarr.length; i++) 
	{	
		if (imgarr[i].getAttribute('hsrc')) 
		{
			imgTemp[i] = new Image();
			imgTemp[i].src = imgarr[i].getAttribute('hsrc');			
			imgarr[i].onmouseover = function() 
			{ 
				imgOriginSrc = this.getAttribute('src');
				this.setAttribute('src',this.getAttribute('hsrc'));
			}
			imgarr[i].onmouseout = function() 
			{
				this.setAttribute('src',imgOriginSrc)
			}
		}
	}
}


s=6.25;
e=7.25;

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) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  incr=(e-s)/10;
  for (i=now+1; i<=10; i++) {
    w=s+(i*incr)+'em';
    m=(-(incr*i)/2)+'em 0 0 '+(-(incr*i)/2)+'em';
    setZoom(img, 'rtl', w, w, m, i, 20*(i-now));
  }
}

function smaller(img) {
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  incr=(e-s)/10;
  for (i=now-1; i>=0; i--) {
    w=s+(i*incr)+'em';
    m=(-(incr*i)/2)+'em 0 0 '+(-(incr*i)/2)+'em';
    setZoom(img, 'ltr', w, w, m, i, 20*(now-i));
  }
}

