// trupfoot.js

function lastupdated() {
  if (window.innerWidth) {
    xMax = window.innerWidth;   // was .outerWidth;
    yMax = window.innerHeight;
  }
  else {
    if (document.body.clientWidth) {
      xMax = document.body.clientWidth;   // was screen.width;
      yMax = document.body.clientHeight;
    }
    else {
      xMax = 640;
      yMax = 500;
    }
  }
  if (yMax>550) yMax=550;  // Yuk = IE6
  wdth = xMax-10;
  hght = yMax;
  xOffset = (xMax - wdth)/2;
  yOffset = (yMax - hght)/2;

  lastupdatedwin = open('lastupdated.html','lastupdatedchild','width='+wdth+',height='+hght+',screenX='+xOffset+',screenY='+yOffset+
    ',top='+yOffset+',left='+xOffset+',toolbar=no,status=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=1');

  if (lastupdatedwin.opener==null) 
    lastupdatedwin.opener=self;
}

function trphotosfooter(whichpage) {
  var trdateinfooter;
  var outputf = '<hr />\n';

  // Valid Xhtml 1.0 and CSS
  if ((whichpage!=velcroPAGE) && (whichpage!=indexPAGE) 
	&& (whichpage!=percentPAGE)) {
    outputf += '<a href="http://validator.w3.org/check/referer">\n' +
               '<img border="0" src="images/logos/vxhtml10b.gif" ' +
               'alt="Valid Xhtml 1.0" height="31" ' +
               'width="88" align="right" /></a>\n'
            // '<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">' +
            // '<img border="0" src="images/logos/vcss.gif" ' +
            // 'alt="Valid CSS" height="31" width="88" align="right" /></a>\n';
  }

  if (whichpage==indexPAGE)
    trdateinfooter = trLastUpdated[indexPAGE-1];
  else 
    trdateinfooter = trLastUpdated[whichpage];
  outputf += '<p class="trbot">\n';
  if (whichpage!=lastupdPAGE) {
    outputf += '<a class="trlnk" href="lastupdated.html" onclick="lastupdated();return false;">Last updated</a> ';
  }
  else {
    outputf += 'Last updated ';
  }

  // Mailto
  if (whichpage!=boatPAGE)
    outputf += trdateinfooter + '</p>\n' +
             '<p class="trbot">Copyright &copy; ' + 
		 copyrightYEAR + 
		 ' \n<a class="trlnk" href="mailto:phil@trphotos.freeserve.co.uk">' +
             'Phil</a></p>\n';
  else
    outputf += trdateinfooter + '</p>\n' +
             '<p class="trbot">Copyright &copy; ' + 
	  	 copyrightYEAR + 
	  	 ' \n<a class="trlnk" href="mailto:phil@trphotos.freeserve.co.uk">' +
             'Lizi and Phil</a></p>\n';
  document.write(outputf);
}

// DATES:
var  lastupdPAGE = 0;
var  ohyoullPAGE = 1;
var browniesPAGE = 2;
var   velcroPAGE = 3;
var  viewersPAGE = 4;
var     boatPAGE = 5;
var  percentPAGE = 6;
var  nonjavaPAGE = 7;
var    indexPAGE = 8;
var trLastUpdated = new Array(indexPAGE-1);

trLastUpdated[lastupdPAGE]  = "Nov 2008";
trLastUpdated[ohyoullPAGE]  = "August 2001";
trLastUpdated[browniesPAGE] = "May 2004";
trLastUpdated[velcroPAGE]   = "October 2002";
trLastUpdated[viewersPAGE]  = "April 2002"; // Removed May 2007
trLastUpdated[boatPAGE]     = "July 2002";
trLastUpdated[percentPAGE]  = "October 2002";
trLastUpdated[nonjavaPAGE]  = "Nov 2008";         // nonjava &
                                                  // index
var copyrightYEAR = '2008';    // Remember to replace "&copy; 2007" in <noscript>
