//Accessible javascript popup script
//ripped off from http://www.openhosting.co.uk/articles/webdev/5918/
//added code to center popup on screen

window.onload = function() {
	// check to see that the browser supports the getElementsByTagName method
	// if not, exit the loop 
	if (!document.getElementsByTagName) {
		return false; 
	} 
	// create an array of objects of each link in the document 
	var popuplinks = document.getElementsByTagName("a");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...	
		if (popuplinks[i].className == "popup") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUp(this.href);	
			return false; 	
			} 	
		}
	} 
} 

function openPopUp(linkURL) {
	var width = 585;
	var height = 738;
	var screenX = screen.width/2 - 585/2;
	var screenY = 50;
window.open(linkURL,'popup','menubar=no,width='+width+',height='+height+',toolbar=no,screenX='+screenX+',screenY='+screenY)
}