var items = new Array();
var count = 0;
var wid = new Array();
var	hei = new Array();
var maT = new Array();
function addItem(id) {
	var ite;
	for( var i = 0; i < items.length; i++ ) {
		if( items[i] == id ) {
			ite = i;
			break;
		}
	}
	if( ite == undefined ) {
		items[count] = id;
		wid[count] = 80;
		hei[count] = 60;
		maT[count] = 10;
		ite = count;
		count++;
	}
	return ite;
}

var timeouts = new Array();
function zoomIn(id) {
	var pos = addItem(id);
	var div = document.getElementById(items[pos]);
	var element = document.getElementById(items[pos]+"_img");
	if( wid[pos] < 100 || hei[pos] < 75 || maT[pos] > 2 ) {
		if( wid[pos] < 100 )
			wid[pos] += 1;
		if( hei[pos] < 75 )
			hei[pos] += 0.75;
		if( maT[pos] > 2 )
			maT[pos] -= 0.39;
		element.style.width = wid[pos]+"px";
		element.style.height = Math.ceil(hei[pos])+"px";
		div.style.width = wid[pos]+"px";
		div.style.height = Math.ceil(hei[pos])+"px";
		div.style.marginTop = Math.ceil(maT[pos])+"px";
		clearTimeout(timeouts[pos]);
		timeouts[pos] = window.setTimeout("zoomIn('"+id+"')",5);
	}
}
function zoomOut(id) {
	var pos = addItem(id);
	var div = document.getElementById(items[pos]);
	var element = document.getElementById(items[pos]+"_img");
	if( wid[pos] > 80 || hei[pos] > 60 || maT[pos] < 10 ) {
		if( wid[pos] > 80 )
			wid[pos] -= 1;
		if( hei[pos] > 60 )
			hei[pos] -= 0.75;
		if( maT[pos] < 10 )
			maT[pos] += 0.39;
		element.style.width = wid[pos]+"px";
		element.style.height = Math.ceil(hei[pos])+"px";
		div.style.width = wid[pos]+"px";
		div.style.height = Math.ceil(hei[pos])+"px";
		div.style.marginTop = Math.ceil(maT[pos])+"px";
		clearTimeout(timeouts[pos]);
		timeouts[pos] = window.setTimeout("zoomOut('"+id+"')",20);
	}
}
