// HTML transparent overlaid message
OverlayMessage = function ( container )
{
// Get the parent.
var parent = container.parentNode;
// Make the wrapper div.
var wrapper = document.createElement( 'div' );
wrapper.style.cssText = container.style.cssText;
parent.insertBefore( wrapper, container );
// Move the container into the wrapper.
parent.removeChild( container );
wrapper.appendChild( container );
container.style.cssText = 'position: relative; width: 100%; height: 100%;';
// Add the overlay div.
this.overlay = document.createElement( 'div' );
wrapper.appendChild( this.overlay );
this.visibleStyle = 'position: relative; top: -70%; background-color: ' + OverlayMessage.backgroundColor + '; width: 40%; text-align: center; margin-left: auto; margin-right: auto; padding: 2em; border: 1px solid ' + OverlayMessage.borderColor + '; z-index: 100; opacity: .75; filter: alpha(opacity=75); ';
this.invisibleStyle = 'display: none;';
this.overlay.style.cssText = this.invisibleStyle;
};
OverlayMessage.backgroundColor = '#eaeff4';
OverlayMessage.borderColor = '#333333';
OverlayMessage.prototype.Set = function ( message )
{
this.overlay.innerHTML = message;
this.overlay.style.cssText = this.visibleStyle;
};
OverlayMessage.prototype.Clear = function ()
{
this.overlay.style.cssText = this.invisibleStyle;
};
OverlayMessage.SetBackgroundColor = function ( color )
{
OverlayMessage.backgroundColor = color;
};
OverlayMessage.SetBorderColor = function ( color )
{
OverlayMessage.borderColor = color;
};