function ajaxFunction()
{
	var ajaxRequest;
	
	try
	{
			// Firefox, Opera 8.0+, Safari
			ajaxRequest = new XMLHttpRequest;
			return ajaxRequest;
	}
	catch(e)
	{
		// Internet Explorer
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			return ajaxRequest;
		}
		catch(e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				return ajaxRequest;
			}
			catch(e)
			{
				alert("Your browser does not support Ajax.");
				return false;
			}
		}
	}
}

function getyear(strURl)
{

	var httpObj = ajaxFunction();
	
	httpObj.onreadystatechange = function()
	{
		if(httpObj.readyState == 0)
		{
		}
		if(httpObj.readyState == 1)
		{
		}
		if(httpObj.readyState == 2)
		{
		}
		if(httpObj.readyState == 3)
		{
		}
		if(httpObj.readyState == 4)
		{
			if(httpObj.status == 200) 
			{ 
				document.getElementById('statediv').innerHTML = httpObj.responseText;
			}
			else
			{
				alert("There was a problem while using XMLHTTP:\n");
			}
		}
	}
	httpObj.open("GET", strURl, true);
	httpObj.send(null);
}



function getmodel(strURl)
{

	var httpObj = ajaxFunction();
	
	httpObj.onreadystatechange = function()
	{
		if(httpObj.readyState == 0)
		{
		}
		if(httpObj.readyState == 1)
		{
		}
		if(httpObj.readyState == 2)
		{
		}
		if(httpObj.readyState == 3)
		{
		}
		if(httpObj.readyState == 4)
		{
			if(httpObj.status == 200) 
			{ 
				document.getElementById('modeldiv').innerHTML = httpObj.responseText;
			}
			else
			{
				alert("There was a problem while using XMLHTTP:\n");
			}
		}
	}
	httpObj.open("GET", strURl, true);
	httpObj.send(null);
}

function getTModel(strURl)
{

	var httpObj = ajaxFunction();
	
	httpObj.onreadystatechange = function()
	{
		if(httpObj.readyState == 0)
		{
		}
		if(httpObj.readyState == 1)
		{
		}
		if(httpObj.readyState == 2)
		{
		}
		if(httpObj.readyState == 3)
		{
		}
		if(httpObj.readyState == 4)
		{
			if(httpObj.status == 200) 
			{ 
				document.getElementById('TModelDiv').innerHTML = httpObj.responseText;
			}
			else
			{
				alert("There was a problem while using XMLHTTP:\n");
			}
		}
	}
	httpObj.open("GET", strURl, true);
	httpObj.send(null);
}
