/************************************************************************************************************
	@fileoverview
	This file initializes the modal message-box based on the design and implementation of 
	"DHTML Suite for Applications" (http://www.dhtmlgoodies.com).
	
	Locally, only displayStaticMessage seems to be working, although reading from a file would be ideal..
	The function displayMessage uses AJAX to request the html file asynchronously (is this why it doesn't work 
	on local machine?..)

************************************************************************************************************/

var messageObj;

function initModalMessagebox() {

	if (messageObj == null) {
		messageObj = new DHTML_modalMessage();	// We only create one object of this class
		messageObj.setShadowOffset(5);	// Large shadow
	}
}

function displayModalMessageFromUrl(url, width, height) {
	initModalMessagebox();

	messageObj.setSource(url);
	messageObj.setCssClassMessageBox(false);
	messageObj.setSize(width, height);
	messageObj.setShadowDivVisible(true);	// Enable shadow for these boxes
	messageObj.display();
}

function displayModalMessage(messageContent, width, height) {
	displayStaticMessage(messageContent, false, width, height)
}

function displayStaticMessage(messageContent, cssClass, width, height) {
	initModalMessagebox();

	messageObj.setHtmlContent(messageContent);
	messageObj.setSize(width, height);
	messageObj.setCssClassMessageBox(cssClass);
	messageObj.setSource(false);	// no html source since we want to use a static message here.
	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObj.display();	
}

function closeMessage() {
	messageObj.close();	
}
