// Modify the header here and the update will appear on all pages that use the header
function drawHeader(path) {
  var headerHtml = 
    '<img src="'+path+'images/logo.png" width="274" height="115" border="0" alt="Bloomington Yacht Club">' +
    '<span style="color:darkblue;font-weight:bold;font-size:32px;position:absolute;left:400;top:0;">Bloomington Yacht Club</span>';
  var header = document.getElementById('header');
  header.innerHTML = headerHtml;
}

function drawTopMenu(path, selected) {
  var gap = "&nbsp;&nbsp;|&nbsp;&nbsp;";
  var items = [
    {name: "Home",     url: "index.html"},
    {name: "Membership",   url: "member.html"},
    {name: "Facilities",   url: "facilities.html"},
    {name: "Location",   url: "location.html"},
    {name: "Photo Gallery", url: "photos.html"},
    {name: "Calendar", url: "calendar.html"}, 
    {name: "Races",    url: "races.html"},
    {name: "Links",    url: "links.html"},
    {name: "Website",  url: "website.html"},
    {name: "Contact Us",  url: "contact.html"}
  ];

  var menuHtml = gap;  
  for(i=0; i<items.length; i++) {
    var item = items[i];
    if(selected == item.name) {
      menuHtml += "<b><u>" + item.name + "</u></b>" + gap;
    } else {
      var url = (item.name == "Home") ? "../" + item.url : path + item.url;
      menuHtml += "<a href=\"" + url + "\">" + item.name + "</a>" + gap;
    }
  }
  var menu = document.getElementById('topmenu');
  menu.innerHTML = menuHtml;
}

// Slide Show
var imgInterval = 4000;
var images = [
  "photos/misc2010/LLR_0959.jpg",
  "photos/misc2010/LLR_0928.jpg",
  "photos/misc2010/LLR_1745.jpg",
  "photos/misc2010/LLR_2015.jpg",
  "photos/misc2010/LLR_2155.jpg",
  "photos/misc2010/LLR_2256.jpg",
  "photos/misc2010/LLR_2340.jpg",
  "photos/misc2010/LLR_0976.jpg",
  "photos/misc2010/OCT_1221.jpg",
  "photos/misc2010/OCT_1265.jpg",
  "photos/misc2010/Pirates1.jpg",
  "photos/misc2009/LakeLemonRegatta01.jpg",
  "photos/misc2009/LakeLemonRegatta02.jpg",
  "photos/misc2009/LakeLemonRegatta03.jpg",
  "photos/misc2009/LakeLemonRegatta04.jpg",
  "photos/misc2009/LakeLemonRegatta05.jpg",
  "photos/misc2009/LakeLemonRegatta06.jpg",
  "photos/misc2009/LakeLemonRegatta07.jpg",
  "photos/misc2009/LakeLemonRegatta08.jpg",
  "photos/misc2009/LakeLemonRegatta09.jpg",
  "photos/misc2008/LakeLemonRegatta01.jpg",
  "photos/misc2008/LakeLemonRegatta02.jpg",
  "photos/misc2008/LakeLemonRegatta03.jpg",
  "photos/misc2008/LakeLemonRegatta04.jpg",
  "photos/misc2008/LakeLemonRegatta05.jpg",
  "photos/misc2008/LakeLemonRegatta06.jpg",
  "photos/misc2008/SundayRaces01.jpg",
  "photos/misc2007/6byc_misc.jpg",
  "photos/misc2009/TigerLakeLemon4.jpg"
];
                 
function switchImage(imgIndex) {
  var imgTag = document.getElementById("slideshow");
  imgTag.src = images[imgIndex];
  imgIndex++;
  if(imgIndex >= images.length) imgIndex = 0;
  imgTimerID = setTimeout("switchImage("+imgIndex+")", imgInterval);
}


