//  code by Alan Dix  © 2004   http://www.meandeviation.com/
//  you are free to use, copy, or distribute this code so long as this notice
//  is included in full and any modifications clearly indicated

function email_addr(name,host,isLink,otherName,subject) { //mod - added otherName for
	                                           //  when the link isn't the email address
                                                   // and optional subject variable
    var undefined;
	var email = name + "@" + host;
    var subj   = subject; // in format subject=text 
	if ( subj == undefined ) subj = "";
	if ( otherName == undefined ) otherName = "";
    if (  ! subj && otherName && otherName.match(/^subject=/) != null ) {
        subj = otherName;
        otherName = "";
    }
    if ( subj ) subj = "?" + subj;
    if (otherName)  { // mod - added this case
         isLink = 1; // must be live in this case  
         document.write("<a href=\"mailto:" + email + subj + "\">");
         document.write(otherName);
         document.write("</a>");
         document.close();
   }  else  {  //the rest is not modified
         if ( isLink ) document.write("<a href=\"mailto:" + email + subj + "\">");
         document.write(email);
         if ( isLink ) document.write("</a>");
         document.close();
   }
}
