// 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"...	
		if (popuplinks[i].getAttribute("class") == "popup_bl") {	
			// 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.getAttribute("href"));	
			return false; 	
			} 	
		}
		if (popuplinks[i].getAttribute("class") == "popup_small") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUpSmall(this.getAttribute("href"));	
			return false; 	
			} 	
		}
		if (popuplinks[i].getAttribute("class") == "popup_med") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUpMed(this.getAttribute("href"));	
			return false;
			} 	
		}
		if (popuplinks[i].getAttribute("class") == "port-image") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUpPort(this.getAttribute("href"));	
			return false;
			} 	
		}
	} 
} 

function openPopUp(linkURL) {

myWindow = window.open(linkURL,'popup_bl','width=850,height=550')
myWindow.document.bgColor="black"
myWindow.document.close() 
}
function openPopUpSmall(linkURL) {

myWindow = window.open(linkURL,'popup_bl','width=425,height=285')
myWindow.document.bgColor="black"
myWindow.document.close() 
}
function openPopUpMed(linkURL) {
myWindow = window.open(linkURL,'popup_bl','width=445,height=285')
myWindow.document.bgColor="black"
myWindow.document.close() 

}
function openPopUpPort(linkURL) {
myWindow = window.open(linkURL,'popup_bl','width=800,height=600')
myWindow.document.bgColor="black"
myWindow.document.close() 

}
