var cReq;
var popupObj;


ajaxPopup = function() {

	this.loadPopup = function(parentElelent,urlParam) 
	{
		
		this.parentElement=parentElelent;
		
		cReq = new comRequest();

		url = "/fetchPopup.php/de/popup/" + urlParam;
		dataStr = "";

		cReq.sendAndLoad(url, dataStr, this.onLoadOK, this.onLoadNOK);

	};

	this.onLoadOK = function(responseText) 
	{
		//alert("OnLoadOK" + responseText);
		parent.popupObj.parentElement.innerHTML=responseText;
		//document.write(responseText);
		//initPopups();
	};

	this.onLoadNOK = function(requestObj) 
	{
		alert("OnLoad Error:HTTP-Status:" + requestObj.status + "\n ResponseText:\n" + requestObj.responseText);
	};

};


function loadPopup(parentElelentId,urlParam)
{
	//alert("BodyLoad ... testing Request");
	popupObj= new ajaxPopup();

	poupParentTag=document.getElementById(parentElelentId);
	popupObj.loadPopup(poupParentTag,urlParam);

}

