function toggleInfo(element) {
    if (document.getElementById(element).style.display == 'inline') {
        document.getElementById(element).style.display = 'none';
    } else {
        document.getElementById(element).style.display = 'inline';
    }
}

function highlight_stars(star_id) {
    var entry = star_id.substring(5, star_id.length-2);
    var score = star_id.substring(star_id.length-1, star_id.length)
    for (i=1; i<=score; i++) {
        document.getElementById('vote_'+entry+'_'+i).src = '/static/images/icons/stars/star.png';
    }
}

function unhighlight_stars(star_id) {
    var entry = star_id.substring(5, star_id.length-2);
    var score = star_id.substring(star_id.length-1, star_id.length)
    for (i=1; i<=5; i++) {
        document.getElementById('vote_'+entry+'_'+i).src = '/static/images/icons/stars/blank.png';
    }
}

function setHiddenVote(vote_result) {
    var results = [];
    results = vote_result.split(',', 1);
    document.getElementById('hidden'+results[0]).value = vote_result;
}
