/**************************************************************************
*E-mail Obfuscator
*Written by Jeff Painter
***************************************************************************
*This script does a very basic obfuscation of email addresses to hide them
*from email harvesters by:
*1)removing the address from the mailto links and plain text
*2)segregating the user and domain of the address
*3)segregating the functionality in a seperate javascript file.
*
*This solution is fragile and can be easily accounted for by email
*harvesters, but should protect from %99 of stupid harvesters.
***************************************************************************/
/*
	printAddress (boolean):
		(yes) will print a link with the email address as the text
		(no)no will print a link with the text "email"
	user (String):
		Username of email address
	domain (String):
		Domain of email address
	subject (String):
		What is printed to the subject line when you click on the mailto link
*/
function email(printAddress, user, domain, subject)
{
	  var address = user + '@' + domain;
	  
	  if(printAddress) {
		  return '<a href=\"mailto:' + address + '?subject=' + subject + '\">' + address + '</a>';
	  } else {
		  return '<a href=\"mailto:' + address + '?subject=' + subject + '\">email</a>';
	  }
}
/*Example HTML:
	<script type="text/javascript">
	  document.write(email(true, "info", "domain.com", "Query"));
	</script>
*/
