// --> Sets image location by changing the 'src' 
//	field of the passed object. The object
//	should be an <img ...> tag.



// --> Remove 'tn' from the src path. It is assumed 
//	that 'tn' is the directory just before the filename

function setImgLocation_removeTn (objImage) {
  fn = objImage.src.split('/');
  file = fn[fn.length-1];
  for (ii=0; ii<fn.length-1; ii++) {
    if (fn[ii] == 'tn') {
      fn[ii] = file;
      fn.length = ii+1;
      objImage.src = fn.join ('/');
      return;
    }
  }
}


// --> Add 'tn' to the src path. It is assumed 
//	that 'tn' goes just before the filename

function setImgLocation_addTn (objImage) {
  fn = objImage.src.split('/');
  file = fn[fn.length-1];
  fn[fn.length-1] = 'tn';
  fn[fn.length] = file;
  objImage.src = fn.join ('/');
}



// --> Display full size image in separate window

//function displayImgFull (idName) {
function displayImgFull (figNum) {
  window.open ('index.php?figure='+figNum, '', 'width=1004,height=800,resizable,scrollbars');
  return false;


  fn = (document.getElementById(idName)).src.split('/');
  file = fn[fn.length-1];
  if (fn[fn.length-2] == 'tn') {
    fn[fn.length-2] = 'lg';
   } else {
    fn[fn.length-1] = 'lg';
    fn[fn.length] = file;
  }
  newImgUrl = fn.join ('/');
  window.open (newImgUrl, '', 'width=978,height=800,resizable,scrollable');
  return;
}


