﻿setNav();

function setNav(suiteIndex, offerIndex) {
  var docElem;
  if (resortCode.length > 0) {
    docElem = document.getElementById("navResort");
    if (docElem) docElem.innerHTML = resorts_Name(resortCode);
  }
  docElem = document.getElementById("imgSelect" + suiteCode);
  if (docElem) {
    docElem.src = "/Spacer.gif";
    docElem.width = 1;
  }
  docElem = document.getElementById("imgSelect" + suiteCode);
  if (docElem) {
    docElem.src = "images/suite_select.png";
    docElem.width = 20;
  }
  if (adultCount > 0) {
    docElem = document.getElementById("navGuests");
    var guestCounts = adultCount + " Adult";
    if (adultCount>1) guestCounts += "s";
    switch(childCount) {
     case 0:
      break;
     case 1:
      guestCounts += ", one child";
      break;
     default:
      guestCounts += ", " + childCount + " children";
      break;
    }
    if (docElem) docElem.innerHTML = guestCounts;
  }
  docElem = document.getElementById("navDates");
  if (docElem) {
    var sHTML = "<strong>&nbsp;&nbsp;&nbsp;"
    sHTML += dates_numberOfNights();
    sHTML += " night stay</strong>";
    sHTML += "<br>Check in:<strong>&nbsp;";
    sHTML += arrival.toDateString();  
    sHTML += "</strong>";
    sHTML += "<br>Check out:<strong>&nbsp;";
    sHTML += departure.toDateString();
    sHTML += "</strong>";
    if (docElem) docElem.innerHTML = sHTML;
  }
  docElem = document.getElementById("navSuite");
  if (!docElem) return;
  if(suiteIndex == null) {
    if (docElem) docElem.innerHTML = (suiteName.length == 0) ? "": "Choose your suite";
  } else {
    if (docElem) docElem.innerHTML = "(" + marketCode[suiteIndex] + ":" + suiteType[suiteIndex] + ") ";
    if (docElem) docElem.innerHTML += "<strong>" + suiteName[suiteIndex] + "</strong>";
    docElem = document.getElementById("navRates");
    if (docElem) docElem.innerHTML = offer_RateHTML(suiteIndex);
  }
}

function navbar_taxesFees() {
	centerIT(document.getElementById("taxesfees"));
	document.getElementById("taxesfees").style.visibility = 'visible';
}

