/**
 *  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 : "Current Specials",
        href : "http://www.maunalani.com/a_cs.htm",
        newwin : false },

      { text : "Room Packages",
        href : "http://www.maunalani.com/a_p_overview.htm",
        newwin : false },
		
	  { text : "Room Rates / Booking",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074",
        newwin : true },
	
      { text : "Guestrooms",
        href : "http://www.maunalani.com/a_gr_overview.htm",
        newwin : false },

      { text : "Bungalows",
        href : "http://www.maunalanibungalows.com/index.html",
        newwin : false },

      { text : "Villas",
        href : "http://www.maunalani.com/a_v_overview.htm",
        newwin : false },
		
      { text : "The Surroundings",
        href : "http://www.maunalani.com/a_s_sharkpond.htm",
        newwin : false },
		
	  { text : "Resort Tour",
        href : "http://www.maunalani.com/virtual_tour.htm",
        newwin : true },

       { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
							
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }
		
    ],

  golf :
    [
      { text : "25th Anniversary",
        href : "http://www.maunalani.com/g_25th_anniversary.html",
        newwin : false },	  
	  
	  { text : "North Course",
        href : "http://www.maunalani.com/g_nc_overview.htm",
        newwin : false },

      { text : "South Course",
        href : "http://www.maunalani.com/g_sc_overview.htm",
        newwin : false },

      { text : "Golf Instruction",
        href : "http://www.maunalani.com/g_golf_instruction.htm",
        newwin : false },

	  { text : "Golf Rates / Packages",
        href : "http://www.maunalani.com/g_rates.htm",
        newwin : false },
	  
	  { text : "Golf History",
        href : "http://www.maunalani.com/g_h_overview.htm",
        newwin : false },

	  { text : "Golf Tournaments",
        href : "http://www.maunalani.com/g_tournament.htm",
        newwin : false },

       { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
							
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com/Merchant4/merchant.mv?Screen=CTGY&Store_Code=mlm&Category_Code=g_home",
        newwin : true }
    ],

fitness :
    [
      { text : "Fitness Overview",
        href : "http://www.maunalani.com/s_fitness.htm",
        newwin : false },

      { text : "Facilities",
        href : "http://www.maunalani.com/f_facilities.htm",
        newwin : false },

      { text : "Tennis",
        href : "http://www.maunalani.com/r_a_tennis.htm",
        newwin : false },
		
		{ text : "Program/Events",
        href : "http://www.maunalani.com/f_program.htm",
        newwin : false },

       { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
										
		{ text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }
	],


  dining :
    [
      { text : "Dining Experience",
        href : "http://www.maunalani.com/d_de_overview.htm",
        newwin : false },

      { text : "Bay Terrace",
        href : "http://www.maunalani.com/d_bt_overview.htm",
        newwin : false },

      { text : "CanoeHouse",
        href : "http://www.maunalani.com/d_ch_overview.htm",
        newwin : false },

      { text : "Gallery",
        href : "http://www.maunalani.com/d_g_overview.htm",
        newwin : false },

	  { text : "Honu Bar",
        href : "http://www.maunalani.com/d_hb_overview.htm",
        newwin : false },

      { text : "Ocean Grill",
        href : "http://www.maunalani.com/d_og_overview.htm",
        newwin : false },
      
      { text : "Beach Club",
        href : "http://www.maunalani.com/d_bc_overview.htm",
        newwin : false },

      { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
									
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }

    ],

  spa :
    [
      { text : "Fire &amp; Ice",
        href : "http://www.maunalani.com/s_fi_overview.htm",
        newwin : false },
		
	  { text : "Spa Treatments",
        href : "http://www.maunalani.com/s_st_hawaiian_treatments.htm",
        newwin : false },
		
	  { text : "Spa Rates / Packages",
        href : "http://www.maunalani.com/s_r_rates.htm",
        newwin : false },

      { text : "Salon",
        href : "http://www.maunalani.com/s_s_haircare.htm",
        newwin : false },
		
      { text : "Ke Kumu O' Mauna Lani",
        href : "http://www.maunalani.com/s_kks2k5_overview.htm",
        newwin : false },

      { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
											
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com/Merchant4/merchant.mv?Screen=CTGY&Store_Code=mlm&Category_Code=s_home",
        newwin : true }
    ],

  meetings :
    [
      { text : "Meetings Overview",
        href : "http://www.maunalani.com/m_overview.htm",
        newwin : false },

      { text : "Function Space",
        href : "http://www.maunalani.com/m_fs_overview.htm",
        newwin : false },

      { text : "Hale Hoaloha Pavilion",
        href : "http://www.maunalani.com/m_fs_halehoaloha.htm",
        newwin : false },
		
      { text : "Theme Parties",
        href : "http://www.maunalani.com/m_tp_overview.htm",
        newwin : false },
		
	  { text : "Meeting Planner Kit",
        href : "http://www.maunalani.com/m_planner_kit.htm",
        newwin : false },

      { text : "Request for Proposal",
        href : "http://www.maunalani.com/m_request.htm",
        newwin : false }, 
		
      { text : "Sales Team",
        href : "http://www.maunalani.com/m_salesteam.htm",
        newwin : false },
		
	  { text : "Gold Group Package",
        href : "http://www.maunalani.com/m_gold_group.htm",
        newwin : false },
		
	  { text : "Resort Tour",
        href : "http://www.maunalani.com/virtual_tour.htm",
        newwin : true },

      { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
								  
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }
    
	],

weddings :
    [
      { text : "Overview",
        href : "http://www.maunalani.com/r_w_overview.htm",
        newwin : false },

      { text : "Aloha Wedding",
        href : "http://www.maunalani.com/r_w_aloha_wedding.htm",
        newwin : false },

      { text : "Sunset Wedding",
        href : "http://www.maunalani.com/r_w_sunset_wedding.htm",
        newwin : false },
		
      { text : "Intimate Wedding",
        href : "http://www.maunalani.com/r_w_intimate_wedding.htm",
        newwin : false },
		
	  { text : "Weddings Director",
        href : "http://www.maunalani.com/r_w_weddings_director.htm",
        newwin : false },
		
	  { text : "Resort Tour",
        href : "http://www.maunalani.com/virtual_tour.htm",
        newwin : true },

      { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
									
      { text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }
		
	],

  resort :
    [
      { text : "Contact Us",
        href : "http://www.maunalani.com/r_contactus.htm",
        newwin : false },
		
	  { text : "Activities/Events",
        href : "http://www.maunalani.com/r_a_activities.htm",
        newwin : false },
		
	  { text : "Book Rooms Online",
        href : "http://www.maunalani.com/planner.htm",
        newwin : false },
		
	  { text : "Children's Camp",
        href : "http://www.maunalani.com/r_a_kidsclub.htm",
        newwin : false },
     
	 { text : "Directions / Map",
        href : "http://www.maunalani.com/r_map.htm",
        newwin : false },
		
		{ text : "Guest Update",
        href : "http://www.maunalani.com/r_guest_update.htm",
        newwin : false },

      { text : "Hawaiian Culture",
        href : "http://www.maunalani.com/r_hc_overview.htm",
        newwin : false },
		
	  { text : "Ke Kumu",
        href : "http://www.maunalani.com/s_kks2k5_overview.htm",
        newwin : false },
		
			  { text : "Sunset Getaway",
        href : "http://www.maunalani.com/a_p_sunset.htm",
        newwin : false },
		
      { text : "Rental Cars",
        href : "http://www.maunalani.com/r_car_rental.htm",
        newwin : false },
		
		{ text : "Resort Blog",
        href : "http://www.maunalani.com/blogger.html",
        newwin : false },
		
		{ text : "Resort Newsletter",
        href : "http://www.maunalani.com/r_newsletter.htm",
        newwin : false },
		
      { text : "Resort Real Estate",
        href : "http://www.maunalanirealty.com",
        newwin : true },
		
	  { text : "Resort Tour",
        href : "http://www.maunalani.com/virtual_tour.htm",
        newwin : true },

	  { text : "Resort Video",
        href : "http://www.maunalani.com/r_video.htm",
        newwin : true,
        winFeatures : "width=320,height=200" },

      { text : "Resort Webcam",
        href : "http://www.maunalani.com/r_webcams.htm",
        newwin : false },
		
	  { text : "Employment",
        href : "http://www.maunalani.com/r_employment.htm",
        newwin : false },

      { text : "Book Rooms Online",
        href : "https://reservations.ihotelier.com/onescreen.cfm?hotelid=13074&languageid=1",
        newwin : true },
											
	  { text : "Shop Online",
        href : "http://www.maunalanistore.com",
        newwin : true }
    ]
};

/**
 *  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 writeGolf()
{
  var thisMenu = menu.golf;
  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 writeSpa()
{
  var thisMenu = menu.spa;
  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> ");
  }
}


function writeFitness()
{
  var thisMenu = menu.fitness;
  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 writeDining()
{
  var thisMenu = menu.dining;
  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 writeMeetings()
{
  var thisMenu = menu.meetings;
  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 writeWeddings()
{
  var thisMenu = menu.weddings;
  var linkTarget;
  var aHref;
  var n = 6;  // 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> ");
  }
}

// var System = java.lang.System;

function writeResort()
{
  var thisMenu = menu.resort;
  var linkTarget;
  var aHref;
  var n = 7;  // 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 + "\"";
    }
//    System.out.println("aHref[" + i + "] : " + aHref);
    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> ");
  }
}