var waits=0;
function makeWait()
{
	if(waits==0 && navigator.appVersion.indexOf("MSIE 6")==-1)
	{
		var obj = $('waiter');
		obj.style.position='fixed';
		obj.style.top='0';
		obj.style.left='0';
		obj.style.zindex=1000;
		var cw=0;
		var ch=0;
		if(window.innerWidth)
		{
			cw=(window.innerWidth);
			ch=(window.innerHeight);
		} else
		{
			cw=document.documentElement.clientWidth;
			ch=document.documentElement.clientHeight;
		}

		obj.style.width=cw+'px';
		obj.style.height=ch+'px';
		obj.focus();
		new Rico.Effect.setOpacity($('waiter'), .0);
		
		//new Rico.Effect.FadeTo( 'waiter', .2, 5, 1, {complete:function() {}} );
	} 
	waits++;
}

function makeDone()
{
	if(waits==1)
	{
		var obj = $('waiter');
		obj.style.position='fixed';
		obj.style.top='0';
		obj.style.left='0';
		obj.style.zindex=1000;
		obj.style.width='1px';
		obj.style.height='1px';
		new Rico.Effect.setOpacity($('waiter'), .0);
		//new Rico.Effect.FadeTo( 'waiter', .0, 5, 1, {complete:function() {}} );
	}
	waits--;
}
function mySendRequestAndUpdate(a,b,c)
{
	if(c) 
	{
		makeWait();
		if(c.myOnComplete)
		{
			c.onComplete= new function(){makeDone(); c.myOnComplete();}
		} else
		{
			c.onComplete= new function(){makeDone();}
		}
	}
	a2="";
	for(n in c)
	{
		a2+=("Name: "+n+", Typ: "+typeof(n)+"\n");
	}
	
	if(b!=null)
	{
		ajaxEngine.sendRequestAndUpdate(a,b,c);
	}
	else
		ajaxEngine.sendRequest(a,c);

			
 }
