var dateString =  "";

function LastModDate(style)
{
	if (dateString != "") {
		return;
	}
	timeString = "hh:mm";
	dateString = "dd mmm yyyy";
	lastmod = document.lastModified;
	if (lastmod != "" && Date.parse(lastmod) != 0) {               // unknown date (or January 1, 1970 GMT)
		months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
		modDate= new Date(lastmod);
		modMonth=modDate.getMonth();	// 0...11
		dateString = modDate.getDate() + " " + months[modMonth] +" " + modDate.getFullYear();
		hr = modDate.getUTCHours();
		min = modDate.getUTCMinutes();
		lz = (min < 10) ? "0" : "";
		ampm = "am";
		if (hr == 0 && min == 0) {
			ampm = " midnight";
		}
		else if (hr == 12 && min == 0) {
			ampm = " noon";
		}
		else if (hr > 12) {
			hr -= 12;
			ampm = "pm";
		}
		timeString = hr + ":" + lz + min + ampm;
	}
/*
if (style==2) {
		doc.writeln("<center>Last Modified: " + dateString + " " + timeString +"</center>");
	}
	else if (style==1) {
		doc.writeln(dateString + " " + timeString);
	} 
	else {
		doc.writeln(dateString + "");
	}
*/
}

function doImage(up, name, width)
{
	path = up + "images/" + name + ".gif";
	doc.write("<img align=\"absbottom\" border=\"0\" width=\"" + width + "\" height=\"12\" src=\"" + path + "\">");
}

function mymail(up)
{
	a0="mailto:"; // but do it in hex
	a1="&#98;&#111;&#98;&#115;&#99;5";
	a2="verizon.net"; // but do it in hex
		
	doc.write("<a href=\"mailto:"+a1+"@"+a2+"\">");
	doImage(up, "e1t",55);doImage(up, "e2t",12);doImage(up, "e3t",76);
	doc.write("</a>");
}

function MadeOnMac(up) // up is "", "../", ",,/,,/" et cetera
{
	doc.write("<a href=\"http://www.apple.com\" target=\"_blank\">");
	doc.write("<img src=\"" + up + "images/MadeOnMac_blue.gif\" width=\"88\" height=\"31\" alt=\"Made on a Mac\">");
	doc.write("</a>");
}

function footer(up) // up is "", "../", ",,/,,/" et cetera
{
	breadcrumbs();
	footeronly(up);
}

function footeronly(up)
{
	doc.write("<div class=\"footer\">");
	doc.write("<table width=\"100%\" bgcolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">");
	LastModDate(0);
	doc.write("<tr><td align=\"left\" width=\"20%\">Last modified<br>" + dateString + "</td>");
	doc.write("<td align=\"center\">Bob Sander-Cederlof<br>");mymail(up);doc.write("</td>");
	doc.write("<td align=\"right\" width=\"20%\">");MadeOnMac(up);doc.write("</td>");
	doc.write("</tr></table>");
	doc.write("</div>");
}
var doc=document;

function framefooter(where, up) // up is "", "../", "../../" et cetera
{
	doc = where;
	footer(up);
}

function mtsc (com, nm1, nm2, isp) {
	var m1 = "<a href=\"mailto:" + nm1 + nm2; 
	var m2 = ";" + isp + "." + com  + "\">";
		document.write(m1 + "&#64" + m2 + "ema" + "il</a>");
}

function breadcrumbs()
{
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  sURL = location.href;
  // trim any form data that may follow the file name
  questionmark = sURL.indexOf("?");
  if (questionmark > 0) {
  	sURL = sURL.substr(0, questionmark);
  }
  bobscStart = sURL.indexOf("bobsc");
  chunkStart = sURL.indexOf("/", bobscStart);
  home = sURL.slice(0, chunkStart);
  var output = "<div class=\"crumbs\"><a href=\"" + home + "\">Home</a> :: ";
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a> :: ";
  }
  if (sURL == "index.html") {
  	sURL = "";
  }
  doc.write(output + sURL);
  doc.write("</div>");
}

