function Service() 
{
	//-Configuration-----------------------------------------------------------------------------------------------------------

	
	
	/**
	 * @cfg {String} url
	 */
	url: "";
	
	/**
	 * @cfg {Function} resultCallback
	 */
	resultCallback: null;
	
	/**
	 * @cfg {Function} faultCallback
	 */
	faultCallback: null;
	
	/**
	 * @cfg {Function} completeCallback
	 */
	completeCallback: null;
	
	/**
	 * @cfg {String} format
	 */
	format: "text";
	
	/**
	 * @cfg {String} method
	 */
	method: "GET";
	
	/**
	 * @cfg {String} contentType
	 */
	contentType: "application/x-www-form-urlencoded";
	

	
	
	//-Properties--------------------------------------------------------------------------------------------------------------
	
	//-Con/Destructor----------------------------------------------------------------------------------------------------------
	

	
	//-Private Methods---------------------------------------------------------------------------------------------------------
	

	
	//-Event Handler-----------------------------------------------------------------------------------------------------------
	//-Public------------------------------------------------------------------------------------------------------------------
	
	
	/**
	 * Sends the request
	 *
	 * @method
	 */
	Service.prototype.send = function()
	{
		
		
		//Send the request
		var self = this;
		$.ajax(
		{
			url: this.url,
			type: this.method,
			processData: true,
			cache: true,
			dataType: this.format,
			contentType: this.contentType,
			beforeSend: function(xhr)
			{
				if (self.format === "json") 
				{
					xhr.setRequestHeader("Accept", "application/json");
				}
				
			},
			success: function(data)
			{
				
				if (self.resultCallback != null) 
				{
					self.resultCallback(data);
				}
			},
			error: function(request, errorType)
			{
				self.success = false;
				if (self.faultCallback != null) 
				{
					self.faultCallback(request, errorType);
				}
			},
			complete: function(request)
			{
				self.success = true;
				if (self.completeCallback != null) 
				{
					self.completeCallback(request);
				}
			}
		});
	}
}


