ErrorDialog = function (title, message) {
	this.title = 'RockinFares.com';
	this.message = message;
};

ErrorDialog.prototype.buildDiv = function () {
	var div = document.createElement('div');
	div.innerHTML = "<table><tr><td valign='top'><img  src='/img/warning.png' align='left' /></td><td>" + this.message + "</td></tr></table>";
	return div;
};

ErrorDialog.prototype.show = function (callback) {
	jQuery(this.buildDiv()).dialog({
		modal: true,
		autoOpen: true,
		closeOnEscape: false,
		open: function(event, ui) { jQuery(this).parent().children().children('.ui-dialog-titlebar-close').hide();},
		title: this.title, 
		resizable : false,
		draggable : false,
		width: 400,
		buttons: {
			Ok: function() {
				try {
					if (callback) {
						callback();
					}
				} catch (e){}
				
				jQuery(this).dialog('close');
			}
		}	           
	});
};
