function htmlAppendParm(htmlParms, nextParm)
	{
	if (nextParm == null)
		{
		return(htmlParms)
		}
	else
		{
		if (htmlParms == null)
			{
			return('?' + nextParm)
			}
		else
			{
			return(htmlParms + '&' + nextParm)
			}
		}
	}

function printEmail(user,domain,htmlDisplay,subject,cc,bcc,mailBody)
	{
	mail_to_parms = '' // Seed
	
	if (subject != null)
		{
		subject = 'subject=' + subject
		}
	mail_to_parms = htmlAppendParm(mail_to_parms, subject)
	
	if (cc != null)
		{
		cc = 'cc=' + cc
		}
	mail_to_parms = htmlAppendParm(mail_to_parms, cc)
	
	if (bcc != null)
		{
		bcc = 'bcc=' + bcc
		}
	mail_to_parms = htmlAppendParm(mail_to_parms, bcc)
	
	if (mailBody != null)
		{
		mailBody = 'body=' + mailBody
		}
	mail_to_parms = htmlAppendParm(mail_to_parms, mailBody)

	if (htmlDisplay == null)
		{
		htmlDisplay = user+'@'+domain
		}
	
	document.write('<a href="mailto:'+user+'@' + domain + mail_to_parms + '">'+ htmlDisplay +'</a>');
	
	}
