﻿function ajaxFunction(id, state)
{
    try
    {    
        // Firefox, Opera 8.0+, Safari    
        xmlHttp=new XMLHttpRequest();
     }
     catch (e)
     {    
        // Internet Explorer    
        try
        {      
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
        }
        catch (e)
        {      
            try
            {        
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
            }
            catch (e)
            {        
                alert("Your browser does not support AJAX!");        
                return false;        
            }      
        }    
     }
     xmlHttp.onreadystatechange=function()
     {
         if(xmlHttp.readyState==0)
         {
             document.getElementById("jaxcontent").innerHTML="Loading";
         }
         if(xmlHttp.readyState==1)
         {
             document.getElementById("jaxcontent").innerHTML="Loading.";
         }
         if(xmlHttp.readyState==2)
         {
             document.getElementById("jaxcontent").innerHTML="Loading..";
         }
         if(xmlHttp.readyState==3)
         {
             document.getElementById("jaxcontent").innerHTML="Loading...";
         }
         if(xmlHttp.readyState==4)
         {
             document.getElementById("jaxcontent").innerHTML=xmlHttp.responseText;
         }
     }
    if (document.getElementById("jaxcontent").value != id)
    {
        xmlHttp.open("GET","/controls/taxtest.aspx?taxid=" + id + "&state=" + state,true);
        xmlHttp.send(null);
    }
    document.getElementById("jaxcontent").value = id;
}
function surplusFunction(id)
{
    try
    {    
        // Firefox, Opera 8.0+, Safari    
        xmlHttp=new XMLHttpRequest();
     }
     catch (e)
     {    
        // Internet Explorer    
        try
        {      
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
        }
        catch (e)
        {      
            try
            {        
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
            }
            catch (e)
            {        
                alert("Your browser does not support AJAX!");        
                return false;        
            }      
        }    
     }
     xmlHttp.onreadystatechange=function()
     {
         if(xmlHttp.readyState==0)
         {
             document.getElementById("jaxcontent").innerHTML="Loading";
         }
         if(xmlHttp.readyState==1)
         {
             document.getElementById("jaxcontent").innerHTML="Loading.";
         }
         if(xmlHttp.readyState==2)
         {
             document.getElementById("jaxcontent").innerHTML="Loading..";
         }
         if(xmlHttp.readyState==3)
         {
             document.getElementById("jaxcontent").innerHTML="Loading...";
         }
         if(xmlHttp.readyState==4)
         {
             document.getElementById("jaxcontent").innerHTML=xmlHttp.responseText;
         }
     }
    if (document.getElementById("jaxcontent").value != id)
    {
		//alert("/controls/surplus.aspx?taxid=" + id);
        xmlHttp.open("GET","/controls/surplus.aspx?taxid=" + id,true);
        xmlHttp.send(null);
    }
    document.getElementById("jaxcontent").value = id;
}

