function init(){
}

function showHeader(){
  document.write("<table cellpadding=5 cellspacing=0 border=0 bgcolor='#ffffff' width=420><tr><td>");

}
function showFooter(){
  //document.write("<hr class='footerdivider'>");
	//document.write("<table cellpadding=0 cellspacing=0 border=1><tr><td class=\"automenu\">&nbsp;</td><td class=\"automenu\">");  
	document.write(getMenuHTML());
	//document.write("</td><td class=\"automenu\" valign=\"bottom\">");
	// search 
	document.write("<div align=\"right\">");

	//Google form	
	//document.write("<form name=\"cse\" id=\"searchbox_demo\" action=\"http://www.google.com/cse\">");
  //document.write("<input type=\"hidden\" name=\"cref\" value=\"\" />");
  //document.write("<input name=\"q\" type=\"text\" size=\"40\" />");
  //document.write("<input type=\"submit\" name=\"sa\" value=\"Search\" />");
	//document.write("</form>");
	//document.write("<script type=\"text/javascript\" src=\"http://www.google.com/cse/tools/onthefly?form=searchbox_demo\"></script>");
	// /end Google form
	
	// freefind form - seems to have stopped indexing.
	//	document.write("<FORM ACTION=\"http://search.freefind.com/find.html\" METHOD=\"GET\"  target=\"_self\"><INPUT TYPE=\"HIDDEN\" NAME=\"id\"  VALUE=\"2119178\" size=\"-1\"><INPUT TYPE=\"HIDDEN\" NAME=\"pageid\" VALUE=\"r\" size=\"-1\"><INPUT TYPE=\"HIDDEN\" NAME=\"mode\" size=\"-1\" VALUE=\"ALL\"><INPUT type=\"HIDDEN\" name=\"t\" value=\"s\" size=\"-1\"><INPUT TYPE=\"TEXT\" NAME=\"query\" SIZE=\"15\"><INPUT TYPE=\"SUBMIT\" VALUE=\"Find\"></FORM>");
	document.write("</div>");
  document.write("<p class='maintainedby'>Maintained by <a href='mailto:neale@nealemorison.com'>Neale Morison</a></p>");
  document.write("</td></tr></table>");

}

function showModified(){
  document.write("<p class='lastmodified'>Last modified: " + displayDate(document.lastModified) + "</p>");
  document.write("</td></tr></table>");
}
function displayDate(pDate){
  milsec = Date.parse(pDate)
  if (milsec != 0) 
  {
  	mon = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  	moddate = new Date(milsec);
  	day = moddate.getDate();
  	month = mon[moddate.getMonth()];
  	year = moddate.getYear();
  	displayyear = year<90?year+2000:year<1990?year+1900:year;
  	dateStr = day+" "+month+" "+displayyear;
    return dateStr;
  }
}
function getMenuHTML(){
  menuList = new Array();
  i=0;
  // Edit the array initialisation below to edit the menu that appears on all pages
  //array elements : label, link, target
  menuList[i] = new Array ("Home", "index.html", "_top");i++;
  menuList[i] = new Array ("Site map", "sitemap.htm", "");i++;
  
  menuHTML = "<div class='pageexternalmenu'><table class='menutable1'><tr>";
  dirLevelPrefix = getDirLevelPrefix();
  for(i=0;i<menuList.length;i++){
    menuItem = menuList[i];
    menuHTML += "<td>&nbsp;</td><td class='menutable1cell'><a href='"+dirLevelPrefix+menuItem[1]+"' target='"+menuItem[2]+"'>"+menuItem[0]+"</a></td>";
  }
  menuHTML += "</tr></table></div>";
  return menuHTML;
}
function getDirLevelPrefix(){
// this function expects dirLevel to be defined in the page
// dirLevel is an integer: 1 for top level, 2 for 1 level down from top and so on. Defaults to top level
 dirLevelPrefix="";
  if (typeof(dirLevel) != "undefined") {
    for (i=1;i< dirLevel;i++){
      dirLevelPrefix += "../"
    }
  } else {
  }
  return dirLevelPrefix;

}
