function popup() {
	// 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 anchor tag
	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"));
				return false; 	
			} 	
		}
	} 
}
function openPopUp(linkURL) {
	window.open(linkURL,'popup');
}

function hideems(div,status) {
	if (status == 1) {
		status = "block";
	} else {
		status = "none";	
	}
	if (document.all) {
		document.getElementById(div).style.display = status;
	} else if (document.getElementById) {
		document.getElementById(div).style.display = status;
	}
}

function showems(div,status) {
	if (status == 1) {
		status = "none";
	} else {
		status = "block";	
	}
	if (document.all) {
		document.getElementById(div).style.display = status;
	} else if (document.getElementById) {
		document.getElementById(div).style.display = status;
	}
}

function emailCloak() {
	if (document.getElementById) {
		var alltags = document.all? document.all : document.getElementsByTagName("*");
		for (i=0; i < alltags.length; i++) {
		  if (alltags[i].className == "emailCloak") {
			var oldText = alltags[i].firstChild;
			var emailAddress = alltags[i].firstChild.nodeValue;
			var user = emailAddress.substring(0, emailAddress.indexOf("("));
			var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
			var newText = user+"@"+website;
			var a = document.createElement("a");
			a.href = "mailto:"+newText;
			var address = document.createTextNode(newText);
			a.appendChild(address);
			alltags[i].replaceChild(a,oldText);
		  }
		}
	}
}
window.onload = emailCloak;

function deadlink() {
	if (document.getElementById) {
		var alltags = document.all? document.all : document.getElementsByTagName("*");
		for (i=0; i < alltags.length; i++) {
		  if (alltags[i].className == "dead") {
			var linkTitle = alltags[i].firstChild.nodeValue;
			//var user = emailAddress.substring(0, emailAddress.indexOf("("));
			//var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
			//var newText = user+"@"+website;
			//var a = document.createElement("a");
			//a.href = "mailto:"+newText;
			//var address = document.createTextNode(newText);
			//a.appendChild(address);
			alltags[i].replaceChild(linkTitle,parentNode);
		  }
		}
	}
}