function preLoadImages(args) {
var num = preLoadImages.arguments.length;
var i = 0;
var images = new Array();
while (i<num) {
images[i] = new Image();
images[i].src = preLoadImages.arguments[i];
i++;
}
}

function growMe( img ) {
	imgName = img.src;
	imgBigName = imgName.replace('_small','');
	
	imgBig = new Image();
	imgBig.src = imgBigName;
	imgBigWidth = imgBig.width;
	imgBigHeight = imgBig.height;
	
	imgWidth = img.width;
	imgHeight = img.height;
	
	diffWidth = (imgBigWidth-imgWidth)/2;
	diffHeight = (imgBigHeight-imgHeight)/2;
	img.src = imgBigName;
	img.style.position = "relative";
	img.style.zIndex = 200;
	img.style.marginLeft = "-"+diffWidth+"px";
	img.style.marginRight = "-"+diffWidth+"px";
	img.style.marginTop = "-"+diffHeight+"px";
	img.style.marginBottom = "-"+diffHeight+"px";
}

function shrinkMe( img ) {
	imgName = img.src;
	imgSmallName = imgName.replace('.gif','_small.gif');

	img.src = imgSmallName;
	img.style.position = "relative";
	img.style.zIndex = 200;
	img.style.marginLeft = "0px";
	img.style.marginRight = "0px";
	img.style.marginTop = "0px";
	img.style.marginBottom = "0px";
}

function showDetails( num,total ) {
	stopTimer(num);
	var element = "details"+num;
	var div = document.getElementById(element);
	div.style.display="block";
}

function hideDetails( num,total ) {
	for (i=1;i<=total;i++) {
		element = "details"+i;
		document.getElementById(element).style.display="none";
	}
}
var time = 0;
var speed = 10; // lower is faster
var openTill = 150; //stay open till time reaches
var timerRun;

function startTimer( num,total ) {
	time++;
	if (time<=openTill) {
		timerRun = setTimeout('startTimer( '+num+','+total+' )',speed);
	} else {
		hideDetails( num,total );
	}
}

function stopTimer() {
	clearTimeout(timerRun);
	time=0;
}
