AJAXResourceLoader = function (_target, _evalFunction){
	this.target = _target;
	this.evalFunction = _evalFunction;
	
	this.evalFunctionBeforeLoad = null;
	this.dataType = null;
	
	this.timeout = 40000;
	this.loadAJAXPage = function(location) {
		if (this.evalFunctionBeforeLoad != null){
			eval(this.evalFunctionBeforeLoad);
		}
		
		$.ajax({
			type: 'GET',
			url: location,
			dataType: this.dataType != null ? this.dataType : 'html',
			timeout: this.timeout,
			context: this,
			success: function(data){this.handlePageLoadSuccess(data)},
			error: this.handlePageLoadFailure
		});
		//waitMessage.show();
	}
	
	this.handlePageLoadSuccess = function(data, url) {
		if (this.target != null){
			$(this.target).html(data);
		}
		try{
			if (this.evalFunction != null){
				eval(this.evalFunction);
			}
			else{
				pageInitialization();
			}
		}
		catch(exception1){}
	}
	
	this.handlePageLoadFailure = function(data){
		
	}
}
