// JavaScript Document
var selecting = 1;
function nextGame()
{
	if (selecting < 3)
	{
		selecting = selecting + 1;
		updateGameSelect();
	}
}
function previousGame()
{
	if (selecting > 0)
	{
		selecting = selecting - 1;
		updateGameSelect();
	}
}
function updateGameSelect()
{
	if (selecting == 0)
		document.getElementById("IDgameSelect").innerHTML = "<a href='" + rootadd + "/CBX/index.php'><img src='" + rootadd + "/common/img/chaosball.jpg' width='160px'/></a><br><a href='" + rootadd + "/CBX/index.php'>Chaos Ball Extreme</a>";
	if (selecting == 1)
		document.getElementById("IDgameSelect").innerHTML = "<a href='" + rootadd + "/KB/index.php'><img src='" + rootadd + "/common/img/killbilly.jpg' width='160px'/></a><br><a href='" + rootadd + "/KB/index.php'>Kill Billy</a>";
	if (selecting == 2)
		document.getElementById("IDgameSelect").innerHTML = "<a href='" + rootadd + "/spectrum/index.php'><img src='" + rootadd + "/common/img/spectrum.jpg' width='160px'/></a><br><a href='" + rootadd + "/spectrum/index.php'>Spectrum Demo</a>";
	if (selecting == 3)
		document.getElementById("IDgameSelect").innerHTML = "<a href='" + rootadd + "/CBX2/index.php'><img src='" + rootadd + "/common/img/chaosball2.jpg' width='160px'/></a><br><a href='" + rootadd + "/CBX2/index.php'>Chaos Ball Hypnosis</a>";
		
	if (selecting == 0)
		document.getElementById("IDleftArrow").style.visibility = "hidden";
	else
		document.getElementById("IDleftArrow").style.visibility = "visible";
		
	if (selecting == 3)
		document.getElementById("IDrightArrow").style.visibility = "hidden";
	else
		document.getElementById("IDrightArrow").style.visibility = "visible";
}
function initialize()
{
	updateGameSelect();
	MM_preloadImages(rootadd + '/common/img/chaosball.jpg');
	MM_preloadImages(rootadd + '/common/img/killbilly.jpg');
	MM_preloadImages(rootadd + '/common/img/spectrum.jpg');
	MM_preloadImages(rootadd + '/common/img/chaosball2.jpg');
}