var ie = document.all;
var ns = document.layers;

blank="&"+"nbsp;"

// Simulate "document.getElementById" for older browsers
if(document.all && !document.getElementById)
{
  document.getElementById = function(id)
  {
    return document.all[id];
  }
}

var days = new Array(8);
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
var dateObj = new Date(document.lastModified)
var wday = days[dateObj.getDay() + 1]
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
if (fyear <2000) fyear = fyear + 1900

function lastmodified()
{
  document.write("Last modified: " + lmonth + " " + date + ", " + fyear)
}


function contact(userid,siteid,linktext)
{
  document.write("<a class='contact' href='ma"+"ilto:"+userid+"&#64;"+siteid +"'>");
  document.write(linktext+"</a>");
}

function play(tune)
{
  alert (tune)
}

// Table generation routines

function tabletop(theID)
{
  document.write ("<table id='"+theID+"' style='width:100%' cellspacing='0'>")
}

function tablebottom()
{
  document.write ('</table>')
}

// Gigs

function month(themonth)
{
  document.write("<tr><td colspan=2><h4>"+themonth+"</h4></td></tr>");
  oddrow=false;
}

function gig(thedate,thetime,thevenue,addinfo,phoneno,postcode)
{

// http://uk2.multimap.com/map/browse.cgi?pc=BH149JH&scale=50000&mapsize=big
// http://maps.google.co.uk/maps?q=DT2+9PD&z=11

  style=(oddrow)?"oddrow":"evenrow";
  oddrow=(!oddrow);

//  tablerow="<tr class='"+style+"'>"+
//           "<td width='18%'>"+thedate+"<br/>"+thetime+
//           "</td><td width='66%'>"+mapref+"<br/>"+addinfo+
//           "</td><td width='16%'>"+phoneno+"</td></tr>";

  mapref=(postcode!=blank)?"<a target='_blank' href='http://maps.google.co.uk/maps?q=\""+thevenue.replace("'","&#39;")+"\" "+postcode+"&z=11'>"+thevenue+"</a>":thevenue;

  tablerow="<tr class='"+style+"'>"+
           "<td valign='top' width='20%'>"+thedate+"<br/>"+thetime+
           "</td><td valign='top' width='80%'>"+mapref+"<br/><i>"+addinfo+"</i><br/> "+phoneno+"</td></tr>";
             
  document.write(tablerow);
}


// Gets rid of ugly dots around link images
  function RemoveDot()
  {
    for (a in document.links) document.links[a].onfocus = document.links[a].blur;
  }
  if (ie){document.onmousedown = RemoveDot}
