
// ImageRef is an object that stores the information
// about the image that was most recently replaced
// with a 3D viewer so that it can be restored when
// another image is selected.
function ImageRef( id, type, width, height, alttext, resPath ) {
  this.id = id;
  this.type = type;
  this.width = width;
  this.height = height;
  this.alttext = alttext;
  this.resPath = resPath;
}

imageRefObj = new ImageRef( "-1", "", 0, 0, "" );

// showPicture is a function for displaying an image in a report.
function showPicture( id, width, height, type, alttext, resPath ) {
  if( document.getElementById ) {
    x = document.getElementById( id );
    var text = 
    '<a style="color:black;" href="javascript:showViewer(\'' + id + '\', ' + width + ', ' + height
      + ', \'' + type + '\', \'' + alttext + '\', \'' + resPath + '\')">\n'
    + '<img src=\"' + id + '.' + type + '\" ALT=\"' + alttext + '\" border=1 title=\"Click to View in 3D\">\n'
    + '</a>';
    imageRefObj = new ImageRef( "-1", "", 0, 0, "", "" );
    x.innerHTML = '';
    x.innerHTML = text;
  }
}

