var opac = new Array(100, 100, 100, 100);
var tt = new Array();
var tt2 = new Array();

var notIE = !(navigator.appVersion.indexOf("MSIE") != -1 && navigator.systemLanguage);
var Mozilla = navigator.userAgent.indexOf("Mozilla") != -1;

function unlight(q) {
	clearTimeout(tt2[q]); clearTimeout(tt[q]);
	opac[q]+=4;
	if(opac[q]>100) opac[q]=100;
	if(notIE){
		if(Mozilla) document.getElementById('img'+q).style.setProperty('-moz-opacity',opac[q]/100,null);
			else document.getElementById('img'+q).style="opacity: "+opac[q]/100;
	} else document.getElementById('img'+q).style.filter="alpha(opacity="+opac[q]+")";
	tt[q] = setTimeout("unlight("+q+")",30);
	if(opac[q]>=100) clearTimeout(tt[q]);
}

function light(q) {
	clearTimeout(tt[q]); clearTimeout(tt2[q]);
	if(opac[q]>0) opac[q]-=4;
	if(opac[q]<0) opac[q]=0;
	if(notIE){
		if(Mozilla) document.getElementById('img'+q).style.setProperty('-moz-opacity',opac[q]/100,null);
			else document.getElementById('img'+q).style="opacity: "+opac[q]/100;
	} else document.getElementById('img'+q).style.filter="alpha(opacity="+opac[q]+")";
	tt2[q] = setTimeout("light("+q+")",30);
	if(opac[q]<=4) clearTimeout(tt2[q]);
}


var mm = new Array();
var mm2 = new Array();
var height = new Array(1, 1, 1, 1);
var mup_stop = new Array(true, true, true, true);
var mdown_stop = new Array(true, true, true, true);

function moveup(q) {
	clearTimeout(mm2[q]);
	mdown_stop[q] = true;
	if(mup_stop[q]){ mup_stop[q] = false; mm[q] = setTimeout("mup("+q+")",8); }
}

function mup(q) {
	if(mdown_stop[q]) {
		height[q]+=2;
		if(height[q]>70) height[q]=70;
		document.getElementById('d'+q).style.height = height[q];
	//	document.getElementById('d'+q).style.marginTop = -(height[q]+5)+'px';
		if(document.getElementById('d'+q).style.display=='none') document.getElementById('d'+q).style.display='inline';
		if(height[q]>=70){ mup_stop[q] = true; clearTimeout(mm[q]); } else mm[q] = setTimeout("mup("+q+")",8);
	} else { mup_stop[q] = true; clearTimeout(mm[q]); }
}

function movedown(q) {
	clearTimeout(mm[q]);
	mup_stop[q] = true;
	if(mdown_stop[q]){ mdown_stop[q] = false; mm2[q] = setTimeout("mdown("+q+")",8); }
}

function mdown(q) {
	if(mup_stop[q]) {
		if(height[q]>0) height[q]-=2;
		if(height[q]<0) height[q]=0;
		document.getElementById('d'+q).style.height = height[q];
	//	document.getElementById('d'+q).style.marginTop = -(height[q]+5)+'px';
		if(height[q]<=0){ mdown_stop[q] = true; clearTimeout(mm2[q]); document.getElementById('d'+q).style.display='none'; } else mm2[q] = setTimeout("mdown("+q+")",8);
	} else { mdown_stop[q] = true; clearTimeout(mm2[q]); }
}
