<% var contests = getContests(); var electionDetails = getElectionDetails(); var globalPageSettings = getGlobalPageSettings(); var voteFor = (globalPageSettings['vote for'] !== '' ? globalPageSettings['vote for'] : 'Vote For '); var showVoteFor = electionDetails['showvotefor'] == '1' ? true : false; var of = globalPageSettings['of'] !== '' ? globalPageSettings['of'] : 'of'; var reporting = (globalPageSettings['areas'] !== '' ? globalPageSettings['areas'] : 'Precincts') + ' ' + (globalPageSettings['reporting'] !== '' ? globalPageSettings['reporting'] : 'Reporting'); var summaryPageSettings = getSummaryPageSettings(); var showVoteTypeDetails = electionDetails['showvotetypedetails'] == '0' ? false : true; var showPrecinctVoteTypeDetails = electionDetails['showprecinctvotetypedetails'] == '0' ? false : true; var showPrecinctsRptDetailPerContest = electionDetails['showprecinctsrptdetailspercontest'] == '0' ? false : true; var showPrecinctsRptg = electionDetails['showprecinctsrptg'] == '0' ? false : true; var voteTypeIcon = summaryPageSettings['vote type icon'] !== '' ? summaryPageSettings['vote type icon'] : 'Vote Type'; var detailIcon = summaryPageSettings['detail icon'] !== '' ? summaryPageSettings['detail icon'] : 'Detail'; var voteTypeTabularIcon = summaryPageSettings['vote type tabular icon'] !== '' ? summaryPageSettings['vote type tabular icon'] : 'Vote Type Tabular'; var precinctsReportingIcon = summaryPageSettings['precincts reporting icon'] !== '' ? summaryPageSettings['precincts reporting icon'] : 'Precincts Reporting'; var map = globalPageSettings['map'] == undefined ? "Map" : globalPageSettings['map']; var detail = globalPageSettings['detail'] == '' ? "Detail" : globalPageSettings['detail']; var viewState = new ViewState().deserialize(); var jsonString = viewState.getContestFilter(); var showAll = false; var contestFilter = null; if (jsonString == undefined) { showAll = true; } else { var str = unescape(jsonString); var contestFilter = eval('(' + str + ')'); if (new ContestFilter().IsContestFilterEmpty(contestFilter)) { showAll = true; } } %> <% for(var i=0, l = contests.length; i <% var contest = contests[i]; var areasReporting = of + ' ' + contest.TP + ' ' + reporting; var key = contest.K; var keyStr = "'" + key + "'"; var visible = 'block'; if(!showAll){ if(contestFilter[key] != '1'){ visible = 'none'; } else{ visible = 'block'; } } %>
<%=contest.C%> <% if(showVoteFor) { %> <%='(' + voteFor + ' ' + contest.VF + ')'%> <% } %>
<% if (showPrecinctVoteTypeDetails || showPrecinctsRptg) { %> <% } %>
<% if(showVoteTypeDetails) { %> <% } %> <% if(showPrecinctsRptDetailPerContest) { %> <% } %>
<% var choices = contest.CH; %> <% for(var k = 0, cl = choices.length; k <% var choice = choices[k]; %> <% var summaryPageSettings = getSummaryPageSettings(); var voteTotal = sumVotes(contest.V); var choicePercent = calculatePercent(contest.V[k], voteTotal); var choicePercentFormatted = formatPercent(choicePercent); var party = (contest.P[k] !== undefined ? contest.P[k] : ''); if(party !== '') party = '(' + party + ')'; %> <% if(contest.W[k] == 1) { %> <% } else { %> <% } } %>
<%=globalPageSettings['choice']%> <%=getRunoffOrRecount(contest)%>   <%=globalPageSettings['votes']%> <%=globalPageSettings['percent']%> <%=globalPageSettings['bar percentage']%>
<%=choice%> <%=party%> <%=formatVotes(contest.V[k])%> <%=choicePercentFormatted%>
>
<%=choice%> <%=party%> <%=formatVotes(contest.V[k])%> <%=choicePercentFormatted%>
>
<%=globalPageSettings['total']%> <%=formatVotes(voteTotal)%>
<% } %>