
messageObj = new DHTML_modalMessage();	// We only create one object of this class
messageObj.setShadowOffset(5);	// Large shadow


function displayMessage(url) {
	messageObj.setSource(url);
	messageObj.setCssClassMessageBox(false);
	messageObj.setSize(400,200);
	messageObj.setShadowDivVisible(true);	// Enable shadow for these boxes
	messageObj.display();
}

function showInfo( messageText, messageTitle, width, height ) {
	displayStaticMessage('<div id="modalBoxTitle"><span id="modalBoxCaption">' + ( (messageTitle != undefined) ? messageTitle : 'Information' ) + '</span><span id="modalBoxCloserButton" onclick="closeMessage();return false;">X</span></div><div id="modalBoxContent"><p>' + messageText + '</p><input type="button" id="modalBoxContentCloserButton" class="btn" value="Schlie&szlig;en" onclick="closeMessage();return false;"></div>',false, width, height );
	$( 'modalBoxContentCloserButton' ).focus();
}


function displayStaticMessage(messageContent,cssClass, width, height) {
	messageObj.setHtmlContent(messageContent);
    messageObj.setSize( ( ( width != undefined ) ? width : 400 ), ( ( height != undefined ) ? height : 200 ) );
	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();	
}

function displayConfirmDialog( txt, funcOK, funcCancel ) {
	var content = '';
	content += '<table class="dummy" style="width:100%">';
	content += '<tr>';
	content += '<td align="center" height="100" valign="middle">' + txt + '</td>';
	content += '</tr>';
	content += '<tr>';
	content += '<td align="center"><input type="button" class="btn" value="' + label_yes + '" style="width:100px" onclick="closeMessage();' + funcOK + '">';
	content += '<input type="button" class="btn" value="' + label_no + '" style="margin-left:10px;width:100px" onclick="closeMessage();' + funcCancel + '"></td>';
	content += '</tr>';
	content += '</table>';

	displayStaticMessage( content );
}

function displayAdminDialog( txt, headline, funcOK, funcCancel, focusElement, width, height ) {
	var content = '';
	content += '<table class="input" cellspacing style="width:100%">';
	content += '<tr>';
	content += '<th align="center" class="input">' + headline + '</th>';
	content += '</tr>';
	content += '<tr>';
	content += '<td align="center" height="' + ( ( height != undefined ) ? ( height - 71 ) : 130 ) + '" class="input" valign="middle">' + txt + '</td>';
	content += '</tr>';
	content += '<tr>';
	content += '<td align="center" class="input"><input type="button" class="btn" value="' + label_submit + '" style="width:100px" onclick="' + funcOK + '">';
	content += '<input type="button" class="btn" value="' + label_cancel + '" style="margin-left:10px;width:100px" onclick="' + funcCancel + ';closeMessage();"></td>';
	content += '</tr>';
	content += '</table>';

	displayStaticMessage( content, '', width, height );
	if ( focusElement ) {
		$( focusElement ).focus();
	}
}