function showViewer( id, width, height, type, alttext, resPath ) {
  if( document.getElementById ) {
    if( imageRefObj.id != "-1" ) {
      showPicture( imageRefObj.id, imageRefObj.width, imageRefObj.height,
		   imageRefObj.type, imageRefObj.alttext, imageRefObj.resPath );
    }
    imageRefObj = new ImageRef( id, type, width, height, alttext, resPath );

    x = document.getElementById( id );
    var text =
      '<table class=FigureTable><TR><TD class=Figure3D>'
      +'<div name=' + id + ' id="3DViewer"'
      +' style="width:' + width + '; height:' + height + ';">'
      +'</div>\n'
      +'</TD><TD class=FigureClose3D>\n'
      +'<a href="javascript:showPicture(\'' + id + '\', ' + width + ', ' + height
      + ', \'' + type + '\', \'' + alttext + '\', \'' + resPath + '\')">\n'
      +'<img src="' + resPath + 'Close3DViewer.png" border=0 title="Close 3D Viewer">\n'
      +'</a>'
      +'</TD></TR></table>';
    x.innerHTML = '';
    x.innerHTML = text;
    var v = require('gltfviewer');
    var i = new v.GLTFViewer("3DViewer", id + '.avz', "FILE", null, {report: true, showAbout: false, showFileOpen: false});
  }
}
