/* Tararua Tramping Club Copyright 2003 */
/* Last Updated */
// 2003 Nov 21 Added joinYahooGroup, mailToTararua
// 2003 Jun 05 SED Initial version. writeDate, writeTime, lastUpdated, mailToAddress
function writeDate (outDate)
{
var daylit = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
// can't make correct day display for IE4!
var mnlit = new Array("Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec");
//document.writeln ('writeDate ',outDate);
if (outDate>0) {
  var yr=outDate.getYear();
  var mn=outDate.getMonth();
  var dy=outDate.getDate();
  var day=outDate.getDay();
// cater for variations in the way browsers handle dates!
    if (yr>=100 && yr<=999) yr-=100;
    if (yr<1000) yr+=2000;
// partially tested for Netscape and Explorer
  document.write (' ', yr,' ',mnlit[mn],' ',dy);
  }
}
//
function writeTime (outTime)
{
if (outTime>0) {
  var hr=outTime.getHours();
  var minute=outTime.getMinutes();
  document.write (' ', hr,':',minute);
  }
}
//
function lastUpdated ()
{
var lm=Date.parse(document.lastModified);
var dlm=new Date (lm);
document.writeln('<div class="modified" align="right">Updated ');
writeDate (dlm);
writeTime (dlm);
document.writeln('</div>');
}
//
function mailToAddress (emailName,emailAddress,subJect,linkName)
{
document.write ('<a href="mailto:', emailName, '&#64;', emailAddress);
if (subJect != '') {
  document.write ('?subject=', subJect);
  }
document.write ('">', linkName, '</a>');
}
//
function mailToTTC (emailName,subJect,linkToName)
{
  var linkName = '';
switch (arguments.length) {
  case 1 : subJect = '';
  case 2 : linkName = emailName;
           break;
  default: linkName = linkToName;
  }
mailToAddress (emailName,'ttc&#46;org&#46;nz',subJect,linkName);
}

function joinYahooGroup (groupName, groupDesc) 
{
document.writeln('<form method=GET action="http://groups.yahoo.com/subscribe/"', groupName, '>');
document.writeln('<table cellspacing=0 cellpadding=2 border=0 bgcolor=#FFFFCC>');
document.writeln('  <tr><td align=center><b>Subscribe to <a href="http://groups.yahoo.com/group/', groupName, '/">', groupName, '</a> email list</b></td>');
document.writeln('    <td rowspan="3">');
document.writeln('      <input type=image border=0 alt="Click here to join "', groupName);
document.writeln('       name="Click here to join ', groupName, '" src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/ui/join.gif">');
document.writeln('    </td>');
document.writeln('  </tr>');
document.writeln('  <tr>');
document.writeln('    <td><input type=text name="user" value="enter email address" size=30 maxlength=60></td>');
document.writeln('  </tr>');
document.writeln('  <tr align="right"><td><small><small>Powered by <a href="http://groups.yahoo.com/">groups.yahoo.com</a></small></small></td></tr>');
document.writeln('  <tr align="left"><td colspan="2"><small><small>', groupDesc, '</small></small></td></tr>');
document.writeln('</table>');
document.writeln('</form>');
}

function mailToTararua () {
document.writeln('mailto:Tararua&#64;ttc&#46;org&#46;nz')
}

im1 = new Array();
im0 = new Array();
b = new Array();
b[0] = "home";
b[1] = "intro";
b[2] = "activ";
b[3] = "tues";
b[4] = "fixt";
b[5] = "facil";
b[6] = "cont";
b[7] = "pics";
b[8] = "new";
b[9] = "huts";
b[10] = "join";
b[11] = "trip";
b[12] = "pubs";
b[13] = "link";
b[14] = "mail";
for (x = 0; x < b.length; x++) {
  im1[x] = new Image();
  im1[x].src = "/gfx/b/b_" + b[x] + "1.gif";
  im0[x] = new Image();
  im0[x].src = "/gfx/b/b_" + b[x] + "0.gif";
}
function hi(i) {
 document ["n" + i].src = im1[i].src;
}
function lo(i) {
 document ["n" + i].src = im0[i].src;
}


