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_1027.jpg", "../images/tn_1027.jpg", "Panorama of Lake", "Panorama of Lake", " ", "0.0, 150.0, 0.8"), 
  new tour("../images/panel_0145.jpg", "../images/tn_0145.jpg", "Outdoor Wedding Venue", "Outdoor Wedding Venue", "View 1", "0.0, 150.0, 0.9"), 
  new tour("../images/panel_0231.jpg", "../images/tn_0231.jpg", "Outdoor Wedding Venue", "Outdoor Wedding Venue", "View 2", "0.0, 340.0, 0.8"), 

  new tour("../images/panel_1045.jpg", "../images/tn_1045.jpg", "Upper Lobby", "Upper Lobby", " ", "0.0, 100.0, 0.7"), 
  new tour("../images/panel_1068.jpg", "../images/tn_1068.jpg", "Atrium for Coctail Hour", "Atrium", "For Coctail Hour", "0.0, 120.0, 0.7"), 
  new tour("../images/panel_0250.jpg", "../images/tn_0250.jpg", "Ballroom Daytime", "Ballroom", "In the Daytime", "0.0, 0.0, 0.8"), 

  new tour("../images/panel_1190.jpg", "../images/tn_1190.jpg", "Ballroom Evening", "Ballroom", "In the Evening ", "0.0, 120.0, 0.9"), 
  new tour("../images/panel_0133.jpg", "../images/tn_0133.jpg", "Dining Room View 1", "Dining Room", "View 1", "0.0, 120.0, 0.9"), 
  new tour("../images/panel_0169.jpg", "../images/tn_0169.jpg", "Dining Room View 2", "Dining Room", "View 2", "0.0, 340.0, 0.8"),

  new tour("../images/panel_1161.jpg", "../images/tn_1161.jpg", "Lounge Dining Area", "Lounge", "Dining Area for Smaller Parties", "0.0, 240.0, 0.8"),
  new tour("../images/panel_1127.jpg", "../images/tn_1127.jpg", "The Cafe", "The Cafe", "Small Private Parties", "0.0, 20.0, 0.8"), 
  new tour("../images/panel_1083.jpg", "../images/tn_1083.jpg", "The Patio", "The Patio", " ", "0.0, 120.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/dot_clear.gif\" width=" + spacer + "></td>");
}

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