
Absentee Ballot Redirect
Please wait while we redirect you
var count = 0; //var cycle = setInterval(processForm, 500); var clicked = false; var iserr = false; function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(escape(results[2])); } function convertString(str) { console.log(str); var arr = str.split('&'); console.log(arr.length); var convertedString = ''; for(var i=0;i0) { var code = arr[i].replace(/\#/g,''); var codearr = code.split(';'); console.log(codearr[0]); if(codearr.length>1) { convertedString = convertedString + String.fromCharCode(codearr[0]) + codearr[1]; } else { convertedString = convertedString + String.fromCharCode(codearr[0]) } } else { convertedString = convertedString+arr[i]; } } return convertedString; } function getStateRedirect() { var url = ''; switch(state) { case 'AL': url='https://www.vote411.org/alabama#absentee-ballot-process'; break; case 'AK': url='https://www.vote411.org/alaska#absentee-ballot-process'; break; case 'AZ': url='https://www.vote411.org/arizona#absentee-ballot-process'; break; case 'AR': url='https://www.vote411.org/arkansas#absentee-ballot-process'; break; case 'CA': url='https://www.vote411.org/california#absentee-ballot-process'; break; case 'CO': url='https://www.vote411.org/colorado#absentee-ballot-process'; break; case 'CT': url='https://www.vote411.org/connecticut#absentee-ballot-process'; break; case 'DE': url='https://www.vote411.org/delaware#absentee-ballot-process'; break; case 'DC': url='https://www.vote411.org/district-of-columbia#absentee-ballot-process'; break; case 'FL': url='https://www.vote411.org/florida#absentee-ballot-process'; break; case 'GA': url='https://www.vote411.org/georgia#absentee-ballot-process'; break; case 'HI': url='https://www.vote411.org/hawaii#absentee-ballot-process'; break; case 'ID': url='https://www.vote411.org/idaho#absentee-ballot-process'; break; case 'IL': url='https://www.vote411.org/illinois#absentee-ballot-process'; break; case 'IN': url='https://www.vote411.org/indiana#absentee-ballot-process'; break; case 'IA': url='https://www.vote411.org/iowa#absentee-ballot-process'; break; case 'KS': url='https://www.vote411.org/kansas#absentee-ballot-process'; break; case 'KY': url='https://www.vote411.org/kentucky#absentee-ballot-process'; break; case 'LA': url='https://www.vote411.org/louisiana#absentee-ballot-process'; break; case 'ME': url='https://www.vote411.org/maine#absentee-ballot-process'; break; case 'MD': url='https://www.vote411.org/maryland#absentee-ballot-process'; break; case 'MA': url='https://www.vote411.org/massachusetts#absentee-ballot-process'; break; case 'MI': url='https://www.vote411.org/michigan#absentee-ballot-process'; break; case 'MN': url='https://www.vote411.org/minnesota#absentee-ballot-process'; break; case 'MS': url='https://www.vote411.org/mississippi#absentee-ballot-process'; break; case 'MO': url='https://www.vote411.org/missouri#absentee-ballot-process'; break; case 'MT': url='https://www.vote411.org/montana#absentee-ballot-process'; break; case 'NE': url='https://www.vote411.org/nebraska#absentee-ballot-process'; break; case 'NV': url='https://www.vote411.org/nevada#absentee-ballot-process'; break; case 'NH': url='https://www.vote411.org/new-hampshire#absentee-ballot-process'; break; case 'NJ': url='https://www.vote411.org/new-jersey#absentee-ballot-process'; break; case 'NM': url='https://www.vote411.org/new-mexico#absentee-ballot-process'; break; case 'NY': url='https://www.vote411.org/new-york#absentee-ballot-process'; break; case 'NC': url='https://www.vote411.org/north-carolina#absentee-ballot-process'; break; case 'ND': url='https://www.vote411.org/north-dakota#absentee-ballot-process'; break; case 'OH': url='https://www.vote411.org/ohio#absentee-ballot-process'; break; case 'OK': url='https://www.vote411.org/oklahoma#absentee-ballot-process'; break; case 'OR': url='https://www.vote411.org/oregon#absentee-ballot-process'; break; case 'PA': url='https://www.vote411.org/pennsylvania#absentee-ballot-process'; break; case 'RI': url='https://www.vote411.org/rhode-island#absentee-ballot-process'; break; case 'SC': url='https://www.vote411.org/south-carolina#absentee-ballot-process'; break; case 'SD': url='https://www.vote411.org/south-dakota#absentee-ballot-process'; break; case 'TN': url='https://www.vote411.org/tennessee#absentee-ballot-process'; break; case 'TX': url='https://www.vote411.org/texas#absentee-ballot-process'; break; case 'UT': url='https://www.vote411.org/utah#absentee-ballot-process'; break; case 'VT': url='https://www.vote411.org/vermont#absentee-ballot-process'; break; case 'VA': url='https://www.vote411.org/virginia#absentee-ballot-process'; break; case 'WA': url='https://www.vote411.org/washington#absentee-ballot-process'; break; case 'WV': url='https://www.vote411.org/west-virginia#absentee-ballot-process'; break; case 'WI': url='https://www.vote411.org/wisconsin#absentee-ballot-process'; break; case 'WY': url='https://www.vote411.org/wyoming#absentee-ballot-process'; break; default: url='https://www.vote411.org/register'; } return url; } //var email = convertString(unescape(getParameterByName('email'))); var state = getParameterByName('state'); var stateRedirect = getStateRedirect(); setTimeout(function(){ if (stateRedirect.length > 0) { window.location = stateRedirect; } else { window.location = "https://ace.turbovote.org/?r=FB-fallback"; } }, 3000); function inspect() { if(iserr) { return false; } /*if(document.getElementsByName('EmailAddress').length > 0) { return true; } else { return false; }*/ } function processForm(count) { count++; console.log('value of inspect: '+inspect()); console.log('value of clicked: '+clicked); if(count > 8) { console.log('stopped because of too many calls'); clearInterval(cycle); forms[0].style.visibility='visible'; } if(inspect() && !clicked) { //document.getElementsByName('EmailAddress')[0].value = email; var subBtns = document.getElementsByClassName('at-submit'); var subBtn = subBtns[0]; clicked=true; var forms = document.getElementsByClassName('at-form'); subBtn.click(); //forms[0].style.visibility='visible'; } } // add two callback arrays so I can pass my functions to them // one for postRender where I can add my new dropdown to the DOM // one for alterPost where I can manipulate the data sent to EA //var nvtag_callbacks = nvtag_callbacks || {}; //nvtag_callbacks.preSegue = nvtag_callbacks.preSegue || []; //nvtag_callbacks.postRender = nvtag_callbacks.postRender || []; //nvtag_callbacks.alterErrors = nvtag_callbacks.alterErrors || []; /*nvtag_callbacks.preSegue.push(function submitSegue(args) { return args; });*/ var myAlterErrors= function(args) { console.log(args); args.errors.forEach(function(element) { if(element.length>0) { iserr=true; var loadingDiv = document.getElementById('load'); var forms = document.getElementsByClassName('at-form'); forms[0].style.visibility = 'visible'; loadingDiv.style.visibility='hidden'; } }); return args; } var myPostFill = function(args) { console.log(args); processForm(); return args; } //nvtag_callbacks.postRender.push(myPostFill); //nvtag_callbacks.alterErrors.push(myAlterErrors); .at-form { display:none; } .at-fields input[type=text], .at-fields input[type=email], .at-fields input[type=tel], .at-fields select { font-size:14px; height:auto; padding:6px; } label.at-select, label.at-text { font-size:14px; } article h1, article .a2a_kit { display:none; }