//function to add scripts when the page loads
//This function was written by Simon Willison - http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
	//This stores the existing window.onload as a variable.
  var oldonload = window.onload;
	//If there isn't already function attached, this adds the new function.
  if (typeof window.onload != 'function') 
		{
    window.onload = func;
  	}
	//If a function is already attached, this adds the new function afterwards. 
	else 
		{
    window.onload = function() {
      			if (oldonload) 
						{
        		oldonload();
      			}
      func();
    	}
  	}
}


//function to say when the page was last modified
//This script is adapted from a free script from http://javascript.internet.com
function pagemodified()
{
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
//Create a message saying when the page was last modified
var message = "This page was last modified: " + wday + " " + date + " " + lmonth + " " + fyear

//Create a paragraph to put the message into
var modifiedpara = document.createElement("p");
modifiedpara.setAttribute("class","modified");
//Put the message in the paragraph
var paratext = document.createTextNode(message);
modifiedpara.appendChild(paratext);
//Insert the paragraph into the footer, before the bumf text at the bottom
var footer = document.getElementById("footer");
var bumf = document.getElementById("bumf");
footer.insertBefore(modifiedpara,bumf);

}

addLoadEvent(pagemodified);

//Pop up window function
function popUp(winURL) {
	window.open(winURL, "popup", "width=750,height=531");
}

