/**************************************************************************************************/
/* brocard
/* ajax-engine-vers1.js
/* made by Thomas Brückhändler, www.edv-service-tb.de
/**************************************************************************************************/
function AJAXRequest(url, parameters) {
	http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			// set type accordingly to anticipated content type
			http_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
		   	http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		alert(Err_cannot_create_instance);
		return false;
	}
	http_request.onreadystatechange = SetContent;

	/**
		Absetzen des POST Request
	*/
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
}
function SetContent() {
	if (http_request.readyState == 4) {
    	if (http_request.status == 200) {
//        	alert(http_request.responseText);
			eval(http_request.responseText);
//       		document.getElementById('pointermessagecontainer').innerHTML = http_request.responseText;
     	} else {
        	alert(glob_Err_Problem_with_Request);
     	}
  	}
}
function GetContent_v2(pPHPScript,pLangID,pMode,pID,pContainerID,pTop,pLeft,pWidth,pHeight) {
	var poststr	= "LangID=" + pLangID + "&mode=" + pMode + "&xID=" + pID + "&DivID=" + pContainerID;
	var LoadingPic = '<img src="' + glob_SkinImageBaseURL + 'waitingcircle.gif"  width="20" height="20" vspace="0" hspace="0" border="0" alt="preloading" title="preloading" />';
	switch (pMode)
	{
		case 'getContentObject':
			ShowContainer(pContainerID,pTop,pLeft,pWidth,pHeight)
			document.getElementById(pContainerID).innerHTML = '<center>'+LoadingPic+'</center>';
			AJAXRequest(glob_PHPscriptBaseURL+pPHPScript,poststr);
			break;
		case 'getContentColumn':
			document.getElementById(pContainerID).innerHTML = '';
			document.getElementById(pContainerID).innerHTML = LoadingPic;
			poststr += '&ScndDivID' + "=" + pTop; // pTop kann in diesem Falle die ID eines DIVs tranportieren
			AJAXRequest(glob_PHPscriptBaseURL+pPHPScript,poststr);
			break;
		case 'off':
	}

}
//* -------------------------------------------------------------------------- */


function ShowContainer(pContainerID,pTop,pLeft,pWidth,pHeight)
{
	document.getElementById(pContainerID).style.top = pTop + 'px';
	document.getElementById(pContainerID).style.left = pLeft + 'px';
	document.getElementById(pContainerID).style.width = pWidth + 'px';
	document.getElementById(pContainerID).style.height = pHeight + 'px';
	document.getElementById(pContainerID).style.visibility = 'visible';
	document.getElementById(pContainerID).style.display = 'block';
}

function HideContainer(pContainerID)
{
	document.getElementById(pContainerID).style.visibility = 'hidden';
	document.getElementById(pContainerID).style.display = 'none';
}

function ClearContent()
{
	document.getElementById('PopupContent').innerHTML = '';
}

