﻿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 linklists = document.getElementsByTagName("select");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < linklists.length; i++) {	
		// if the link has a class of "popup"...
		if (linklists[i].className == "links") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			linklists[i].onchange = function() {
			openPopUp(this.options[this.selectedIndex].value);	
			return false; 	
			} 
		}
	} 
} 

function openPopUp(linkURL) {
	if(linkURL && linkURL != '')
		window.open(linkURL,'popup','width=770,height=500,scrollbars=yes,resizable=yes,toolbar=yes')
}