function EJSP(options) {
	this._ejs = new EJS(options);	
	this._callBackKey = options['callBackKey'];
}

EJSP.prototype._ejs;

EJSP.prototype.update = function(id, url, profile, callback) {
	var ejs = this._ejs;
	var start = new Date().getTime();
	url = url + '&jsonp_callback=?'
	jQuery.getJSON(url, function(data) {
		var end = new Date().getTime();
		var duration = end - start;
		if(profile instanceof Object) {
			profile['duration'] = duration / 1000.0;
		}			
		ejs.update(id, data);			
		if(callback instanceof Function) {
			callback(data);
		}
	});
}

EJSP.prototype.append = function(id, url, profile, callback) {
	var ejs = this._ejs;
	var start = new Date().getTime();
	url = url + '&jsonp_callback=?'
	jQuery.getJSON(url, function(data) {
		var end = new Date().getTime();
		var duration = end - start;
		if(profile instanceof Object) {
			profile['duration'] = duration / 1000.0;
		}
		var html = ejs.render(data);
		jQuery('#' + id).append(html)		
		if(callback instanceof Function) {
			callback(data);
		}
	});
}
