// JavaScript Document function getObj(id) { return document.getElementById(id);} function addEvents() { if(getObj('vote_submit').addEventListener) { getObj('vote_submit').addEventListener('click',addVote,false);} if(getObj('vote_submit').attachEvent) { getObj('vote_submit').attachEvent('onclick',addVote);}} function addVote() { for(var i=1;i<5;i++) { if(getObj('vote'+i).checked) { submitVote(i); break;}}} function submitVote(vote) { var url = "http://waterfalls.jacobemerick.com/php/poll.php?vote="+escape(vote)+"&sid="+Math.random(); try { xmlHttp=new XMLHttpRequest();} catch(e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch(e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} catch(e) { alert("Your browser does not support AJAX. We cannot submit your vote."); return false;}}} xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState==4) { data = xmlHttp.responseText; if(data=='Error 1') { alert("You didn't vote correctly. Please try again.");} else if(data=='Error 2') { alert("There's a problem with cookies on your browser. Please try again.");} else if(data=='Error 3') { alert("There's a problem with the poller. Please try again later.");} else { getObj('poll_span').innerHTML = data;}}} xmlHttp.open('get',url,true); xmlHttp.send(null); return true;} if(document.addEventListener) { document.addEventListener("DOMContentLoaded",addEvents,false);} else { if (document.all && !window.opera){ document.write('