
OverlayMessage = function ( container )
    {
    // Terminology:
    // +-----------------+
    // |wrapper          |
    // |+---------------+|
    // ||container      ||
    // ||   +-------+   ||
    // ||   |overlay|   ||
    // ||   +-------+   ||
    // ||               ||
    // |+---------------+|
    // +-----------------+

    // 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.backgroundColor = '#FFFFFF';
    this.borderColor = '';

    this.overlay.style.position = 'relative';
    this.overlay.style.top = '-55%';
    this.overlay.style.backgroundColor = this.backgroundColor;
    this.overlay.style.width = '40%';
    this.overlay.style.textAlign = 'center';
    this.overlay.style.marginLeft = 'auto';
    this.overlay.style.marginRight = 'auto';
    this.overlay.style.padding = '2em';
    this.overlay.style.borderWidth = '0.08in';
    this.overlay.style.borderStyle = 'none';
    this.overlay.style.borderColor = this.borderColor;
    this.overlay.style.zIndex = '100';
    this.overlay.style.opacity = '.75';
    this.overlay.style.filter = 'alpha(opacity=75)';

    this.overlay.style.display = 'none';
    };




OverlayMessage.prototype.Set = function ( message )
    {
    this.overlay.innerHTML = message;

    this.overlay.style.display = '';
    };


OverlayMessage.prototype.Clear = function ()
    {
    this.overlay.style.display = 'none';
    };


OverlayMessage.prototype.SetBackgroundColor = function ( color )
    {
    this.backgroundColor = this.overlay.style.backgroundColor = color;
    };


OverlayMessage.prototype.SetBorderColor = function ( color )
    {
    this.borderColor = this.overlay.style.borderColor = color;
    };
