function loadFrame(id) {
  // Hide existing information
  $$('div.information').each(function(s){ s.hide(); })

  // Show the one that got clicked
  $(id).show();
  
  // Make the clicked one 'active'
  $$('a.slide-link').each(function(s){ s.removeClassName('active'); })
  $(id + '-link').addClassName('active')
}

function previousPhoto(id) {
  // Get an array of all the photos, and hide them all
  photos = $$('#' + id + ' img.photo');
  photos.each(function(s){ 
    s.hide(); 
    // Find out which in the array is "on"
    if (s.hasClassName('on')) { 
      on_index = photos.indexOf(s); 
      s.removeClassName('on');
    }
  })

  // Advance "on" by one
  new_on = on_index - 1;
  if (new_on == -1 ) { new_on = photos.length - 1; }
  photos[new_on].show();
  photos[new_on].addClassName('on')
}

function nextPhoto(id) {
  // Get an array of all the photos, and hide them all
  photos = $$('#' + id + ' img.photo');
  photos.each(function(s){ 
    s.hide(); 
    // Find out which in the array is "on"
    if (s.hasClassName('on')) { 
      on_index = photos.indexOf(s); 
      s.removeClassName('on');
    }
  })

  // Advance "on" by one
  new_on = on_index + 1;
  if (new_on > photos.length - 1 ) { new_on = 0; }
  photos[new_on].show();
  photos[new_on].addClassName('on')
}
