var xmlHttp = new XMLHttpRequest();

/*function createRequestObject()
{
	var request_;
	var browser = navigator.appName;

	if(browser == "Microsoft Internet Explorer")
	{
		request_ = new ActiveXObject("Microsoft.XMLHTTP");
	}

	else request_ = new XMLHttpRequest();

	return request_;
}*/

function getInfo()
{
	xmlHttp.open('get','inc/maxdown.php?DayID='+ document.MaxDownDays.MaxDown2Day.selectedIndex);
	xmlHttp.onreadystatechange = handleInfo;
	xmlHttp.send(null);
}

function handleInfo()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('main').innerHTML = "<img src='imgs/loading.gif' align=\"center\">";
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('main').innerHTML = response;
	}
}

function getInfo2()
{
	xmlHttp.open('get','inc/maxcom.php?DayID='+ document.MaxComDays.MaxCom2Day.selectedIndex);
	xmlHttp.onreadystatechange = handleInfo2;
	xmlHttp.send(null);
}

function handleInfo2()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('main2').innerHTML = "<img src='imgs/loading.gif' align=\"center\">";
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('main2').innerHTML = response;
	}
}
function getInfo3()
{
	xmlHttp.open('get','inc/maxrate.php?DayID='+ document.MaxRateDays.MaxRate2Day.selectedIndex);
	xmlHttp.onreadystatechange = handleInfo3;
	xmlHttp.send(null);
}

function handleInfo3()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('main3').innerHTML = "<img src='imgs/loading.gif' align=\"center\">";
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('main3').innerHTML = response;
	}
}
