var xmlHttp

function getvalues()
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Sorry.  Your browser is too old or unusual for this page to work.  The rest of the site will work fine though.");
	  return;
	} 
	
	var tmwins=document.getElementById('tmwins').value
	var nationalruns=document.getElementById('nationalruns').value
	var seasonwins=document.getElementById('seasonwins').value
	var weight1=document.getElementById('weight1').value
	var weight2=document.getElementById('weight2').value
	var age1=document.getElementById('age1').value
	var age2=document.getElementById('age2').value
	var seasonfalls=document.getElementById('seasonfalls').value
	var careerfalls=document.getElementById('careerfalls').value
	var lastrun=document.getElementById('lastrun').value
	var chaseruns=document.getElementById('chaseruns').value
	var officialrating=document.getElementById('officialrating').value
	var seasonruns=document.getElementById('seasonruns').value
	var biggestchasewin=document.getElementById('biggestchasewin').value
	var lastrace1=document.getElementById('lastrace1').value
	var lastrace2=document.getElementById('lastrace2').value
	var careermoney=document.getElementById('careermoney').value
	
	
	var url = '/php/form_list.php?tmwins=' + tmwins + "&nruns=" + nationalruns + "&swins=" + seasonwins
	+ "&w1=" + weight1 + "&w2=" + weight2 + "&a1=" + age1 + "&a2=" + age2
	+ "&cruns=" + chaseruns + "&or=" + officialrating + "&sruns=" + seasonruns 
	+ "&bcw=" + biggestchasewin + "&lr1=" + lastrace1 + "&lr2=" + lastrace2 + "&cm=" + careermoney 
	+ "&sfalls=" + seasonfalls + "&cfalls=" + careerfalls + "&lastrun=" + lastrun + "&sid=" + Math.random();
		
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("results").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;
}

