var stars;

function initStars() {
    stars = $('#question-vote-stars').rating(onVote, {maxvalue:5, increment:1, curvalue:0});
    disableVote();
}

function resetVote(points) {
    stars.reset(points);
}

function enableVote() {
    stars.enable();
}

function disableVote() {
    stars.disable();
}

function setDisabledVoteText(text) {
    stars.setDisabledText(text);
}

function onVote(points) {
	var sendObject = new ServiceObject(TRIVIAL_URL);
	var json = {"msg":"/last " + points};
	var myMessage = JSON.stringify(json);
	sendObject.addParam("inMessage", myMessage); 		
	sendObject.call("sendMessage");	
	return;
}
