function toggleMap(i) {
  document.getElementById('map_img').src = 'images/map_' + i + '.jpg'; 
  return false;
}

function toggleTabs(id) {
  // hide all info divs
  var infodivs = document.getElementsByTagName('div');
  if (infodivs) {
    for (var i = 0; i < infodivs.length; i++) {
      if (infodivs[i].className.indexOf('info') != -1)
        infodivs[i].style.display = 'none';
    }
  }
  // show id element
  var showdiv = document.getElementById(id);
  if (showdiv)
    showdiv.style.display = '';
  // turn off selected tab
  var tablist = document.getElementById('detail_menu');
  if (tablist) {
    tabs = tablist.getElementsByTagName('li');
    if (tabs) {
      for (var i = 0; i < tabs.length; i++) {
        if (tabs[i].className.indexOf('sel') != -1)
          tabs[i].className = tabs[i].className.substring(0, tabs[i].className.length -4);
        if (tabs[i].className.indexOf(id) != -1)
          tabs[i].className = tabs[i].className + " sel"
      }
    }
  }
}

// Use this function to insert text or HTML into a web page
// NOTE: still needs to be tested in IE.
// ELT can be an HTML element or an element's ID name
// TEXT should be the text/html that is to be injected.
// For use with Virtual tours, change the 'virtual' tab to read:
// <a style="" href="javascript:toggleTabs('virtual');insert_into_html('virtual', __text__)">Virtual</a> 
// You can predefine text as a variable in a script tag at the beginning of the document if you like.
function insert_into_html(elt, text) {
  if (!elt.style) elt = document.getElementById(elt);
  if (elt) {
    elt.innerHTML = text + elt.innerHTML;
  }
}