// NavBar.js - Club tread navigation bar and JavaScript functions

function checknew(date) {
	var pic = "new.gif";
	expdate = new Date(date);
	curdate = new Date();
	if (expdate.getTime() > curdate.getTime())
	document.write("<img src=" + pic + " Align=Top Width=25 Height=9>");
}

function chgPict(direction) {
	if (document.images) {
		thisPic = thisPic + direction
		if (thisPic > imgCt) {
			thisPic = 0
		}
		if (thisPic < 0) {
			thisPic = imgCt
		}
		document.Picture.src=PicList[thisPic]
	}
}

function dow(dayno)
{
    switch(dayno)
    {
        case 0:
            return 'Sunday';
        case 1:
            return 'Monday';
        case 2:
            return 'Tuesday';
        case 3:
            return 'Wednesday';
        case 4:
            return 'Thursday';
        case 5:
            return 'Friday';
        case 6:
            return 'Saturday';
    }
}

function ema(addr, domain, tooltip) {
	t = "<a href=\"&#109;&#097;&#105;&#108;" + "&#116;&#111;:" + addr + "@" + domain + "\"";
	if (tooltip) { t = t + " title=\""+tooltip+"\""; }
	document.writeln(t+ ">");
}

function lastupdated() {
      var lmd = new Date(document.lastModified);
	document.writeln("<p><center><i>");
  	var m = "Page updated " + dow(lmd.getDay()) + ", " + month(lmd.getMonth()) + " " + lmd.getDate() + ", " + lmd.getFullYear();
	document.write(m);
	m = "</i><br />Copyright &copy; " + lmd.getFullYear() + " Victoria Club Tread.  All rights reserved.";
	document.write(m);
	document.writeln("</center>");
}

function month(monthnum) {
      switch(monthnum)
      {
        case 0:
            return 'January';
        case 1:
            return 'February';
        case 2:
            return 'March';
        case 3:
            return 'April';
        case 4:
            return 'May';
        case 5:
            return 'June';
        case 6:
            return 'July';
        case 7:
            return 'August';
        case 8:
            return 'September';
        case 9:
            return 'October';
        case 10:
            return 'November';
        case 11:
            return 'December';
    }
}

function navbar(addnl1){
	document.write('<div class="clubname"><table><tr><td align="left" width="10%"><a href="index.php"><img border=0 src="home.gif"></a></td><td Width="90%" VAlign="Middle"><h1 class="clubname">Victoria Club Tread</h1></td></tr></table></div>');
	document.write('<a href="index.php"><img alt="[Club Tread Homepage]" src="homebutn.gif" width="150" height="35"></a>');
	document.write('<a href="schedule.php"><img alt="Club Tread Schedule" src="schdbutn.gif" width="150" height="35"></a>');
	document.write('<a href="trips.htm"><img alt="[Destinations]" src="tripbutn.gif" width="150" height="35"></a>');
	if (addnl1 == "Link") { document.write('<a href="links.php"><img src="links.gif" alt="Links to other sites" width="150" height="35"></a><br><a href="http://www.wedohosting.com/"><img src="wdh_banner01.gif"></a>'); }
	if (addnl1 == "XCSki") { document.write('<a href="xcskiref.htm"><img alt="[Cross country ski info]" src="xcski.gif" width="150" height="35"></a>'); }
	if (addnl1 == "KeepTrack") { document.write('<a href="keeptrak.htm"><img alt="[Keeping Track" src="keepingtrack.gif" width="150" height="35"></a>'); }
	document.write('<hr/>');
}

function ViewPicture() {
	return URLList[thisPic]
}
