/**
 * starts a new post ajax request [..] by http://www.easy-coding.de
 * depending on the callback type this function will fill a target container 
 * 	by addressing it from its string ID, from reference or by usage of
 *	a custom callback function
 *
 * @param url		string			url to post the request
 * @param postData	string			data in GET format
 * @param callback 	string|object|function	how to address the target container
 * @return		boolean			everytime false
 */


 
function ajaxPost(url, postData, callback) {
	
	/*
	
	function erzXMLHttpRequestObject(){
var req = null;
try{
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(Error){
		try{
			req = new ActiveXObject("MSXML2.XMTHTTP");
			}
			catch(Error){
				try{
					req = new XMLHttpRequest();
					}
					catch(Error){
						alert("Es konnte kein XMLHttpRequest-Objekt erzeugt werden");
						}
				}		
		}

return req;
}

function ErzeugeAJAXObjekt(){
	this.erzXMLHttpRequestObject = erzXMLHttpRequestObject;
}

o = new ErzeugeAJAXObjekt();
req = o.erzXMLHttpRequestObject();*/

	
	loadbar = function(){
		document.getElementById("ajaxResponse").style.filter = "alpha(opacity=100)";
		document.getElementById("ajaxResponse").style.opacity = "1";
	}
	var req;
 	try {
		req = window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); 
	} catch (e) {
		// browser does not have ajax support
	}
	
	req.onreadystatechange = typeof callback == 'function' ? callback : function() {
		document.getElementById("ajaxResponse").style.filter = "alpha(opacity=20)";
		document.getElementById("ajaxResponse").style.opacity = "0.2";
		 				if (req.readyState == 4 && req.status == 200) {
							loadbar();
			if(typeof callback == 'string') callback = document.getElementById(callback);
			if(callback) callback.innerHTML = req.responseText;
		}
	};
	req.open('POST', url, true);
	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req.send(postData);
	
	

	return false;
}

