
function DocumentViewerShow ( caption, element, page, closedCallback ) 
{
    console.log ( "closedCallback : " + closedCallback );
    if ( caption != undefined )
      $('#IdcDocumentViewerCaption').text ( caption );

    if ( closedCallback != undefined )
      document.getElementById ('IdcDocumentViewer').addEventListener ( 'hide.bs.modal', () => { closedCallback(); } );

    // $('#IdcDocumentViewerContent').width(1200);
    // $('#IdcDocumentViewerContent').css('left', -200);

    if ( page != null )
    {
        $('#IdcDocumentViewerDiv').hide ();
        $('#IdcDocumentViewerFrame').show ();

        document.getElementById ( 'IdcDocumentViewerFrame' ).src = page;
    }
    else
      if ( element != null )
      {
          $('#IdcDocumentViewerFrame').hide ();
          $('#IdcDocumentViewerDiv').show ();

          $('#IdcDocumentViewerDiv').append(element);
      }
        
        

    $('#IdcDocumentViewer').modal('show');

  
    if ( !$(".modal.in").length ) 
    {
      $(".modal-dialog").css ( {
          top: 20,
          left: 100,
      });
    }

    $(".modal-dialog").draggable ( {
        cursor: "move",
        handle: ".dragable_touch",
    });


    $('#IdcDocumentViewer').css ( { top: 20,
      left: 20,});

    

}