// hide_email.js
// Hide your email address from spammers!
// Adopted from:  http://www.the-web-agent.com/spam.html
//
// Used to prevent City of Bedford email addresses from
// being harvested by data-mining robots that traverse the internet.
//
// Recommended Use - 
// Insert the below into every template in your site (in the header section)
// <script language="JavaScript" src="hide_email.js"><!-- Script to unscramble email address --></script>
//
// Use the below line every time you need to insert an email address, 
// in lieu of a regular email link...
// <script language="Javasource" type="text/JavaScript">Convert2Email('ci.bedford.tx.us', 'userid', 'link text');</script>
//
// If you do not wish to use any special text for the link, then use this line...
// <script language="Javasource" type="text/JavaScript">Convert2Email('ci.bedford.tx.us', 'userid', '');</script>
// and the link will display as the actual email syntax (i.e. jdoe@domain.com)


// Actual code below - DO NOT CHANGE
function Convert2Email(Domain, User, Show){ if ((Show.length == 0) || (Show.indexOf('@')+1)) { document.write("<A HREF=" + "'mail" + "to:" + User + "@" + Domain + "'>" + User + "@" + Domain + "</A>"); }
else {document.write("<A HREF=" + "'mail" + "to:" + User + "@" + Domain + "'>" + Show + "</A>"); }} 