function swapImage(id,s,thumbId) {
 var el = document.getElementById(id); // Get the large image area id
 var thumb = document.getElementById(thumbId); // Get the id of the thumbnail image
 el.src = s;
 
 // Change the className of the selected image
 if ( thumb.className == '' ) {
  thumb.className = 'selected';
 }
 
 // Clear the className for the other thumbs
 clearOtherThumbs(thumbId);
}

function clearOtherThumbs(id) {
 var others = document.getElementsByTagName("img"); // Get all images
 
 for ( var i = 0; i < others.length; i++ ) {
  // If the images id doesn't match the selected image, remove it's class
  if ( others[i].id != id ) {
   others[i].className = '';
  }
 }
}
