var Ajax = new Object();

Ajax.Request = function(url, callbackMethod)
{
	Ajax.request = Ajax.createRequestObject();
	Ajax.request.onreadystatechange = callbackMethod;
	Ajax.request.open("POST", url, true);
	Ajax.request.send(url);
}

Ajax.createRequestObject = function()
{
	var obj;
	if(window.XMLHttpRequest)
	{
		obj = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		obj = new ActiveXObject("MSXML2.XMLHTTP");
	}
	return obj;
}

Ajax.CheckReadyState = function(obj)
{
	if(obj.readyState == 0) { document.getElementById('loading').innerHTML = "Sending Request..."; }
	if(obj.readyState == 1) { document.getElementById('loading').innerHTML = "Loading..."; }
	if(obj.readyState == 2) { document.getElementById('loading').innerHTML = "Loading..."; }
	if(obj.readyState == 3) { document.getElementById('loading').innerHTML = "Loading..."; }
	if(obj.readyState == 4)
	{
		if(obj.status == 200)
		{
			document.getElementById('loading').innerHTML = "";
			return true;
		}
		else
		{
			document.getElementById('loading').innerHTML = "HTTP " + obj.status;
		}
	}
}

Ajax.CheckReadyStateDatesch = function(obj)
{
	if(obj.readyState == 0) {
			var optn = document.createElement("OPTION");
			optn.text = 'loading.';
			optn.value = 'loading';
			//document.getElementById('datesch').options.add(optn);
			 try {
				document.getElementById('datesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('datesch').add(optn); // IE only
		 	 }
		}
	if(obj.readyState == 1) {
			document.getElementById('datesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading..';
			optn.value = 'loading';
			//document.getElementById('datesch').options.add(optn);
			 try {
				document.getElementById('datesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('datesch').add(optn); // IE only
		 	 }
		}
	if(obj.readyState == 2) { 
			document.getElementById('datesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading...';
			optn.value = 'loading';
			//document.getElementById('datesch').options.add(optn);
			 try {
				document.getElementById('datesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('datesch').add(optn); // IE only
		 	 }
	}
	if(obj.readyState == 3) { 
			document.getElementById('datesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading....';
			optn.value = 'loading';
			//document.getElementById('datesch').options.add(optn);
			 try {
				document.getElementById('datesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('datesch').add(optn); // IE only
		 	 }
	}
	if(obj.readyState == 4)
	{
		if(obj.status == 200)
		{
			document.getElementById('loading').innerHTML = "";
			return true;
		}
		else
		{
			document.getElementById('loading').innerHTML = "HTTP " + obj.status;
		}
	}
}

Ajax.CheckReadyStateTimesch = function(obj)
{
	if(obj.readyState == 0) {
			var optn = document.createElement("OPTION");
			optn.text = 'loading.';
			optn.value = 'loading';
			//document.getElementById('timesch').options.add(optn);
			 try {
				document.getElementById('timesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('timesch').add(optn); // IE only
		 	 }
		}
	if(obj.readyState == 1) {
			document.getElementById('timesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading..';
			optn.value = 'loading';
			//document.getElementById('timesch').options.add(optn);
			 try {
				document.getElementById('timesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('timesch').add(optn); // IE only
		 	 }
		}
	if(obj.readyState == 2) { 
			document.getElementById('timesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading...';
			optn.value = 'loading';
			//document.getElementById('timesch').options.add(optn);
			 try {
				document.getElementById('timesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('timesch').add(optn); // IE only
		 	 }
	}
	if(obj.readyState == 3) { 
			document.getElementById('timesch').remove(0);
			var optn = document.createElement("OPTION");
			optn.text = 'loading....';
			optn.value = 'loading';
			//document.getElementById('timesch').options.add(optn);
			 try {
				document.getElementById('timesch').add(optn, null); // standards compliant; doesn't work in IE
		  	}
		 	 catch(ex) {
				document.getElementById('timesch').add(optn); // IE only
		 	 }
	}
	if(obj.readyState == 4)
	{
		if(obj.status == 200)
		{
			document.getElementById('loading').innerHTML = "";
			return true;
		}
		else
		{
			document.getElementById('loading').innerHTML = "HTTP " + obj.status;
		}
	}
}