// JavaScript Document

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"...	
		
		attachPopUp("popup",1000, 650, popuplinks[i]);
		attachPopUp("amie_st",520, 350, popuplinks[i]);
		attachPopUp("view_book",610, 510, popuplinks[i]);
	
	} 
} 

function attachPopUp(type, w, h, popuplinks) {	
	if (popuplinks.getAttribute("class") == type) {	
		// add an onclick event on the fly to pass the href attribute	
		// of the link to our second function, openPopUp 	
		popuplinks.onclick = function() {	
			openPopUp(this.getAttribute("href") , w, h);	
			return false; 	
		} 	
	}	
}

function openPopUp(linkURL, w, h) {
	window.open(linkURL,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=' +  w + ',height=' + h)
}


