var newWin;
function enlargeWindow (src,width,height,title) {
  wSize=width+20;
  hSize=height+20;
  if (newWin) {newWin.close(); newWin=null;}
  newWin=window.open('','enlarged',
	  'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,'+
	  'width='+wSize+',height='+hSize);
  newWin.document.open();
  newWin.document.write("<html><body><title>"+title+"</title></head><body>");
  newWin.document.write('<img src="'+src+'" alt="'+title+'" height="'+height+'" width="'+width+'" />');
  newWin.document.write("</body></html>");
  newWin.document.close();
  newWin.focus();
//  }
}

function format_date(aDate) {
	return formatDate(aDate);
}

function formatDate(aDate) {
  var months = new Array ('Jan','Feb','Mar','Apr','May','Jun','Jul',
             'Aug','Sep','Oct','Nov','Dec');						 
  var d=new Date(Date.parse(aDate));
	var result = false;
  if (d!=0) {
    mon=months[d.getMonth()];
    h=d.getHours();
    h=h.toString();
    if (h.length < 2) h='0'+h;
    m=d.getMinutes();
    m=m.toString();
    if (m.length < 2) m='0'+m;
    result=d.getFullYear()+'-'+mon+'-'+d.getDate()+' '+h+':'+m;;
	}
  return result;
} // formatDate

function gemaddr( node, domain, local) {
  var a = String.fromCharCode(64);
  var mt = String.fromCharCode(109,97,105,108,116,111,58);
  node.href = mt + local + a + domain;
  return true;
}

function last_update() {
	var d=new Date(Date.parse(document.lastModified));
	document.write("Last update: "+formatDate(d));
    return true;
} // last_update

function lastUpdate() {
	var d=new Date(Date.parse(document.lastModified));
	document.write("Last update: "+formatDate(d));
    return true;
} // lastUpdate


function mod_date(url) {  // Uses XMLHttpRequest to get file mod date...
  var req = false;
  var d = false;
  if(window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if(window.ActiveXObject) {
  	req = new ActiveXObject("Msxml2.XMLHTTP");
  }
  req.open("GET", url, false);  // Synchronous... beware!
  req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 1971 00:00:00 GMT");
  req.send(null);
  if(req.status == 200) {
    last_mod = req.getResponseHeader("Last-Modified");
    d=new Date(Date.parse(last_mod));
  } 
  return d;
}

function when_printed() {
	document.write('Printed on ', formatDate(Date()), ' from ', window.location);
	return true;
} // when_printed

function when_printed_string() {  // used with XSLT and Firefox, where document.write fails...
	return 'Printed on ' + format_date(Date()) + ' from ' + window.location;
} //when_printed_string