var NetManagerPluginAjax = NetManagerBase.extend({
	
	initialize: function(options) {
		
		// Implement given options
    	this.setOptions(options);
		
		// Cleanup Ajax request
		this.ajaxRequest = Class.empty;		
		
	},

	getAjax: function(url, onComplete, evalscripts) {
		
		var onCompleteAction = onComplete;
		var ajaxFailure = this.ajaxFailure.bind(this);
		var ajaxOptions = {
			method: 		'get',
			evalScripts: 	evalscripts,
			onComplete: 	onCompleteAction, 
			onFailure: 		ajaxFailure
		};
		
		// Fire Ajax request
		this.ajaxRequest = new Ajax(url, ajaxOptions).request();
	},
	
	getAjaxUpdater: function(url, elmId) {
		
		var ajaxFailure = this.ajaxFailure.bind(this);
		var ajaxOptions = {
			method: 		'get',
			evalScripts: 	true,
			onFailure: 		ajaxFailure,
			update: $(elmId)
		};
		
		// Fire Ajax request
		this.ajaxRequest = new Ajax(url, ajaxOptions).request();
	},
	
	postAjax: function(url, onComplete, evalscripts) {
		//console.log(url + onComplete + evalscripts);
		var onCompleteAction = eval('this.' + onComplete + '.bind(this)');
		var ajaxFailure = this.ajaxFailure.bind(this);
		var ajaxOptions = {
			method: 		'post',
			evalScripts: 	evalscripts,
			onComplete: 	onCompleteAction, 
			onFailure: 		ajaxFailure
		};
		
		// Fire Ajax request
		this.ajaxRequest = new Ajax(url, ajaxOptions).request();
	},
	
	postAjaxVoid:  function(url, body) {
		//console.log(url + onComplete + evalscripts);
		var ajaxFailure = this.ajaxFailure.bind(this);
		var ajaxOptions = {
			postBody:       body,
			method: 		'post',
			evalScripts: 	false,
			onFailure: 		ajaxFailure
		};
		
		// Fire Ajax request
		this.ajaxRequest = new Ajax(url, ajaxOptions).request();
	},
	
	ajaxFailure: function() {
		//this.main.setHTML('<p>Er is een probleem ontstaan bij het laden van de pagina. Probeer het nogmaals.</p>');
		alert('Er is een probleem ontstaan bij het laden van de pagina. Probeer het nogmaals.');
	},
	
	sendPostXhr: function(url) {
		var ajaxOptions = {
			method: 		'post'
		};
		
		// Fire Ajax request
		this.ajaxRequest = new Ajax(url, ajaxOptions).request();
	}
	
});
