
function buildaddr(user,domain,link) {
domain	= domain.replace( /[\s,]+/g, "." );						// convert space or , to .
user	= user.replace( /\s/g, "" );							// remove spaces in user name
if (!/\.\w{2,3}$/.test(domain)) { domain = domain + '.com' }	// appends .com if omitted
var fulladdr = user + "@" + domain;
if (!link) { link = fulladdr }									// if no link name specified, use address
document.write('<a href="mailto:' + fulladdr + '">' + link + '</a>')
};

