3 <p>This election was run using:
4 <strong><%= ELECTION_TYPES[@election.election_method] %></strong></p>
6 <p>View results using other methods:<br />
7 <% type_hash = {}; ELECTION_TYPES.each {|k,v| type_hash[v] = k} %>
8 <%= select_tag 'election_type_select', options_for_select(type_hash, @election.election_method) %></p>
11 var election_methods = new Array(<%= ELECTION_TYPES.keys.collect {|k| "'#{k}'"}.join(', ') %>);
12 var method_select = $('election_type_select');
14 function show_results_for() {
18 var result_boxes = document.getElementsByClassName('resultbox');
19 for (i = 0; i < result_boxes.length; i++) {
20 result_box = result_boxes[i];
21 if (result_box.id == (method_select.value + "_result")) {
22 Element.show(result_box);
24 Element.hide(result_box);
28 //alert(method_select.value);
31 Event.observe(method_select, 'change', show_results_for);
35 <%= image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%>