<!-- 
// Get the HTTP Object
function getHTTPObject(){
	//alert("getHTTPObject");
   if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
   else if (window.XMLHttpRequest) return new XMLHttpRequest();
   else {
      alert("Your browser does not support AJAX.");
      return null;
   }
}   

// Change the value of the outputText field

// Implement business logic    
function getTheUserAgent(){

    httpObject = getHTTPObject();

	//For POST sumissions
	var url = "http://www.ps.missouri.edu/userAgentAjax/index.php";
	//alert(document.mainform);

	//var params = returnParams(document.mainform);
	var params = "";
	//alert(params);
	httpObject.open("POST", url, true);
	
	//Send the proper header information along with the request
	httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	httpObject.setRequestHeader("Content-length", params.length);
	httpObject.setRequestHeader("Connection", "close");
	
	httpObject.onreadystatechange = function() {//Call a function when the state changes.
		if(httpObject.readyState == 4 && httpObject.status == 200) {
			//alert(httpObject.responseText);
			//document.mainform.userAgentText.value = httpObject.responseText;
			//alert(httpObject.responseText);
			//document.write(httpObject.responseText);
		}
	}
	httpObject.send(params);
	//alert("httpObject.send(params);");
}

var httpObject = null;
	
getTheUserAgent();


//-->
