function changeCatSelect(value)
{
	var catDiv = document.getElementById("catBoxCat");
	var ratedDiv = document.getElementById("catBoxTopRated");
	var playedDiv = document.getElementById("catBoxMostPlayed");

	switch(value)
	{
		case "category":
			ratedDiv.style.display = "none";
			playedDiv.style.display = "none";
			catDiv.style.display = "inline";
		break;
		case "timesplayed":
			ratedDiv.style.display = "none";
			playedDiv.style.display = "inline";
			catDiv.style.display = "none";
		break;
		case "rating":
			ratedDiv.style.display = "inline";
			playedDiv.style.display = "none";
			catDiv.style.display = "none";
		break;

	}

}
function bookmarksite(title, url)
{
	if (document.all)
	{
		window.external.AddFavorite(url, title);
  	}
  	else if (window.sidebar)
  	{
		window.sidebar.addPanel(title, url, "");
	}
}
function fullScreenDown(url)
{
	var gameDiv = document.getElementById('gameBoxMiddle');
	newWin = window.open(url, '_blank', 'width=800,height=600,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0');
	gameDiv.innerHTML = '';
	gameDiv.style.height='0px';
	newWin.focus();
}

function ratingOver(e)
{
	var slider = document.getElementById("ratingSlider");
	var numDiv = document.getElementById("ratingNum");
	var width = e.x;

	// if not using IE
	if(width == "" || width == null)
	{
		clientX = e.clientX;
		boxX = slider.boxObject.x;
		width = clientX - boxX;

	}
	if(width < 0) width = 0;
	if(width > 86) width = 86;
	var num = Math.round(width / 17 * 100) / 100;
	slider.style.width = width + "px";
	numDiv.innerHTML = "Rate this game a " + num + " out of 5";
}
function ratingDown(e)
{
	var numDiv = document.getElementById("ratingNum");
	var width = e.x;
	if(width < 0) width = 0;
	if(width > 86) width = 86;
	var num = Math.round(width / 17 * 100) / 100;
	alert("Vote this game as a " + num);
}
function ratingOut(curRating)
{
	var numDiv = document.getElementById("ratingNum");
	var slider = document.getElementById("ratingSlider");

	numDiv.innerHTML = "Current Rating: " + curRating + " out of 5";
	slider.style.width = curRating * 17 + "px";

}