// gen_exec.js - Javascript code used by SouthBayMobilization, 7/18/07
// - Read-Only - (unused code removed)
//
// Functions defined here:
// -----------------------
// 1. genClickableEmailAddressWithBR( domainNameSuffix, domainName, frontName )
//    - Call this to create an email address dynamically (and foil the web robots).
//      This creates the "mailto:" part and also inserts a "<br>" after
//      the 'frontName' and before the (at) sign, for a long email address.
//    - Call this to just create an email address dynamically (and foil the web robots).
// 2. genClickableEmailAddress( domainNameSuffix, domainName, frontName )
//    - Call this to create an email address dynamically (and foil the web robots).
//      This creates the "mailto:" part.
// 3. genEmailAddress( domainNameSuffix, domainName, frontName )
// 4. genClickableContactEmailAddr() - Calls genClickableEmailAddress() with
//      the hardcoded contact email address to generate the "mailto:" part.
// 5. genContactEmailAddr() - returns the string of the hardcoded contact email address.

//------[ Globals ]----------------------------------------------


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function genClickableEmailAddressWithBR( domainNameSuffix, domainName, frontName )
{
// Example call:
// genClickableEmailAddress( "org", "southbaymobilization", "info" );
//
// Example code generated:
// <a href="mailto:info@southbaymobilization.org"><strong>info@SouthBayMobilization.org</strong></a>

  var emailAddress = frontName + "&#64" + domainName + "." + domainNameSuffix;
  var emailAddressWithBR = frontName + "&#64" + "<br>" + domainName + "." + domainNameSuffix;
  document.write( "<a href=\"mailto:" + emailAddress + "\">" + emailAddressWithBR + "</a>" );
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function genClickableEmailAddress( domainNameSuffix, domainName, frontName )
{
// Example call:
// genClickableEmailAddress( "org", "southbaymobilization", "info" );
//
// Example code generated:
// <a href="mailto:info@southbaymobilization.org"><strong>info@SouthBayMobilization.org</strong></a>

  var emailAddress = frontName + "&#64" + domainName + "." + domainNameSuffix;
  document.write( "<a href=\"mailto:" + emailAddress + "\"><strong>" + emailAddress +"</strong></a>" );

}


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function genEmailAddress( domainNameSuffix, domainName, frontName )
{
// Example call:
// genEmailAddr( "org", "southbaymobilization", "info" );
// The string returned consists of the following.
//     "info@southbaymobilization.org"

  var emailAddress = frontName + "&#64" + domainName + "." + domainNameSuffix;

  return( emailAddress );
}


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function genClickableContactEmailAddr()
{
// Example call:
// genClickableContactEmailAddress();

  genClickableEmailAddress( "org", "sbm4peace", "activist" );

}


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function genContactEmailAddr()
{
// Example call:
// genContactEmailAddress();

  var emailAddress = "";

  emailAddress = genEmailAddress( "org", "sbm4peace", "activist" );

  return( emailAddress );
}



