//	JavaScript function to insert a "print page" link into the paragraph
//  element "print_nav"
function insertLinks() {
	// First test if the browser supports the DOM
	if (!document.getElementById) return true;
	if (!document.createElement || !document.createTextNode) return true;
	// Now confirm that the element "print_nav" exists
	if(document.getElementById("print_nav")) {
		var printnav = document.getElementById("print_nav");
		// Create a "spacer"
		var spacertext = " | ";
		var spacer = document.createTextNode(spacertext);
		printnav.appendChild(spacer);
		// Create a hyperlink ("a" element)
		var link1 = document.createElement("a");
		link1.setAttribute("href","#");
		link1.setAttribute("title","Print Timetable");
		// Now create the link text to display
		var link1text = document.createTextNode("Print Timetable");
		// Append the text to the link
		link1.appendChild(link1text);
		// Now append the link to the paragraph
		printnav.appendChild(link1);
		// Finally, set up the action to take on clicking the link
		link1.onclick = function() {
			window.print();
		}
	} else {
		return true;
	}
}
window.onload = function() {
	insertLinks();
}