﻿function ajaxRequest(Url,DivId)
{  
//alert(Url);
//alert(DivId);
	var AJAX;
	try{AJAX = new XMLHttpRequest();}  //Firefox
	catch(e)
	{
		try{AJAX = new ActiveXObject("Msxml2.XMLHTTP");}   //IE
		catch(e)
		{
			try{AJAX = new ActiveXObject("Microsoft.XMLHTTP");} //IE
			catch(e)
			{
				alert("Your browser does not support AJAX.");
				return false;
			}
		}
	}
	AJAX.onreadystatechange = function()
	{
		if(AJAX.readyState == 4)
		{
			if((AJAX.status ==200))
			{
				if(DivId != '')
					document.getElementById(DivId).innerHTML = AJAX.responseText;
			}
			else
			{
				alert("There was a problem retrieving data:\n" + AJAX.statusText + " - " + AJAX.status);
			}
		}
	}
	AJAX.open("get", Url, true);
	AJAX.send(null);
}

