var xmlHttp;

function GetXmlHttpObject()
{
var xmlHttp=null;
try             
 {              
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();  
 }
catch (e)
 {
 //Internet Explorer
 try
  {             
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }      
return xmlHttp;
}

function closeHint() {
 document.getElementById("hintbox").style.display="none"
}

function getHint(hint) {
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="http://www.ccleague.net/gethint.php"
url=url+"?hint="+hint
url=url+"&sid="+Math.random() 
xmlHttp.onreadystatechange=stateChangedGetHint
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChangedGetHint()
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 scroll(0,200)
 document.getElementById("hintbox").style.display="block"
 document.getElementById("hintbox").style.border="1px solid #DF7401"
 document.getElementById("hintbox").style.backgroundColor="#F2F5A9"
 document.getElementById("hintbox").style.padding="1em"
 document.getElementById("hintbox").innerHTML=xmlHttp.responseText
 }
}


function callSignUp(userid)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var email = document.getElementById("email").value
var eventname = document.getElementById("eventname").value
var url="http://www.ccleague.net/signup.php"
url=url+"?email="+email
url=url+"&eventname="+eventname
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedCallSignUp
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
 
function stateChangedCallSignUp()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("signup").innerHTML=xmlHttp.responseText
 }
}

function getCollegeEnrollmentImpact()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var id = document.getElementById("collegeid").value
var url="http://www.ccleague.net/collegeenrollment.php"
url=url+"?id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedCollegeEnrollmentImpact
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedCollegeEnrollmentImpact()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("impact").innerHTML=xmlHttp.responseText
 }
} 

function getCYDistrictBudgetImpact()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var id = document.getElementById("districtid").value
var url="http://www.ccleague.net/cyimpact.php"
url=url+"?id="+id 
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedCYDistrictBudgetImpact
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedCYDistrictBudgetImpact()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("februarysurprise").innerHTML=''
 document.getElementById("statewide").innerHTML=''
 document.getElementById("impact").innerHTML=xmlHttp.responseText
 }
}

 
function getDistrictBudgetImpact()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var id = document.getElementById("districtid").value
var url="http://www.ccleague.net/districtimpact2.php"
url=url+"?id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDistrictBudgetImpact
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedDistrictBudgetImpact()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("statewide").innerHTML=''
 document.getElementById("impact").innerHTML=xmlHttp.responseText
 }
}

function getDistrictBudgetImpact2()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var id = document.getElementById("districtid").value
var url="http://www.ccleague.net/districtimpact2.php"   
url=url+"?id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDistrictBudgetImpact2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedDistrictBudgetImpact2()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("statewide").innerHTML=''
 document.getElementById("impact").innerHTML=xmlHttp.responseText
 }
}



function getLegislators(campaign)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var zip = document.getElementById("zip").value
var url="http://www.ccleague.net/getlegislators.php"
url=url+"?zip="+zip
url=url+"&campaign="+campaign
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedGetLegislators
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}



function stateChangedGetLegislators()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("mylegislators").innerHTML=xmlHttp.responseText
 }
}


