﻿
function AjaxRequest(url,successCallBack, loaderCallBack) {
	new Ajax.Request(url,
	  {
		method:'get',
		onSuccess: successCallBack,
		onFailure: throwFailure,
		onException: throwExp,
		onLoading: loaderCallBack,
		crossSite: true
	  });	
}

function throwExp(req,exception) {
	alert('The request had a fatal exception thrown.\n' + exception + '\n' + exception.description);
	return true;
}

function throwFailure(req){
	alert('Error: ' + req.status + "\n" + req.statusText); 
	return true;
}