// visual tricks for KCS page
// (c) 2007 Steven Kennedy

var pics = new Array(3);

pics = document.getElementsByTagName("img");

// instant zoom
function zoom(img){
	x = img.width;
	if (x == 160) {
		img.width = 320;
		img.height = 240;
	} else {
		img.width = 160;
		img.height = 120;
	}
} // end zoom

// animated zoom
function anizoom(img){
	var x = img.width;
	
	var currentimg;
	setcurrentimg(img);

	if (x == 160) {
		aniup = window.setInterval("grow(currentimg);",10);
	} else {
		anidown = window.setInterval("shrink(currentimg);",10);
	}
} // end zoom

function grow(x) {
	i = pics[x];
	
	i.width = i.width + 24;
	i.height = i.height + 18;
	if (i.width >= 320) {
		window.clearInterval(aniup);
	}
}// end grow

function shrink(x) {
	i = pics[x];
	
	i.width = i.width - 24;
	i.height = i.height - 18;
	if (i.width <= 160) {
		window.clearInterval(anidown);
	}
}// end shrink

function setcurrentimg(x) {
	if (x == pics[0]) {
		currentimg = 0;
	}
	if (x == pics[1]) {
		currentimg = 1;
	}
	if (x == pics[2]) {
		currentimg = 2;
	}
}
