(function (window, undefined) {
	var d = window.document;
	JABB.Ajax.xhrFields = {
		withCredentials: true
	};
	function noteML(options) {
		if (!(this instanceof noteML)) {
			return new noteML(options);
		}
		this.options = {};
		this.main_container = null;
		this.init(options);
		return this;
	}
	
	noteML.prototype = {
		loadNotes: function()
		{
			var self = this;
			JABB.Ajax.sendRequest(self.options.load_notes_url + (self.options.session_id != "" ? "&session_id=" + self.options.session_id : "") , function (req) {
				self.main_container.innerHTML = req.responseText;
			});
		},
		init: function (noteObj) {
			var self = this;
					
			self.options = noteObj;
			self.main_container = d.getElementById(self.options.notes_container);
			
			self.loadNotes();
		}
	}
	return (window.noteML = noteML);
})(window);