/* Writes email as link */
function getEmailLink(p1,p2,p3,style,styleClass,label,subject) {
  var link = "<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;&#58;" + p1;

  if (typeof(p2) != "undefined" && p2 != '' &&
      typeof(p3) != "undefined" && p3 != '') {

	if (typeof(subject) != "undefined" && subject != '') {
		link += "&#64;" + p2 + "&#46;" + p3 + "?subject=" + subject + "\"";
	} else {
		link += "&#64;" + p2 + "&#46;" + p3 + "\"";
	}
  }
  else {
   link += "\"";
  }

  if (typeof(style) != "undefined" && style != '') {
    link += " style=\"" + style + "\"";
  }
  if (typeof(styleClass) != "undefined" && styleClass != '') {
    link += " class=\"" + styleClass + "\"";
  }



  if (typeof(label) != "undefined" && label != '') {
    link += ">" + label + "</a>";
  } else if (typeof(p2) != "undefined" && p2 != '' &&
             typeof(p3) != "undefined" && p3 != '') {
    link += ">" + p1 + "&#64;" + p2 + "&#46;" + p3 + "</a>";
  }
  else {
   link += ">" + p1 + "</a>";
  }
  document.write(link);
}

/* Writes email as text */
function getEmailTxt(p1,p2,p3) {
  var txt = p1;
  if (typeof(p2) != "undefined" && p2 != '' &&
      typeof(p3) != "undefined" && p3 != '') {
    txt += "&#64;" + p2 + "&#46;" + p3;
  }
  document.write(txt);
}
