/**
 * @fileoverview 
 * <p>This library contains PhotoGallery viewer slides.
 * </p>
 * @author Robert D. Rice
 */

// vc_id = "$Id: PhotoGallery.js 11686 2008-07-30 18:48:58Z robert $"
var basepath = APPIMAGES ? APPIMAGES + "/" : "images/";
var PANORAMIC_FLAT_ICON = '<img src="' + basepath + 'newViewer_pano_icon.png" alt="Panoramic Flat">';
var PANORAMIC_SPHERE_ICON = '<img src="' + basepath + 'newViewer_360_icon.png" alt="Panoramic Sphere">';
var PANORAMIC_CUBE_ICON = '<img src="' + basepath + 'newViewer_360_icon.png" alt="Panoramic Cube">';
var PDF_FULL_ICON = basepath + 'PG_PDF.jpg';
var PDF_THUMB_ICON = basepath + 'PG_PDF_slide_thumb.jpg';
 
/**
 * Constructor for a panoramic slide.
 * This is a specialization of Slide.
 * @constructor
 * @param applet tag
 * @param type ( flat, sphere or cube )
 * @return new Panormaic
 */
function PanoramicSlide( applet, type ) {
  this.full = applet ? applet : null;
  this.pre = '<p align="center">&nbsp;Panoramic&nbsp;<br />';
  this.post = '</p>';
  this.type = type;
  this.icon = PANORAMIC_FLAT_ICON;
  if ( this.type == "cube" ) {
      this.icon = PANORAMIC_CUBE_ICON;
  } else if ( this.type == "sphere" ) {
      this.icon = PANORAMIC_SPHERE_ICON;
  }
  this.thumb = this.type ?  this.pre + this.icon + this.post : null;
}
PanoramicSlide.prototype = new Slide( );

/**
 * Constructor for a description slide.
 * This is a specialization of Slide.
 * @constructor
 * @param description
 * @param desc width
 * @param desc height
 * @return new DescriptionSlide
 */
function DescriptionSlide( description, descWidth, descHeight ) {
    this.description = description;
    this.width = descWidth;
    this.height = descHeight;
    this.pre = '<div class="photo-album-description" style="width:' + this.width + 'px;height:' + this.height + 'px;"><table><tr><td>';
    this.post = '</td></tr></table></div>';
    this.description = description;
    this.full = this.pre + this.description + this.post;
}
DescriptionSlide.prototype = new Slide( );

/**
 * Constructor for a document slide
 * @constructor
 * @param url for this document
 * @param type for this document
 * @param full width of document container
 * @param full height of the document container
 * @param thumb width of the document container
 * @param thumb height of the document container
 * @return a DocumentSlide
 */
function DocumentSlide( document, type, fullWidth, fullHeight, thumbWidth, thumbHeight ) {
    this.document = document;
    this.type = type;
    this.pre = '<table width="' + fullWidth + '" height="' + fullHeight+ '"><tr><td align="center" valign="middle">' + 
	'<a href="' + this.document + '">';
    this.post = '</a></td></tr></table>';

    // here we would switch the icons based upon type
    this.setFullSrc( PDF_FULL_ICON );
    this.setThumbSrc( PDF_THUMB_ICON, thumbWidth, thumbHeight);

    this.full = this.pre + this.full + this.post;
}
DocumentSlide.prototype = new Photo( );