// writes e-mail address link to output page
function writeEmailLink(mailserver, name, subject, linkContent) {
  hrefpart = "mailto:"

  link = hrefpart + name + "@" + mailserver;
  if (subject != "")
    link += "?subject=" + subject;

  //change the font face, color and size below

  document.write("<a href='"+link + "'>");
  if (linkContent != "") {
    document.write(linkContent);
    document.write("</a>");
  }
}

function writeEmailLinkEnd() {
 document.write("</a>");
}

function getElem(el)
{
  var element=document.getElementById(el);
  if(element){return element;}else{return false};
}

function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}

function switchDisplay(el, showTxt, hideTxt)
{
  var elm=getElem(el);
  var elmlink = getElem(el + 'link');

  if(elm){
    var DISPLAY=getStyle(el,'display');
  if(DISPLAY=='block')
    {elm.style.display='none';elmlink.innerHTML=showTxt;}
  else
    {elm.style.display='block';elmlink.innerHTML=hideTxt;}
  }
}

