/* ===== START Class: modalDialog ===== */
function modalDialog (elem) {
	this.mdnode 		= elem;
	var mdself 		= this;
	
	this.setTitle = function (t) {
		$('modalHeaderLabel').innerHTML = t;
	}
	
	this.resetContent = function () {
		$('modalDialog').innerHTML = '';
	}
	
	this.setContentInnerHTML = function (c) {
		this.resetContent();
		$('modalDialog').innerHTML = c;
	}
	
	this.setContentNode = function (n) {
		this.resetContent();
		$('modalDialog').appendChild(n);
	}
	
	this.show = function () {
		mdself.mdnode.style.display = 'block';
		document.getElementById('modalPanelBG').style.display = 'block';
	}
	
	this.hide = function () {
		mdself.mdnode.style.display = 'none';
		document.getElementById('modalPanelBG').style.display = 'none';
	}
}
/* ===== END Class: modalDialog ======= */

function initialiseModalDialog () {
	modalDialog = new modalDialog($('modalPanel'));
	$('modalCloseButton').onclick = modalDialog.hide;
}

addOnLoad(initialiseModalDialog);
