	function ShowStars(suffix, star, stars, alternate)
	{
		if (document.getElementById(suffix + 'rating') == null)
			return;

		DrawStars(suffix, star, stars, alternate);
	}
	
	function SetStars(suffix, star, stars, alternate)
	{
		if (document.getElementById(suffix + 'rating') == null)
			return;

		DrawStars(suffix, star, stars, alternate);
		document.getElementById(suffix + 'rating').value = star;

		var voteBox = document.getElementById('voteBox');
		if (voteBox != null)
			voteBox.parentNode.removeChild(voteBox);

		ajaxRequest(RatingsUrl + '&Rating=' + star, 'voteContainer');
	}

	function ClearStars(suffix, stars, alternate)
	{
		if (document.getElementById(suffix + 'rating') == null)
			return;

		DrawStars(suffix, parseInt(document.getElementById(suffix + 'rating').value), stars, alternate);
	}
	
	function DrawStars(suffix, star, stars, alternate)
	{
		if (document.getElementById(suffix + 'rating') == null)
			return;

		var fullStars = Math.floor(star + 0.25);
		var halfStar = (star - fullStars > 0.25);

		if (alternate)
		{
			for (var i = 1; i <= fullStars; i++)
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsAlternateFullStar';
				
			if(halfStar)
			{
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsAlternateHalfStar';
				fullStars++;
			}
		
			for (var i = fullStars + 1; i <= stars; i++)
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsAlternateGreyStar';
		}
		else
		{
			for (var i = 1; i <= fullStars; i++)
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsFullStar';
				
			if(halfStar)
			{
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsHalfStar';
				fullStars++;
			}
		
			for (var i = fullStars + 1; i <= stars; i++)
				document.getElementById(suffix + 'star' + i).className = 'StarRatingsClickable StarRatingsGreyStar';
		}
	}
	
	function ShowVoteBox()
	{
		var voteBox = document.getElementById('voteBox');
		var element = document.getElementById('voteContainer');
		if (voteBox == null)
		{
			voteBox = document.createElement('div');
			voteBox.id = 'voteBox';
			voteBox.innerHTML = VoteBoxHTML;
			voteBox.style.position = 'absolute';
			voteBox.style.left = '0px';
			voteBox.style.top = '0px';
			voteBox.style.border = '1px solid black';
			voteBox.style.background = '#eeeeee';
			voteBox.style.padding = '10px';
			voteBox.style.width = '100px';
			element.appendChild(voteBox);
		}
	}
