function tpulse()
{document.getElementById("oparea").value="part1"
	var age=document.getElementById("age").value;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
		var url="http://theamputeecoach.com/age_ajax.php"
		url=url+"?age="+age
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}

function bmi()
{document.getElementById("oparea").value="part2"
	var hgt=document.getElementById("hgt").value;
	var wgt=document.getElementById("wgt").value;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
		var url="http://theamputeecoach.com/bmi_ajax.php"
		url=url+"?hgt="+hgt+"&wgt="+wgt
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
var opid=document.getElementById("oparea").value;
			document.getElementById(opid).innerHTML=xmlHttp.responseText 

  }
}
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;
}
