
//
// Generates a random number.
//
var _oldnum = 0;
function randnum(min,max)
{
	var num = 0;
	num=Math.round(Math.random()*(max-min))+min;
	while (num == _oldnum)
	{
		num=Math.round(Math.random()*(max-min))+min;
	}
	_oldnum = num;
	return num;
}

//
// Sleeps a delay.
//
function sleep(delay)
{
	var start = new Date().getTime();
	while (new Date().getTime() < start + delay);
}

//
// Hides a tag by id.
//
function hide(id)
{
	var idTag = document.getElementById(id);
	idTag.style.display = "none";
}

//
// Shows a tag by id.
//
function show(id)
{
	var idTag = document.getElementById(id);
	idTag.style.display = "block";
}
