// JavaScript Document

function visitGame(s)
{
	var game=s.options[s.selectedIndex].value;
	if(game!=0) window.location.href="/games/"+game;	
}

function setSelected()
{
	var s=document.getElementsByTagName('select')[0];
	
	var currentGame=window.location.href.split('/');	
	currentGame=currentGame[currentGame.length-1];	
	currentGame=unescape(currentGame);
	
	if (currentGame!='')
	{
		for (var i=0; i<s.options.length; i++)
		{
			if (s.options[i].text==currentGame)
			{
				s.options[i].selected=true;
				break;
			}
		}
	}
}