﻿function swapThree(photoName){
  var thumbSrc = document[photoName].src;
  
  // swap XmlImported pic
  if (thumbSrc.indexOf('width_120') >= 0)
  {
    document['main'].src = thumbSrc.replace("/width_120", "/width_400");
    return false;
  }
  
  // swap thumbnail pic
  if (thumbSrc.indexOf('thumb') >= 0)
  {
    document['main'].src = thumbSrc.replace("/thumb", "/default");
    return false;
  }

	return false;
}


// for swapping multi pics
// note: photoName is the name of the pic to be replaced
//       namePartSmall is a part of the filename/part of the small pic
//       namePartLarge is a part of the filename/part of the large pic
// how it works: the 'main' pic source gets the source of the thumb clicked on
//               after namePartSmall is replaced with namePartLarge
function swapMulti(photoName, namePartSmall, namePartLarge){
  var thumbSrc = document[photoName].src;
  
  document['main'].src = thumbSrc.replace(namePartSmall, namePartLarge);
  return false;
}
