
  function updateMainNav(el, type) {
    var nav = document.getElementById('nav_main');
    var nav_links = nav.getElementsByTagName('a');
    for (var i = 0; i < nav_links.length; i++) {
      nav_links[i].className = '';  
    }

    var subnav = '';
    switch (type) {
      case 'aircraft_management':
        el.className = 'selected';
        subnav = '<a href="about-our-family.php">ABOUT OUR FAMILY</a>' + 
                 '<a href="private-jet-purchasing.php">PRIVATE JET PURCHASING</a>' + 
                 '<a href="flight-crews.php">FLIGHT CREWS</a>' +  
                 '<a href="360-service.php">360&deg; SERVICE</a>'; 
        break;
      case 'charter':
        el.className = 'selected';
        subnav = '<a href="why-lj.php">WHY L.J.?</a>' +
                 '<a href="charter-aircraft.php">CHARTER AIRCRAFT</a>' +
                 '<a href="request-a-travel-quote.php">REQUEST A TRAVEL QUOTE</a>' + 
                 '<a href="schedule-a-flight.php">SCHEDULE A FLIGHT</a>' +
                 '<a href="leave-the-planning-to-us.php">LEAVE THE PLANNING TO US</a>'; 
        break;
      case 'news':
        el.className = 'selected';
        subnav = '<div class="right"><a href="in-the-news.php">IN THE NEWS</a>' +
                 '<a href="video.php">VIDEO</a>' +
                 '<a href="lj-announcements.php">L. J. ANNOUNCEMENTS</a></div>';  
        break;
    }
    document.getElementById('nav_secondary').innerHTML = subnav;
  }

  function loadVideo(id) {
    $('#video_container div').each(function(index) {
      if (this.id == id) {
        $(this).show();
      }
      else {
      	// for IE, remove dom and replace so video doesn't keep playing in the background
	var embed_code = $(this).html();
	$(this).html('');
	$(this).html(embed_code);
        $(this).hide();
      }
    });
  }

  $(document).ready(function() {
    var path = window.location.pathname.split('/');
    var hash = window.location.hash;
    if (path[path.length-1] == 'video.php' && hash) {
      loadVideo(hash.substr(1));
    }
  });


