//  Code for toggling between thumbnail images on show.html

function toggle_thumb(elt) {
  container = document.getElementById('photos');
  if (!container) {alert('no container'); return;}
  image = container.getElementsByTagName('img')[0];
  link = image.parentNode;
  // change the source of the image
  image.src = elt.getAttribute('source');
  // change the href of the link
  link.href = elt.getAttribute('reference');
}

function getElementFromEvent(evt) {
  evt = (evt) ? evt : ((window.event) ? window.event : null);
  var elem;
  if (evt) 
    elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  return elem;
}