// aJax
var xmlHttp
window.xmlReturn 

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

function rangexmlLoadPage()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById('viewTyreDetailsDiv').innerHTML = xmlHttp.responseText ;		
	} 
}

function loadHTML(html)
{
	document.getElementById('viewTyreDetailsDiv').innerHTML = html ;
}

function viewRangeDiv(rangeID)
{
	linkURL = 'rangeDetails.php?rangeID='+rangeID ;
	xmlHttp=GetXmlHttpObject()
	xmlHttp.onreadystatechange = rangexmlLoadPage
	xmlHttp.open("GET",linkURL,true)
	xmlHttp.send(null)
}

function viewAlloyDiv(alloyID)
{
	linkURL = 'alloyDetails.php?alloyID='+alloyID ;
	xmlHttp=GetXmlHttpObject()
	xmlHttp.onreadystatechange = AlloyxmlLoadPage
	xmlHttp.open("GET",linkURL,true)
	xmlHttp.send(null)
	document.getElementById('viewAlloyDetailsDiv').style.display = 'block';
	document.getElementById('viewAlloyDetailsDiv').style.position = 'absolute';
	document.getElementById('viewAlloyDetailsDiv').style.left = ((900/2) - (500/2))+'px';
	document.getElementById('viewAlloyDetailsDiv').style.top = ((screen.availHeight/2) - (600/2))+'px';
}
function AlloyxmlLoadPage()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById('viewAlloyDetailsDiv').innerHTML = xmlHttp.responseText ;		
	} 
}
