// Created by Shane Rushik June 2003
////////////////////////////////////////////////////////////////////
// This function returns the provided email address to be written in HTML
// Leave 'DisplayText' empty to display the email address on the page
// Otherwise, the function will return the MailTo URL with the provided 
// Text highlited as a link
// The code to call this function follows:
//------------------------------------------------------------------
//		<script language="JavaScript">
//		  <!-- Begin
// 		    document.write(cloakemail('info');
// 		  // End -->
//		</script>
//
// --- OR . . . ----------------------------------------------------
//
//		<script language="JavaScript">
//		  <!-- Begin
// 		    document.write(cloakemail('info','Click here to Email us'));
// 		  // End -->
//		</script>
//------------------------------------------------------------------
// The above function will write the address info@companyname.com on the web page
////////////////////////////////////////////////////////////////////

function cloakemail(user,DisplayText){

    // use ascii characters for "MAILTO:" to hide from spiders
    var asciiMAILTO = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;"; //-- Ascii for 'mailto:'
    var asciiCOM    = "c&#111;m"; //-- Ascii for 'com'
    var asciicats   = "&#99;hi&#108;&#105;c&#97;&#116;s"; //-- ASCII for 'chilicats'
    var domain      = asciicats + "." + asciiCOM;

     // if DisplayText is empty, combine user & domain with ascii character for "@"
    if (DisplayText == null || DisplayText== "" ){ DisplayText = user +'&#64;' + domain;}

    return '<a href="' + asciiMAILTO + user + '&#64;' + domain + '">' + DisplayText + '</a>';
}

function disguiseemail(user,DisplayText){

    // use ascii characters for "MAILTO:" to hide from spiders
    var asciiMAILTO = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;"; //-- Ascii for 'mailto:'
    var asciiCOM    = "c&#111;m"; //-- Ascii for 'com'
    var asciicats   = "&#99;hi&#108;&#105;c&#97;&#116;s"; //-- ASCII for 'chilicats'
    var domain      = asciicats + "." + asciiCOM;

    // if DisplayText is empty, combine user & domain with ascii character for "@"
    if (DisplayText == null || DisplayText== "" ){ DisplayText = user +'&#64;' + domain;}

    return DisplayText;
}


