User:Cqm/overlay.js

function overlay( $content ) { var $overlay = $( 'div' ) .attr( 'id', 'ovrly' ) .css( {               'background-color': 'rgba(0, 0, 0, 0.7)',                position: 'fixed',                top: '0',                left: '0',                width: '100%',                z-index: '20000002'            } ), $modal = $( ' ' ) .attr( 'id', 'mdl' ) .css( {               margin: 'auto',                border: '1px solid #000',                'background-color': '#fff'            } ), winHeight = $( window ).height;

$modal.append( $content ); $overlay.append( $modal );

$overlay.css( 'height', winHeight ); $modal.css( 'height', ( ( winHeight - $modal.height ) / 2 ) + 'px' );

$( 'body' ).append( $overlay ); }