function openNewWindow(url)
{window.open(url);}

function swapPhotoAndThumb(file, thumb)
{
  document.getElementById("hrefmainimage").href = file;
  document.getElementById("hrefmainimage").onclick = function(){javascript:openNewWindow(file); return false;};
  document.images.imgmainimage.src = thumb;
}
