function AjaxIsLoading(){

	xajax.$('__AjaxCall_Wait').style.visibility='visible';

	AjaxLoading = 1;
	
	if(AjaxTimer){
		clearTimeout(AjaxTimer);
	}	
}

function AjaxIsLoadingReady(){

	xajax.$('__AjaxCall_Wait').style.visibility='hidden';
	
	if(AjaxTimer){
		clearTimeout(AjaxTimer);
	}
	AjaxTimer=setTimeout(function(){AjaxLoading = 0;}, 1000);

}

PruefeAjaxLoadingIntervall = null;

function PruefeAjaxLoading(ObjektId,Event,Sekunden){
	if(AjaxLoading == 1){
		if(PruefeAjaxLoadingIntervall){}else{
			PruefeAjaxLoadingIntervall=window.setInterval('document.getElementById(\''+ObjektId+'\').'+Event+'()', Sekunden);
		}
	}
	else{
		window.clearInterval(PruefeAjaxLoadingIntervall);
		PruefeAjaxLoadingIntervall = null;
		return 1;
	}
}  

xajax.callback.global.onRequest = AjaxIsLoading;
xajax.callback.global.onComplete = AjaxIsLoadingReady;