function current()
  {
  // Return current image number
  for (i = 0; i < imageCount(); i++)
    {
    if (document.title == url[i])
      {
      // alert ("The URL is: " + url[i]);    
      return(i);      
      }
    } 
    alert ("Cannot find: " + document.title);
    return(0);
  }

function position()
  {
  return("Full size " + imageGroup() + " image no. " + (current() + 1) + " of " + imageCount() );
  }

function back()
  {
  location.replace(url[(imageCount() + current() - 1) % imageCount()]);
  //  document.location = url[(imageCount() + current() - 1) % imageCount()];
  return;      
  }

function linkBack()
  {
  return("Display previous " + imageGroup() + " image, No. " + ((current() + imageCount() - 1) % (imageCount()) + 1) );
  }

function linkOut()
  {
  return("Return to " + imageGroup() + " cluster");
  }

function next()
  {
  location.replace(url[(current() + 1) % imageCount()]);
  //  document.location = url[(current() + 1) % imageCount()];
  return;      
  }

function linkNext()
  {
  return("Display next " + imageGroup() + " image, No. " + ((current() + 1) % (imageCount()) + 1) );
  }

function out()
  {
  history.back();
  return;
  }

