(function($) {	
	var lastCall;
	var callInProgress = false;	
	
	$.diamondAjax = function(settings) {	
		var m_old = settings.complete;					
		settings.complete = function(){					
			if ( m_old )
				m_old.apply( this, arguments );
			if (lastCall)
			{
				 $.ajax(lastCall);
				 lastCall = null;
			}   
			else
				callInProgress=false;

		};

		if(callInProgress)
			lastCall = settings;
		else
		{
			callInProgress=true;
			$.ajax(settings);
		}
		return undefined;
	};			
	
})(jQuery);