var divisionID = "";
var url = "";
var callback = "";
function ajaxFunction(divID, url, callback)
{
  this.url = url;	    
  divisionID = divID;
  this.callback = callback;
  try
  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
  }
  catch (e)
  {
	    // Internet Explorer
	  	try
	    {
	    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  	catch (e)
	    {
	      try
	      {
	      	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	      }
	      catch(e)
	      {
	      		alert("Your browser does not support AJAX!");
	      		return false;
	      }
	    }
  }
  xmlHttp.onreadystatechange = processStateChange;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function processStateChange()
{
	/**
	 *	State	Description
	 *	0		The request is not initialized
	 *	1		The request has been set up
	 *	2		The request has been sent
	 *	3		The request is in process
	 *	4		The request is complete
	 */
	if (xmlHttp.readyState == 4)
	{
		if (xmlHttp.status == 200) // OK response
		{
			var response = xmlHttp.responseText;
			document.getElementById(divisionID).innerHTML = "";
			document.getElementById(divisionID).innerHTML = response;
			if(callback)
			{
				callback();
			}	 
		}
		else
		{			
			alert(xmlHttp.statusText);
		}
	}
}

