/**
 *  Menu data is contained in an array of arrays of objects. Each object
 *  has four properties:
 *    text          text displayed in menu
 *    href          link uri
 *    newwin        whether to open a new window
 *    [winFeatures] optional string of new window features (no whitespace)
 */
var menu = new Array();

menu = {
  accommodations :
    [
	  { text : "Voila Concierge",
        href : "Accomodations_VoilaConcierge.htm",
        newwin : false },
	
      { text : "Current Specials",
        href : "Accomodations_CurrentSpecials.htm",
        newwin : false },

      { text : "Room Packages",
        href : "Accomodations_RoomPackages.htm",
        newwin : false },
		
	  { text : "Room Rates / Booking",
        href : "frmRoomRates.aspx",
        newwin : false },
	
      { text : "Guest Rooms",
        href : "Accomodations_Guestrooms.htm",
        newwin : false },
      		
      { text : "The Surroundings",
        href : "Accomodations_Surroundings.htm",
        newwin : false },
		
	  { text : "Resort Tour",
        href : "Accomodations_ResortTour.htm",
        newwin : false },
		
	  { text : "Shop Online",
        href : "Accomodations_ShopOnline.htm",
        newwin : false }
    ],

  dining :
    [
      { text : "Experience",
        href : "Dining_Experience.htm",
        newwin : false },

      { text : "La Terrace",
        href : "Dining_EllasTerrace.htm",
        newwin : false }
    ],

  sailing :
    [
      { text : "Getting Here",
        href : "AboutJacmel_GettingHere.htm",
        newwin : false },

      { text : "Jacmel",
        href : "AboutJacmel_JacmelMarigot.htm",
        newwin : false },

      { text : "Sight Seeing",
        href : "AboutJacmel_SightSeeing.htm",
        newwin : false },
		
      { text : "Emergency Info",
        href : "AboutJacmel_EmergencyInfo.htm",
        newwin : false },
		
	  { text : "Embassy Contacts",
        href : "AboutJacmel_EmbassyContacts.htm",
        newwin : false }


	],


  ecotourism :
    [
      { text : "Contact Us",
        href : "HotelInfo_ContactUs.htm",
        newwin : false },
		
	  { text : "Directions/Map",
        href : "HotelInfo_Directions.htm",
        newwin : false },
		
	  { text : "Travel",
        href : "javascript:;",
        newwin : false },
		
	  { text : "Schedule",
        href : "HotelInfo_Schedule.htm",
        newwin : false } 

    ],

  hotelinfo :
    [
      { text : "Overview",
        href : "EcoTourism_Overview.htm",
        newwin : false },      

      { text : "Activities list",
        href : "EcoTourism_ActivitiesList.htm",
        newwin : false }, 

      { text : "Activity Sign up",
        href : "EcoTourism_ActivitySignUp.htm",
        newwin : false }, 

      { text : "Schedule",
        href : "EcoTourism_Schedule.htm",
        newwin : false } 
    ]

};

/**
 *  void writeAccommodations()
 *
 *  Writes drop-down menu to document. Structure matches the following
 *  functions.
 *
 *  @return void
 */
function writeAccommodations()
{
  var thisMenu = menu.accommodations;
  var linkTarget;
  var aHref;
  var n = 0;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}

function writeDining()
{
  var thisMenu = menu.dining;
  var linkTarget;
  var aHref;
  var n = 1;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}


function writeSailing()
{
  var thisMenu = menu.sailing;
  var linkTarget;
  var aHref;
  var n = 5;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}


function writeEcoTourism()
{
  var thisMenu = menu.ecotourism;
  var linkTarget;
  var aHref;
  var n = 3;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}


function writeHotelInfo()
{
  var thisMenu = menu.hotelinfo;
  var linkTarget;
  var aHref;
  var n = 4;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}

function writeAboutMarigot()
{
  var thisMenu = menu.aboutjacmel;
  var linkTarget;
  var aHref;
  var n = 2;  // menu position

  for (var i = 0; i < thisMenu.length; i++) {
    linkTarget = " target=\"" +
      ((thisMenu[i].newwin) ? "newwin" + i : "_self") +
      "\"";

    if (thisMenu[i].winFeatures) {
      aHref = "href=\"#\" onclick=\"window.open('" +
        thisMenu[i].href +
        "', 'customwin', '" +
        thisMenu[i].winFeatures +
        "');\"";
      linkTarget = "";
    }
    else {
      aHref = "href=\"" + thisMenu[i].href + "\"";
    }

    document.write("<div id=\"menu" + n + "_item" + i + "\" ");
    document.write("class=\"node_item\"><a ");
    document.write("id=\"a_menu" + n + "_item" + i + "\" ");
    document.write(aHref);
    document.write(linkTarget);
    document.write(">" + thisMenu[i].text + "</a></div> ");
  }
}