/*
Point = function (x, y) {
	this.x = x;
	this.y = y;
}
Point.prototype.x = 0;
Point.prototype.y = 0;
*/

/*--------------------------------------------------------------------------*/
Dialog = function () {
	this._wall;
	this._dialogWindow;
	this._windowTitle;
	this._form;
	this._onResize;
}

Dialog.INFO = 1;
Dialog.ERROR = 2;
Dialog.WARN = 3;
Dialog.ERROR_ICON_URL = '/image/error.gif';
Dialog.INFO_ICON_URL = '/image/info.gif';
Dialog.WARN_ICON_URL = '/image/warn.gif';
Dialog.OK_CAPTION = 'OK';
Dialog.CANCEL_CAPTION = 'キャンセル';
Dialog.YES_CAPTION = 'はい';
Dialog.NO_CAPTION = 'いいえ';

Dialog.zIndex = 1000;

Dialog.prototype.init = function() {
	var wall;

	if (window.ActiveXObject) {
		wall = document.createElement('IFRAME');
		wall.border = '0';
		wall.frameborder = '0';
		wall.hspace = 0;
		wall.vspace = 0;
		wall.marginheight = 0;
		wall.marginwidth = 0;
		wall.id = 'wall_iframe';
	} else {
		wall = document.createElement('DIV');
		wall.style.backgroundColor = '#666666';
		wall.id = 'wall_div';
	}
	wall.style.position = 'absolute';
	wall.style.top = 0;
	wall.style.left = 0;
	wall.style.width = document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth; //"100%";
	wall.style.height = document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight; //"100%";

	Dialog.zIndex++;
	wall.style.zIndex = Dialog.zIndex;
	wall.style.filter = "alpha(style=0, opacity=40)";
	wall.style.opacity = 0.40;
	wall.style.visibility = 'hidden';
	wall.setAttribute('UNSELECTABLE', 'ON');
	wall.setAttribute('TABINDEX', '-1');
	wall.className = 'dialogs_wall';
	document.body.appendChild(wall);
	this._wall = wall;

	var df = document.createElement('DIV');
	df.id = 'dialogs_dialogFrame';
	df.className = 'dialogs_dialogFrame';
	df.style.backgroundColor = '#ffffff';
	df.style.position = 'absolute';
	df.style.width = "350";

	Dialog.zIndex++;
	df.style.zIndex = Dialog.zIndex;
	df.style.visibility = 'hidden';

	df.style.borderStyle = "solid";
	df.style.borderWidth = "1px";
	df.style.borderColor = "#999999";

	df.setAttribute('UNSELECTABLE', 'ON');
	df._owner = this;

	df.onkeydown = this._onKeyDown;
/*
	df.onkeydown = function(event) {
		var e = event || window.event;
		if (e.keyCode == 27) {
			this._owner.close();
		} else if (e.keyCode == 9) {
			var c = e.srcElement ? e.srcElement : e.target;
			var shift = e.shiftKey ? e.shiftKey : ((e.modifiers & 4) > 0);
			if (c == null) {
				return;
			}
			var f = this._owner._form;
			if (f == null) {
				return;
			}

			if (shift) {
				this._owner._setPrevFocusElement(f, c);
			} else {
				this._owner._setNextFocusElement(f, c);
			}

			e.returnValue = false;
			e.cancelBubble = true;
			return false;
		}
	}
*/

	document.body.appendChild(df);
	this._dialogWindow = df;

	var dialogPane = this._createDialogArea(document, df);
//	df.appendChild(dialogPane);

/*
	this._onResize = function(event) {
		wall.style.width = document.body.clientWidth; //"100%";
		wall.style.height = document.body.clientHeight; //"100%";
		df.style.left = Math.abs(document.body.clientWidth - df.clientWidth) / 2 + document.body.scrollLeft;
		df.style.top = Math.abs(document.body.clientHeight - df.clientHeight) / 2 + document.body.scrollTop;
	}
*/
	if (window.ActiveXObject) {
		window.attachEvent('onresize', this._onResize);
	} else {
		window.addEventListener('resize', this._onResize, false);
	}
}
Dialog.prototype._onKeyDown = function(event) {
	var e = event || window.event;
	if (e.keyCode == 27) {
		this._owner.close();
	} else if (e.keyCode == 9) {
		var c = e.srcElement ? e.srcElement : e.target;
		var shift = e.shiftKey ? e.shiftKey : ((e.modifiers & 4) > 0);
		if (c == null) {
			return;
		}
		var f = this._owner._form;
		if (f == null) {
			return;
		}

		if (shift) {
			this._owner._setPrevFocusElement(f, c);
		} else {
			this._owner._setNextFocusElement(f, c);
		}

		e.returnValue = false;
		e.cancelBubble = true;
		return false;
	}
}
Dialog.prototype._onResize = function() {
	var wall = this._wall;
	var df = this._dialogWindow;
	if (wall) {
		wall.style.width = document.body.clientWidth; //"100%";
		wall.style.height = document.body.clientHeight; //"100%";
	}
	if (df) {
		df.style.left = Math.abs(document.body.clientWidth - df.clientWidth) / 2 + document.body.scrollLeft;
		df.style.top = Math.abs(document.body.clientHeight - df.clientHeight) / 2 + document.body.scrollTop;
	}
}
Dialog.prototype.setClientWidth = function(width) {
	if (this._dialogWindow != null) {
		this._dialogWindow.style.width = parseInt(width) + 32;
	}
}
Dialog.prototype._setNextFocusElement = function(f, element) {
	var index = -1;
	for (var i = 0, n = f.elements.length - 1; i <= n; i++) {
		if (f.elements[i] == element) {
			index = i;
			break;
		}
	}
	if (index < 0) {
		return;
	}
	for (var i = index + 1, n = f.elements.length - 1; i <= n; i++) {
		var e = f.elements[i];
		if (this._canSetFocus(e)) {
			e.focus();
			return;
		}
	}
	for (var i = 0, n = index - 1; i <= n; i++) {
		var e = f.elements[i];
		if (this._canSetFocus(e)) {
			e.focus();
			return;
		}
	}
}
Dialog.prototype._setPrevFocusElement = function(f, element) {
	var index = -1;
	for (var i = 0, n = f.elements.length - 1; i <= n; i++) {
		if (f.elements[i] == element) {
			index = i;
			break;
		}
	}
	if (index < 0) {
		return;
	}
	for (var i = index - 1; i >= 0; i--) {
		var e = f.elements[i];
		if (this._canSetFocus(e)) {
			e.focus();
			return;
		}
	}
	for (var i = f.elements.length - 1, n = index + 1; i >= n; i--) {
		var e = f.elements[i];
		if (this._canSetFocus(e)) {
			e.focus();
			return;
		}
	}
}
Dialog.prototype._canSetFocus = function(element) {
	if (element == null) {
		return false;
	}
	if (element.type) {
		if (element.type == 'hidden') {
			return false;
		}
	}
	if (element.style) {
		if (element.style.visibility == 'hidden') {
			return false;
		}
		if (element.style.display == 'none') {
			return false;
		}
	}
	if (element.parentNode != null) {
		if (!this._canSetFocus(element.parentNode)) {
			return false;
		}
	}
	return true;
}
Dialog.prototype._false = function() {
	return false;
}
Dialog.prototype._createDialogArea = function(doc, parent) {
	var dialogPane = doc.createElement('DIV');
	dialogPane.id = 'dialogs_dialogPane';
	dialogPane.className = 'dialogs_dialogPane';
	dialogPane.style.borderRightStyle = 'solid';
	dialogPane.style.borderRightWidth = '1px';
	dialogPane.style.borderBottomStyle = 'solid';
	dialogPane.style.borderBottomWidth = '1px';
	dialogPane.style.borderTopStyle = 'solid';
	dialogPane.style.borderTopWidth = '1px';
	dialogPane.style.borderTopColor = '#eeeeee';
	dialogPane.style.borderLeftStyle = 'solid';
	dialogPane.style.borderLeftWidth = '1px';
	dialogPane.style.borderLeftColor = '#eeeeee';
	parent.appendChild(dialogPane);

	var f = doc.createElement('FORM');
	f.id = 'dialogs_dialogPane_form';
/*
	f.onsubmit = function() {
		return false;
	}
*/
	f.onsubmit = this._false;
	f.style.margin = '0 0 0 0';
	dialogPane.appendChild(f);
	this._form = f;

	var table = doc.createElement('TABLE');
	table.id = 'dialogs_dialogPane_table';
	table.className = 'dialogs_dialogPane_table';
	table.style.width = '100%';
	table.style.height = '100%';
	table.border = '0';
	f.appendChild(table);

	var thead = doc.createElement('THEAD');
	table.appendChild(thead);

	var tr0 = doc.createElement('TR');
	thead.appendChild(tr0);

	var td0 = doc.createElement('TH');
//	td0.align = 'left';
/*
	td0.style.borderBottomStyle = 'solid';
	td0.style.borderBottomWidth = '1px';
	td0.style.borderBottomColor = '#000000';
*/
//	td0.style.padding = '3 3 3 3';
//	td0.style.backgroundColor = '#3D77CB';
//	td0.style.color = '#ffffff';
//	td0.style.fontWeight = 'normal';
	td0.setAttribute('UNSELECTABLE', 'ON');
	td0.className = 'dialogs_dialogPane_table';

	var windowTitle = doc.createElement('SPAN');
	windowTitle.id = 'dialogs_windowTitle';
	windowTitle.innerHTML = 'Message';
	windowTitle.setAttribute('UNSELECTABLE', 'ON');
	this._windowTitle = windowTitle;
	td0.appendChild(windowTitle);

	tr0.appendChild(td0);

	var tbody = doc.createElement('TBODY');
	table.appendChild(tbody);

	var tr1 = doc.createElement('TR');
	tbody.appendChild(tr1);

	var td1 = doc.createElement('TD');
	td1.style.padding = '10px 10px 10px 10px';
	td1.style.height = '20px';
	td1.setAttribute('UNSELECTABLE', 'ON');

	this._createClientArea(doc, td1);
	tr1.appendChild(td1);

	var tr3 = doc.createElement('TR');
	tbody.appendChild(tr3);

	var td3 = doc.createElement('TD');
	td3.style.height = '25px';
	td3.style.padding = '15px 15px 15px 15px';
	td3.align = 'center';
	td3.setAttribute('UNSELECTABLE', 'ON');

	this._createButtonArea(doc, td3);
	tr3.appendChild(td3);

//	return dialogPane;
}
//Dialog.prototype.getSize = function() {
//	return new Point(300, 100);
//}
Dialog.prototype._createClientArea = function(doc, parent) {
}
Dialog.prototype._createButtonArea = function(doc, parent) {
}
Dialog.prototype.setFocus = function() {
}
Dialog.prototype.open = function() {
	if (this._wall) {
		this._wall.style.visibility = 'visible';
	}

//	alert(window.width);
//	alert(document.body.offsetWidth);
//	alert(document.documentElement.offsetWidth);
//	alert(document.body.scrolWidth);
//	alert(document.body.clientWidth);
//	alert(screen.availWidth);
	
	var dialogWindow = this._dialogWindow;
//	dialogWindow.style.left = Math.abs(screen.width - dialogWindow.clientWidth) / 2 + document.body.scrollLeft;
//	dialogWindow.style.top = Math.abs(screen.height - dialogWindow.clientHeight) / 2 + document.body.scrollTop;
//	dialogWindow.style.left = Math.abs(document.body.clientWidth - dialogWindow.clientWidth) / 2 + document.body.scrollLeft;
//	dialogWindow.style.top = Math.abs(document.body.clientHeight - dialogWindow.clientHeight) / 2 + document.body.scrollTop;
//	dialogWindow.style.left = Math.abs(document.body.offsetWidth - dialogWindow.offsetWidth) / 2 + document.body.scrollLeft;
//	dialogWindow.style.top = Math.abs(document.body.offsetHeight - dialogWindow.offsetHeight) / 2 + document.body.scrollTop;
//	dialogWindow.style.left = 200 + document.body.scrollLeft;
//	dialogWindow.style.top = 200 + document.body.scrollTop;

	dialogWindow.style.left = Math.abs(document.documentElement.clientWidth - dialogWindow.offsetWidth) / 2 + document.body.scrollLeft;
	dialogWindow.style.top = Math.abs(document.documentElement.clientHeight - dialogWindow.offsetHeight) / 2 + document.body.scrollTop;

	dialogWindow.style.visibility = 'visible';

	this.setFocus();
}
Dialog.prototype.close = function() {
	this._doClose();
}
Dialog.prototype._doClose = function() {
	if (this._windowTitle) {
		this._windowTitle = null;
	}
	if (this._form) {
		this._form.onsubmit = null;
		this._form = null;
	}
	if (this._wall) {
		document.body.removeChild(this._wall);
		this._wall = null;
		Dialog.zIndex--;
	}
	if (this._dialogWindow) {
		document.body.removeChild(this._dialogWindow);
		this._dialogWindow = null;
		Dialog.zIndex--;
	}
	if (this._onResize) {
		if (window.ActiveXObject) {
			window.detachEvent('onresize', this._onResize);
		} else {
			window.removeEventListener('resize', this._onResize, false);
		}
//		this._onResize = null;
	}
}
Dialog.prototype._createButton = function(doc, submit, caption, width) {
	var button = doc.createElement('INPUT');
	if (submit) {
		button.type = 'submit';
	} else {
		button.type = 'button';
	}
	button.value = caption;
	button.style.width = width;
	button.style.marginLeft = 5;
	button.style.marginRight = 5;
	button._owner = this;
	return button;
}
Dialog.prototype.setWindowTitle = function(text) {
	if (this._windowTitle == null) {
		return;
	}
	if (text == null) {
		return;
	}
	this._windowTitle.innerHTML = text;
}

/*--------------------------------------------------------------------------*/
MessageDialog = function(type) {
	this._type = type;

	this._okButton;
	this._message;
	this.init();
}
MessageDialog.prototype = new Dialog();
MessageDialog.prototype._createClientArea = function(doc, parent) {
	var table = doc.createElement('TABLE');
	parent.appendChild(table);

	var tbody = doc.createElement('TBODY');
	table.appendChild(tbody);

	var tr = doc.createElement('TR');

	if (this._type) {
		var td = doc.createElement('TD');
		td.style.paddingRight = 10;
		var img = doc.createElement('IMG');
		if (this._type == Dialog.ERROR) {
			img.src = Dialog.ERROR_ICON_URL;
		} else if (this._type == Dialog.INFO) {
			img.src = Dialog.INFO_ICON_URL;
		}
		td.appendChild(img);
		tr.appendChild(td);
	}

	var td = doc.createElement('TD');
	var message = doc.createElement('SPAN');
	message.innerHTML = 'message';
	message.setAttribute('UNSELECTABLE', 'ON');
	td.appendChild(message);
	tr.appendChild(td);
	this._message = message;

	tbody.appendChild(tr);

}
MessageDialog.prototype._createButtonArea = function(doc, parent) {
	var okButton = this._createButton(doc, true, Dialog.OK_CAPTION, '80px');
	okButton.id = 'MessageDialog_okButton';
	parent.appendChild(okButton);
	okButton.onclick = this._onOkClick;
	this._okButton = okButton;
}
MessageDialog.prototype._onOkClick = function() {
	this._owner.okPressed();
}
MessageDialog.prototype.okPressed = function() {
	this.close();
}
MessageDialog.prototype.setFocus = function() {
	this._okButton.focus();
}
MessageDialog.prototype.setMessage = function(message) {
	this._message.innerHTML = message;
}
MessageDialog.prototype.close = function() {
	this._okButton = null;
	this._message = null;
	this._doClose();
}

/*--------------------------------------------------------------------------*/
ConfirmDialog = function(type) {
	this._type = type;

	this._yesButton;
	this._noButton;
	this._message;
	this.init();
}
ConfirmDialog.prototype = new Dialog();
ConfirmDialog.prototype._createClientArea = function(doc, parent) {
	var table = doc.createElement('TABLE');
	parent.appendChild(table);

	var tbody = doc.createElement('TBODY');
	table.appendChild(tbody);

	var tr = doc.createElement('TR');

	if (this._type) {
		var td = doc.createElement('TD');
		td.style.paddingRight = 10;
		var img = doc.createElement('IMG');
		if (this._type == Dialog.ERROR) {
			img.src = Dialog.ERROR_ICON_URL;
		} else if (this._type == Dialog.INFO) {
			img.src = Dialog.INFO_ICON_URL;
		}
		td.appendChild(img);
		tr.appendChild(td);
	}

	var td = doc.createElement('TD');
	var message = doc.createElement('SPAN');
	message.innerHTML = 'message';
	message.setAttribute('UNSELECTABLE', 'ON');
	td.appendChild(message);
	tr.appendChild(td);
	this._message = message;

	tbody.appendChild(tr);

}
ConfirmDialog.prototype._createButtonArea = function(doc, parent) {
	var yesButton = this._createButton(doc, true, Dialog.YES_CAPTION, '80px');
	yesButton.id = 'ConfirmDialog_yesButton';
	parent.appendChild(yesButton);
	yesButton.onclick = this._onYesClick;
	this._yesButton = yesButton;

	var noButton = this._createButton(doc, true, Dialog.NO_CAPTION, '80px');
	noButton.id = 'ConfirmDialog_noButton';
	parent.appendChild(noButton);
	noButton.onclick = this._onNoClick;
	this._noButton = noButton;
}
ConfirmDialog.prototype._onYesClick = function() {
	this._owner.close();
	this._owner.yesPressed();
}
ConfirmDialog.prototype.yesPressed = function() {
//	this.close();
}
ConfirmDialog.prototype._onNoClick = function() {
	this._owner.close();
	this._owner.noPressed();
}
ConfirmDialog.prototype.noPressed = function() {
//	this.close();
}
ConfirmDialog.prototype.setFocus = function() {
	this._yesButton.focus();
}
ConfirmDialog.prototype.setMessage = function(message) {
	this._message.innerHTML = message;
}
ConfirmDialog.prototype.close = function() {
	this._yesButton = null;
	this._noButton = null;
	this._message = null;
	this._doClose();
}

/*--------------------------------------------------------------------------*/
InputDialog = function () {
	this._message;
	this._text;
	this.init();
}
InputDialog.prototype = new Dialog();
InputDialog.prototype._createClientArea = function(doc, parent) {
	var message = doc.createElement('SPAN');
	message.setAttribute('UNSELECTABLE', 'ON');
	parent.appendChild(message);
	this._message = message;

	var text = doc.createElement('INPUT');
	text.type = 'text';
	text.style.width = '100%';
	parent.appendChild(text);
	this._text = text;
}
InputDialog.prototype._createButtonArea = function(doc, parent) {
	var okButton = this._createButton(doc, true, Dialog.OK_CAPTION, '80px');
	okButton.id = 'InputDialog_okButton';
	parent.appendChild(okButton);
	okButton.onclick = this._onOkClick;

	var cancelButton = this._createButton(doc, false, Dialog.CANCEL_CAPTION, '80px');
	cancelButton.id = 'InputDialog_cancelButton';
	parent.appendChild(cancelButton);
	cancelButton.onclick = this._onCancelClick;
}
InputDialog.prototype._onOkClick = function() {
	this._owner.okPressed();
}
InputDialog.prototype.okPressed = function() {
	this.close();
}
InputDialog.prototype._onCancelClick = function() {
	this._owner.cancelPressed();
}
InputDialog.prototype.cancelPressed = function() {
	this.close();
}
InputDialog.prototype.setFocus = function() {
	this._text.focus();
}
InputDialog.prototype.setText = function(text) {
	this._text.value = text;
}
InputDialog.prototype.setMessage = function(message) {
	this._message.innerHTML = message;
}
InputDialog.prototype.close = function() {
	this._text = null;
	this._message = null;
	this._doClose();
}

/*--------------------------------------------------------------------------*/
ContainerDialog = function(element) {
	this._element = element;
	this._elementParent;
	this.init();
}
ContainerDialog.prototype = new Dialog();
ContainerDialog.prototype._createClientArea = function(doc, parent) {
//	var element = this._element.cloneNode(true);
	if (this._element != null) {
		var element = this._element;
		element.style.display = 'block';
		this._elementParent = element.parentNode;
		this.setClientWidth(element.style.width);
		parent.appendChild(element);
//		parent.style.width = element.style.width;
	}
}
ContainerDialog.prototype._createButtonArea = function(doc, parent) {
	var okButton = this._createButton(doc, true, 'OK', '80px');
	okButton.id = 'ContainerDialog_okButton';
	parent.appendChild(okButton);
	okButton.onclick = this._onOkClick;
/*
	okButton.onclick = function() {
		this._owner.okPressed();
	};
*/
	var cancelButton = this._createButton(doc, false, Dialog.CANCEL_CAPTION, '80px');
	cancelButton.id = 'ContainerDialog_cancelButton';
	parent.appendChild(cancelButton);
	cancelButton.onclick = this._onCancelClick;
/*
	cancelButton.onclick = function() {
		this._owner.cancelPressed();
	};
*/
}
ContainerDialog.prototype._onOkClick = function() {
	this._owner.okPressed(this._owner);
}
ContainerDialog.prototype.okPressed = function() {
	this.close();
}
ContainerDialog.prototype._onCancelClick = function() {
	this._owner.cancelPressed();
}
ContainerDialog.prototype.cancelPressed = function() {
	this.close();
}
ContainerDialog.prototype.setFocus = function() {
	if (this._form != null) {
//		this._form.elements[0].focus();
		this._setNextFocusElement(this._form, this._form.elements[0]);
	}
}
ContainerDialog.prototype.close = function() {
	var e = this._element;
	if (e != null) {
		this._elementParent.appendChild(e);
		e.style.display = 'none';
	}

	this._doClose();
	this._element = null;
	this._elementParent = null;
}

/*--------------------------------------------------------------------------*/
/*
ProgressMonitor = function() {
	this._canceled;
}
ProgressMonitor.prototype.setCanceled = function(canceled) {
	this._canceled = canceled;
}
ProgressMonitor.prototype.isCanceled = function() {
	return this._canceled;
}
ProgressMonitor.prototype.setTaskName = function(name) {
}
*/

/*--------------------------------------------------------------------------*/
ProgressMonitorDialog = function() {
	this._cancelButton;
	this._message;
	this.init();
}
ProgressMonitorDialog.prototype = new Dialog();
ProgressMonitorDialog.prototype._createClientArea = function(doc, parent) {
	var message = doc.createElement('SPAN');
	message.id = 'ProgressMonitorDialog_message';
//	message.innerHTML = '';
	message.setAttribute('UNSELECTABLE', 'ON');
	parent.appendChild(message);
	this._message = message;
}
ProgressMonitorDialog.prototype._createButtonArea = function(doc, parent) {
	var cancelButton = this._createButton(doc, true, Dialog.CANCEL_CAPTION, '80px');
	cancelButton.id = 'ProgressMonitorDialog_cancelButton';
	parent.appendChild(cancelButton);

	cancelButton.onclick = this._onCancelClick;
//	cancelButton.onclick = cancelButton._owner.cancelPressed;
/* この方法だとメモリリークが発生する。
	cancelButton.onclick = function() {
		this._owner.cancelPressed();
	};
*/
	this._cancelButton = cancelButton;
}
ProgressMonitorDialog.prototype._onCancelClick = function() {
	this._owner.cancelPressed();
}
ProgressMonitorDialog.prototype.cancelPressed = function() {
	this.close();
}
ProgressMonitorDialog.prototype.setFocus = function() {
	this._cancelButton.focus();
}
ProgressMonitorDialog.prototype.setMessage = function(message) {
	this._message.innerHTML = message;
}
ProgressMonitorDialog.prototype.close = function() {
	this._cancelButton = null;
	this._message = null;
	this._doClose();
}

/*--------------------------------------------------------------------------*/
function DialogUtils() {
}

DialogUtils.showInputDialog = function(message, text, title) {
	var d = new InputDialog();
	d.setMessage(message);
	d.setText(text);
	if (title != null) {
		d.setWindowTitle(title);
	}
	d.open();
}

DialogUtils.showConfirmDialog = function(message, title, callback) {
	var d = new ConfirmDialog(Dialog.INFO);
	d.setMessage(message);
	if (title != null) {
		d.setWindowTitle(title);
	}
	if (callback) {
		d.yesPressed = callback;
	}
/*
	d.yesPressed = function() {
		this.close();
	}
*/
	d.open();
}

DialogUtils.showMessageDialog = function(message, title) {
	var d = new MessageDialog(Dialog.INFO);
	d.setMessage(message);
	if (title != null) {
		d.setWindowTitle(title);
	}
	d.okPressed = function() {
		this.close();
	}
	d.open();
}

DialogUtils.showErrorDialog = function(message, title) {
	var d = new MessageDialog(MessageDialog.ERROR);
	d.setMessage(message);
	if (title != null) {
		d.setWindowTitle(title);
	} else {
		d.setWindowTitle('エラー');
	}
	d.okPressed = function() {
		this.close();
	}
	d.open();
}

DialogUtils.showProgressDialog = function(message, title) {
	var d = new ProgressMonitorDialog();
	d.setMessage(message);
	if (title != null) {
		d.setWindowTitle(title);
	}
	d.open();
}


DialogUtils.showContainerDialog = function(element, title, callback) {
	var d = new ContainerDialog(element);
	if (title != null) {
		d.setWindowTitle(title);
	}
	if (callback) {
		d.okPressed = callback;
	}
	d.open();
}

