/*
	A simple close window function written so that we don't have to include 'onclick' events in the HTML code.
	Just add an id attribute with the value 'closeWindow' to the appropriate link or input element in relevant page(s) and include the script in the head section of the page.
	
	If multiple window-closing elements were needed, it would be easy enough to rewrite this so that it relied on class names instead of the id. In the closeWindowInit() function, you'd have to do the following:
	
	// Assume the class name we're looking for is 'closeWindow'.
	
	var closeWindowLinks = document.getElementsByTagName('a);
	var closeWindowInputs = document.getElementsByTagName('input');
	
	for(var i=0;i<closeWindowLinks.length;i++) {
		if (closeWindowLinks[i].className == 'closeWindow') {
			closeWindowLinks[i].onclick = closeWindow;
		}
	}
	
	for(var j=0;j<closeWindowLinks.length;j++) {
		if (closeWindowInputs[i].className == 'closeWindow') {
			closeWindowInputs[i].onclick = closeWindow;
		}
	}
	
*/


function test() {
	alert('Working!;');
}

// The main function:
//
function closeWindowInit() {
	// Get the window-closing element:
	var closeWindowElement = document.getElementById('closeWindow');
	// Set up a function call for when the element is clicked:
	closeWindowElement.onclick = closeWindow;
}

// The function that actually closes the window:
//
function closeWindow() {
	// Close the window :-)
	window.close();
}

// Assign the init function to the onload event of the window object:
window.onload = closeWindowInit;