//
// De-jumble email addresses
//
function decryptemail() {
   var pattern = /^mail:([^:]+):([^\?]+)(\?.+)?$/i;
   var elms = document.getElementsByTagName("A");
   for (var i=0;i<elms.length;i++) {
      var elm=elms[i];
		var str = new String(elm.href);
		if (str.match(pattern)) {
		   elm.href = str.replace(pattern,"mailto:$2@$1$3");
		   if (elm.hasChildNodes) {
		      var node=elm.childNodes[0];
		      if(node.nodeValue) node.nodeValue = node.nodeValue.replace(pattern,"$2@$1");
		   }
		}
	}
}
//
// Function to create a popup window
//
var popupwin=null;
function popup(url,options) {
   if (!options) options="width=610,height=500,scrollbars=yes,resizable=yes";
   popupwin = window.open(url,"popupwin",options);
   popupwin.focus();
   return false;
}

//
// Toggle layer on/off
//
function toggleFeature(elm) {
   var currobj=document.getElementById(currfeature);
   currfeature = elm;
   var obj=document.getElementById(currfeature);
   if (currobj) currobj.style.display = "none";
   if (obj) obj.style.display="";
   return false;
}