//-----------------------------------------------------
//---Ajax For Loading Details From Selected Contact----
//-----------------------------------------------------
function LoadStateData(){
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
} 
//The script to run
var url="http://www.systemoneaps.com/wordpress/wp-content/themes/tubular_10/LoadStateData.asp";
//The form values
var params = "State="+document.getElementById('State').value;

//run function when state changes
xmlHttp.onreadystatechange=function(){ 
	if (xmlHttp.readyState==4) {
		//when things are ready to be shown then go ahead and show them. 
		document.getElementById('DataResults').innerHTML=xmlHttp.responseText;
	}
	else {
			//do something while we are waiting, how about showing an image.
			document.getElementById('DataResults').innerHTML="<img src='http://www.systemoneaps.com/wordpress/wp-content/themes/tubular_10/working2.gif'>";
	}
	}

//execute and send the form
xmlHttp.open("POST", url, true);
//Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(encodeURI(params));
}

function GetXmlHttpObject() {
    var xmlHttp = false;
    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;
}
