function sendmail(zarma_tmp_address) {
	zarma_tmp_address = zarma_tmp_address.split("##");
	zarma_tmp_address = zarma_tmp_address.join("@");
	window.open ('mailto:'+zarma_tmp_address,'_blank');
}
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 doPopups() {
	if (!document.getElementsByTagName) return false;
		var links=document.getElementsByTagName("a");
		for (var i=0; i < links.length; i++) {
			if (links[i].className.match("popup")) {
				links[i].onclick=function() {
				//alert("trigger");
				window.open(this.href, 'provider'); return false;
			}
		}
	}
}


function doVidPopups() {
	if (!document.getElementsByTagName) return false;
		var links=document.getElementsByTagName("a");
		for (var i=0; i < links.length; i++) {
			if (links[i].className.match("vidpop")) {
				links[i].onclick=function() {
				//alert("trigger");
				window.open(this.href, 'provider'); return false;
			}
		}
	}
}
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 of these links (anchor tags)
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...	
		if (popuplinks[i].className == "popup2") {
			// add an onclick event on the fly to pass the href attribute	
			// of the link to a new window command
			popuplinks[i].onclick = function() {
				window.open(this.href, 'extra', 'width=640,height=480,resizable=yes,scrollbars=no,location=no,status=no,menubar=no');
				return false; 	
			} 	
		}
	} 
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		 window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

addLoadEvent(popup);