p = new Image();
p2 = new Image();
g = 'gamma_arrow.gif';
d = '0';
isO = 1;
try {
	opera;
}
catch(e) {
	isO = 0;
	if (navigator.appName == "Netscape")
		isM = 1;
	else
		isM = 0;
}
	
function ib(bi) {
	for (a = -5; a < 6; a++)
		document.write('<img onmouseover="bov(this);" onmouseout="bou(this);" onclick="b(' + a +', this);" style="cursor:hand;" src=/i/0.gif width=20 height=18 id="' + bi + a +'">');
}

function bd() {
    d = document.getElementById("gamma_num").value;

	b(Number(d), document.getElementById('b' + d));
}

function b(v, w) {
	if (isO == 0 && isM == 0) {
		if (v < 0)
			gamma.src='/i/black.gif';
		if (v > 0)
			gamma.src='/i/white.gif';
		if (v == 0)
			gamma.src='/i/0.gif';
                gamma.style.filter='alpha(opacity=' + Math.abs((v * 5)) + ')';
		}
	else {
		if (v < 0)
			s = "black";
		if (v > 0)
			s = "white";
		if (v != 0)
			document.getElementById("gamma").style.backgroundImage = 'url(/i/' + s + Math.abs((v * 5)) + '.png)';
		else
			document.getElementById("gamma").style.backgroundImage = 'url(/i/0.gif)';
	}
	if (w.id.substr(1, 1) != "b")
		w2 = document.getElementById('bb' + w.id.substr(1));
	else 
		w2 = document.getElementById('b' + w.id.substr(2));
	
	p.src = "/i/0.gif";
	p2.src = "/i/0.gif";
	w.src = "/i/" + g;
	w2.src = "/i/" + g;
	p = w;
	p2 = w2;
	document.getElementById("gamma_num").value=v;
}

function bov(w) {
	if (w.src.substr(w.src.length-15) != g)
		w.src = '/i/gamma_arrow2.gif';
}

function bou(w) {
	if (w.src.substr(w.src.length-15) != g)
		w.src = '/i/0.gif';
}
