function getHttpObject(){ // var httpobject=null; if(window.XMLHttpRequest){ httpobject=new XMLHttpRequest(); }else if(window.ActiveXObject){ try{ httpobject=new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ httpobject=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ alert("could not find the http requst object"); return false; } } } return httpobject; } // takes you to search the leads as you select states /***************************************************************/ function votestate(state,vt){ httpobject=getHttpObject(); var url="http://atlanticcity.com/rate/js/getvotedetail.php?state="+state+"&vt="+vt; httpobject.onreadystatechange=showvotes; httpobject.open('GET',url,true); httpobject.send(null) } /***************************************************************/ // show the leads in function showvotes(){ if(httpobject.readyState==4 || httpobject.readyState=="complete"){ var arrval; arrval=httpobject.responseText; var arrdiv; var arrdivname; arrdiv=arrval.split("##"); arrdivname=arrdiv[1]; document.getElementById(arrdivname).innerHTML=arrdiv[0]; } }