function mixtapeVote(mixtapeID, stars)
{
	vote("4415DCA1", mixtapeID, stars, onMixtapeVoteCompleted);
}

function onMixtapeVoteCompleted(json)
{
	if (typeof(json.error) != "undefined")
	{
		if (json.error == "LoginRequired")
		{
			alert("You must login before you are allowed to vote.");
		}
		else if (json.error == "CantRateOwn")
		{
			alert("You cannot vote on your own items ;-)");
		}
		else if (json.error == "AlreadyVoted")
		{
			alert("You have already voted.");
		}
		else
		{
			alert("An unknown error occured.");
		}
	}
	else if (typeof(json.result) != "undefined")
	{
		var typeID = json.result.typeID;
		var rating = Math.round(json.result.rating);
		var stars = getMixtapeStars(typeID);
		
		for (var i = 1; i < stars.length; i++)
		{
			var src = i <= rating ? STAR_ON : STAR_OFF;
			stars[i].src = src;
		}
		
		document.getElementById("MixtapeVoteThanks_" + typeID).style.display = "inline";
	}
}