function setUpVoting() {
    $("#VoteSelector1 option:selected").each(function () {
    if ($(this).attr("value") != "-1")                   
                $("#VoteSelector1 input.VoteAdder").show();
            else
                $("#VoteSelector1 input.VoteAdder").hide();
      })

    $("#VoteSelector2 option:selected").each(function () {
            if ($(this).attr("value") != "-1")                   
                $("#VoteSelector2").show();
            else
                $("#VoteSelector2").hide();
      }); 
    $("#VoteSelector3 option:selected").each(function () {
            if ($(this).attr("value") != "-1")
                $("#VoteSelector3").show();
            else
                $("#VoteSelector3").hide();
      }); 

}

function addVoting() {
    if ($("#VoteSelector2").is(":hidden")) {
        $("#VoteSelector2").show("fast");
        return;
    }
    if ($("#VoteSelector3").is(":hidden")) {
        $("#VoteSelector3").show("fast");
        return;
    }
}

function toggleVotingResults(VotingId, Index, Max) {
    if (!Votings[VotingId][Index]) {                   
        $("#VotingResult" + VotingId + " li:lt(" + Index + ")").show();
        $("#VotingResult" + VotingId + " li:eq(" + Index + ")").hide();
        $("#VotingResult" + VotingId + " li:gt(" + Index + ")").hide();
        
        if ($("#VotingResult" + VotingId + " li.VoteEntry").is(":hidden"))
            $("#VotingResult" + VotingId + " li.VoteMore").show();
        else 
            $("#VotingResult" + VotingId + " li.VoteMore").hide();
    }
    else {
        $("#VotingResult" + VotingId + " li ").hide();
    }

   
    if (Votings[VotingId][Index]) { 
        Votings[VotingId][Index] = false;
        Votings[VotingId][Max] = false;
        }
    else
        Votings[VotingId][Index] = true;
}

function checkVoteEntryForm() {
    var selected = true
     $("#VSelector option:selected").each(function () {
            if ($(this).attr("value") == "-1") {
                alert ('Bitte wählen Sie zuerst einen Tipp aus!');
                selected = false;
            }
      }); 
    return selected;
}

function initVotingResults() {
    //$(".VoteScroller ul li ul").find("li:hidden:first").before("<li class=\"VotingMore\">mehr</li>");     
}