// This is pretty straight forward, I originally copied it
// from another script I found, but since then, I rewrote 
// the whole thing - I still need to double check the year
// on different browsers
// - Jeff Coats, 2001
currentSite = self.location.href;
currentSite = currentSite.substring(0,(currentSite.indexOf("/",8)));

// get document's last modified date and print it
modNum = Date.parse(document.lastModified);
if (modNum == 0) modDateL = "an unknown date";
else {
  modDate = new Date(modNum);
  monthL = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  dayL = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
//  timezone = modDate.getTimezoneOffset();
  modDate.setTime(modDate.getTime());
  day = modDate.getDay();
  month = modDate.getMonth();
  date = modDate.getDate();
  year = modDate.getYear();
  hour = modDate.getHours();
  minute = modDate.getMinutes();
  second = modDate.getSeconds();
  if (navigator.appName != "Microsoft Internet Explorer") year = (year + 1900);
  modDateL = dayL[day]+", "+monthL[month]+" "+date+", "+year;
}
document.write("This page was last modified on "+modDateL+".<BR>");

// get user info for web stats
lastPage = getCookie("lastpage");
document.write("<IMG SRC='http://jeffcoats.servebeer.com:8291/cgi-bin/stat.pl?"+lastPage+"' WIDTH=0 HEIGHT=0 ALT=''>");
lastPage = "here";
document.cookie = "lastpage=" + escape(lastPage);

// get current year and print copyright
currentDocument = self.location.href;
currentDocument = currentDocument.substring(currentDocument.lastIndexOf("/")+1,currentDocument.indexOf(".html"));
calendar = new Date();
year = calendar.getYear();
if (navigator.appName != "Microsoft Internet Explorer") year = (year + 1900);
if (currentDocument == "legal")
  if (year > 1999) document.write("Copyright &copy; 1999-"+year+",");
  else document.write("Copyright &copy; 1999,");
else
  if (year > 1999) document.write("<A HREF='/legal.html'>Copyright &copy; 1999-"+year+",");
  else document.write("<A HREF='/legal.html'>Copyright &copy; 1999,");

function getCookie(name) {
  var cookies = document.cookie;
  if (cookies.indexOf(name) != -1) {
    var startpos = cookies.indexOf(name)+name.length+1;
    var endpos = cookies.indexOf(";",startpos);
    if (endpos == -1) endpos = cookies.length;
    return unescape(cookies.substring(startpos,endpos));
    }
  else
    return false;
  }

