// Javascript functions
//
// Get the Copyright year
function copyright()
{
  return 'Copyright 2003';
}
// Get the Copyright owner
function copyright_owner()
{
  return ' Beauclerk Escrime';
}
// Get the Personal Copyright owner
function personal_copyright_owner()
{
  return ' Ian Thomson';
}
// Get the Contact Name
function contact_name()
{
  return ' Ian Thomson';
}
// Convert date to DD MMM YYYY format
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getFullYear();

  var mmm = 
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  return "" + (d<10?"0"+d:d) + " " +  mmm + " " + y;
}

// Get the Last Modified date of this page
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;
  if(0 != (d1=Date.parse(lmd)))
     {s = "" + date_ddmmmyy(new Date(d1));}
  return s;
}
// Highlight sets the image to ACTIVE+BUTTON+COLOUR prefix
function highlight (name, button, colour)
{
  if (document.images[name+button].src.indexOf('active') < 0)
    {document.images[name+button].src='active_'+button+'_'+colour+'.gif';}
}
// Normal set the image to BUTTON+COLOUR
function normal (name, button, colour)
{
  if (document.images[name+button].src.indexOf('active') >= 0)
    {document.images[name+button].src=button+'_'+colour+'.gif';}
}
// Toggle alternates the image between BUTTON+ACOLOUR and BUTTON+NCOLOUR
function toggle (name, button, ncolour, acolour)
{
  if (document.images[name+button].src.indexOf(acolour) < 0)
    {document.images[name+button].src=button+'_'+acolour+'.gif';}
  else
    {document.images[name+button].src=button+'_'+ncolour+'.gif';}
}
// Swap alternates the image between ASOURCE and NSOURCE
function swap (name, nsource, asource)
{
  if (document.images[name].src.indexOf(asource) < 0)
    {document.images[name].src=asource;}
  else
    {document.images[name].src=nsource;}
}
// Redraw set the image to SOURCE
function redraw (name, source)
{
  document.images[name].src=source;
}
// End
