var Stars = 5;
var Voted = 0;
var InitTxt = "";

function PutYellowStar(ID)
{
	document.getElementById(ID).style.backgroundImage = 'url(img/star_mini.png)';
}

function PutGrayStar(ID)
{
	document.getElementById(ID).style.backgroundImage = 'url(img/star_mini_gray.png)';
}

function ValutationOver(StarNum, In)
{
	StarNum = Voted == 0 ? StarNum : Voted;

	for (i = 1; i <= Stars; i++)
	{
		PutGrayStar('star_' + i);
	}

	for (i = 1; i <= StarNum; i++)
	{
		PutYellowStar('star_' + i);
	}

	if (InitTxt == "")
	{
		InitTxt = document.getElementById('val_comment').innerHTML;
	}

	if (In)
	{
		Text = ValComm[i-2];
	}

	else
	{
		Text = InitTxt;
	}

	if (!Voted)
	{
		document.getElementById('val_comment').innerHTML = Text;
	}
}

function Valute(id, vote)
{
	if (Voted == 0)
	{
		Voted = vote;

		OpenAjaxURL("vote.php?id=" + id + "&vote=" + vote, 'val_comment');
	}
}
