// JavaScript Document

var speed = 20;
vh = 53/70;	
var dr = 1;
var vh;
var tt;
var oOpenImage = null;

function reset()
{
	var bla = 0;
	dr = 1;
	if (document.images) 
		{
			for (var i = 0; i < document.images.length; i++)
				{
					if (document.images[i].id.substring(0, 2) == 'zi')
						{
							if (document.images[i].width > 70)
							{
								document.images[i].width = 70;
								document.images[i].height = 53;
								document.images[i].style.zIndex = 9;											
							}
						}
				}
		}
}	

function replaceImage(what, fullimage){
	mimg = document.getElementById(what);
	mimg.src = fullimage;
	zoomin(what, fullimage);
}

function zoomin(what, fullimage)
{
	if(tt!=what) {
	//	reset();
		if (oOpenImage != null) {
			oOpenImage.width = 70;
			oOpenImage.height = 53;
			oOpenImage.style.position = 'relative';
			oOpenImage.style.zIndex = 5;
		}
	}

	tt = what;
	mimg = document.getElementById(what);
	oOpenImage = mimg;
	oOpenImage.style.position = 'absolute';
	oOpenImage.style.zIndex = 10;

	x = parseInt(mimg.width);
	x += dr*speed;

	mimg.width 	= x;
	mimg.height = parseInt(vh*x);
	mimg.style.zIndex = 10;	

	if((dr>0)&&(x>580)) {
		dr = -1;
		return false;
	}
	
	if((dr<0)&&(x<=70)) {
		dr = 1;
		//mimg.style.zIndex = 9;
		//oOpenImage.style.position = 'relative';
		oOpenImage.style.zIndex = 5;
		oOpenImage = null;
		return false;
	}
	window.setTimeout('zoomin(\''+what+'\')', 10); 
}

