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) 	
	var blah;
	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.getAttribute('href'),'width=500,height=500','sem');
			return false; 	
			} 	
		}
	
		
		if (popuplinks[i].className == 'demopop') {
			// 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'),'width=520,height=770,scrollbars=yes','demo');
			return false;
			}
		}
		
		if (popuplinks[i].className == 'wpaper') {
			// 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('whitepaper.asp?id=f9c4405fcb16bd20012d865795ea6ec6ff77f71c19b85fa6048581d550f0b7970fb5d39b&doc='+this.getAttribute('title')+'&header=Interested%20in%20learning%20more%20about%20WaterTrax%20services%3F','width=550,height=600,scrollbars=yes','wpaper');
			return false;
			}
		}
		
	} 
} 

function openPopUp(linkURL,myDim,cls) {
window.open(linkURL,'popup'+cls,myDim)
}