
function getAcronym(acro)
{
	var page = "gl.asp?ac=" + acro;
	var dest = document.getElementById("showg");
	dest.src = page;
}

function randomvalue(high)
{
	var n = Math.floor(Math.random() * high);
	if (n == high) n = high-1;
	return n;
}

function changeNow()
{
 var i = randomvalue(rows);
 var j = randomvalue(panel.childNodes[i].childNodes.length);
 var cell = panel.childNodes[i].childNodes[j].firstChild;
 if (cell) cell.style.backgroundColor = backCol[randomvalue(noCols)];
}

function startCells()
{
	if (!document.getElementById) return;
	var divpanel = document.getElementById("divpanel");
	if (divpanel != null)
	{
		divpanel.innerHTML = panelBody();
		panel = document.getElementById("cells");
		if (panel != null)
		{
			rows = panel.childNodes.length;
			for (i=0; i<40; i++) changeNow();
			setInterval('changeNow()', delay);
		}
	}
}

function panelBody()
{
	var str = '';
  str+= '<table border="0" cellspacing="2" cellpadding="0">';
  str+= '<tbody id="cells">';
  str+= '<tr><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td colspan=\"4\"></td></tr>';
  str+= '<tr><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td colspan=\"3\"></td></tr>';
  str+= '<tr><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td colspan=\"2\"></td></tr>';
  str+= '<tr><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td></td></tr>';
  str+= '<tr><td></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>';
  str+= '<tr><td colspan=\"2\"></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>';
  str+= '<tr><td colspan=\"3\"></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>';
  str+= '<tr><td colspan=\"4\"></td><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>';
  str+= '<tr><td colspan=\"5\"></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>';
  str+= '<tr><td colspan=\"7\"></td><td><div></div></td></tr>';
  str+= '</tbody>';
  str+= '</table>';
  return str;
}

var backCol = new Array('#91A9CB', '', '#DAE4E5', '#AABCD0', '', '#CFDCE4', '', '#A9C0E0', '');
var rows = 0;
var noCols = backCol.length;
var delay = 150;
var panel = null;

