
/**
* Communicator Singleton
* created by Ingo Taraske (zoo2002.de)
*
* for Ajax Communication
**/

// net namespace
var net = new Object();

// singleton access
net.getCommunicator = function(){
	if (!top.communicator){
		top.communicator = new net.Communicator();
	}
	return top.communicator;
}

// Communicator constructor
net.Communicator = function(){
	
}

// new ajax request
net.Communicator.prototype.request = function(request){	
	new net.Request(request);
}


// request is started, request as json object
net.Request = function(request){
	
	
	
	var ajaxRequest = new Ajax.Request(
			request.url, 
			{
				method: 'get', 
				parameters: request.pars, 
				onComplete: request.onComplete,
				onFailure: request.onFailure
			});
	
}
