function tour(image, thumb, text, header1, header2, initialView) { 
   this.image = image;
   this.thumb = thumb;
   this.text = text;
   this.header1 = header1;
   this.header2 = header2;
   this.initialView = initialView;
} 

//****************************************************************
//  TO CUSTOMIZE, DEFINE HOW MANY THUMBNAILS PER ROW ("MAX_COLS")
//    AND PIXEL SPACE BETWEEN COLUMNS ("SPACER"), IF NEEDED; 
//    THEN MODIFY THE "TOURS" ARRAY, DEFINING EACH TOUR IMAGE,
//    THUMB IMAGE AND THUMB DESCRIPTION TEXT.
//****************************************************************

var MAX_COLS = 3;
var SPACER = 0;

var tours = 
[
  new tour("images/panel_01a.jpg", "images/panel_01.jpg", "Tiara View 1", "Tiara", "View 1", "0.0, 180.0, 0.8"), 
  new tour("images/panel_02a.jpg", "images/panel_02.jpg", "Tiara View 2", "Tiara", "View 2", "-5.0, 180.0, 0.8"), 
  new tour("images/panel_03a.jpg", "images/panel_03.jpg", "Tiara View 3", "Tiara", "View 3", "0.0, 180.0, 0.8"), 
  new tour("images/panel_04a.jpg", "images/panel_04.jpg", "Emerald Room", "Emerald Room", "", "0.0, 120.0, 0.8"), 
  new tour("images/panel_05a.jpg", "images/panel_05.jpg", "Main Lobby", "Main Lobby", "", "0.0, 280.0, 0.8"), 
  new tour("images/panel_06a.jpg", "images/panel_06.jpg", "Topaz Room", "Topaz Room", "", "0.0, 180.0, 0.8")

];

//****************************************************************
//  END CUSTOMIZATION SECTION
//****************************************************************

var tourSelect = (location.search.substring(1).length == 0) ? 0 : location.search.substring(1);

function doTour(i) {
  document.getElementById("tour_iframe").src = "tour_iframe.html?" + i;
  document.getElementById("tour_description").innerHTML = getHeader(i);
}

function writeTour() {
  out("<APPLET height=256 archive=\"BeHereViewer.jar\" width=464 align=center code=BeHereViewer.class>");
  out("<PARAM NAME=\"panImage\" VALUE=\"" + tours[tourSelect].image + "\">");
  out("<PARAM NAME=\"autoSpin\" VALUE=\"10\">");
  out("<PARAM NAME=\"ShowPanView\" VALUE=\"false\">");
  out("<PARAM NAME=\"Initialview\" VALUE=\"" + tours[tourSelect].initialView + "\">");
  out("Applet Copyright 1998-2001 Be Here Corporation");
  out("</APPLET>");
}

function writeThumbs(maxCols, spacer) {
  for (row = 0; row < tours.length / maxCols; row++) {
    out("<tr>");
    for (var col = 0; col < Math.min(maxCols, tours.length - (row * maxCols)); col++) {
      var i = (row * maxCols) + col;
      out("<td><table cellpadding=0 cellspacing=0><tr>");
      out("<td><a href=\"javascript:doTour(" + i + ")\"><img src=\"" + tours[i].thumb + "\" alt=\"" + tours[i].text + "\" width=\"145\" height=\"80\" border=0></a></td>");
      out("</tr><tr>");
      out("<td align=\"center\"><font size=\"1\" face=\"Verdana\">" + tours[i].text + "</font></td>");  
      out("</tr></table></td>");
      if (col < maxCols - 1)
        writeSpacerColumn(spacer);
    }
    out("</tr>");
  }
}

function writeDescription() {
  out(getHeader(tourSelect));
}

function getHeader(i) {
  return "<font size=\"2\" color=\"#000080\"><b><br>" + tours[i].header1 + "<br></b></font><font size=\"1\" color=\"#000080\">" + tours[i].header2 + "</font>";
}

function writeSpacerColumn(spacer) {
  out("<td width=" + spacer + "><img src=\"images/1ptrans.gif\" width=" + spacer + "></td>");
}

function out(s) {
  document.writeln(s);
}