function _Popup( url, _width, _height, _title, _printable )
{
    var is_html = url.indexOf( '.html' ) != -1;
    var width   = !is_html ? _width + 20 : _width;
    var height  = !is_html ? _height + 20 : _height;
    var options = 'width=' + width + ',height=' + height + ',scrollbars=yes,menubar=' + ( _printable ? 'yes' : 'no' ) + ',statusbar=yes,resizable=yes';
    var title   = typeof( _title ) == 'undefined' ? '' : _title;
    if ( url.indexOf( '.html' ) == -1 ) {
        //
        // This must be an image... display it inside
        //
        var handle  = window.open( '', 'Popup', options );

        handle.document.open( );
        handle.document.open( ); // Old netscape bug
        handle.document.write( '<html><head><title>' + title + '</title></head>' +
                               '<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>' +
                               '<img src="' + url + '"></body></html>' );

        handle.focus( );
    } else {
        var handle  = window.open( url, 'Popup', options );
        handle.focus( );
    }
}

function PopupPrint( url, _width, _height )
{
    _Popup( url, _width, _height, '', true );
}

function Popup( url, _width, _height, _title )
{
    _Popup( url, _width, _height, _title, false );
}
