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 popupvideo = document.getElementsByTagName("a");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popupvideo.length; i++) {	
		// if the link has a class of "popup"...	
		if (popupvideo[i].className == "popupvideo") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popupvideo[i].onclick = function() {	
			openPopUpVideo(this.getAttribute("href"));	
			return false; 	
			} 	
		}
	} 
} 

function openPopUpVideo(linkURL) {
window.open(linkURL,'popup','status=0,toolbar=0,titlebar=0,scrollbars=0,width=508,height=460')
}