function AjaxObj() {
	pAjax.call(this);
	pAjax.setDebugMode(false);
}

var _p = AjaxObj.prototype = new pAjax;

_p.doRequest = function (params, div_id) {
	this.div_id = div_id;
	var oRequest = this.prepare("load_module", pAjaxRequest.POST);

	oRequest.setParam("params", 'mod='+document.getElementById('urlmod').value+"&"+params);

	oRequest.setURI("/_/ajax/index.html");
	oRequest.execute(pAjaxRequest.ASYNC);

	ajaxLoadingSignal(true);
}

_p.onLoad = function () {
	var data = this.getResponse();

	document.getElementById(this.div_id).innerHTML = data;

	ajaxLoadingSignal(false);
}


var ajaxTimer;
var ajaxLoadingDiv = null;

function ajaxLoadingSignal(visible, busyDivId) {
	if (busyDivId) 
		ajaxLoadingDiv = document.getElementById(busyDivId);
	else
		ajaxLoadingDiv = document.getElementById("defBusyDiv");
	if(!ajaxLoadingDiv) return;
	if (typeof(visible) == 'undefined') visible = true;
	if (visible) {
		ajaxLoadingDiv.style.top = document.body.parentNode.scrollTop + "px";
		ajaxLoadingDiv.style.display = "block";
		ajaxTimer = window.setInterval(ajaxLoadingTimer, 200);
	} else {
		ajaxLoadingDiv.style.display = "none";
		if (ajaxTimer) window.clearInterval(ajaxTimer);
	}
}

function ajaxLoadingTimer() {
	if (!ajaxLoadingDiv) return;
	if (ajaxLoadingDiv.style.backgroundColor ==  'maroon')
		ajaxLoadingDiv.style.borderColor = ajaxLoadingDiv.style.backgroundColor = 'darkred'
	else
		ajaxLoadingDiv.style.borderColor = ajaxLoadingDiv.style.backgroundColor = 'maroon';
}

