// De-SPAM tool
// by JMD 20040813
// Based on idea by PayPalHelper
//
// To use:
// 1. Add this file to the directory of your html files.
// 2. Add the following code to the <head> of your html file:
// 	<script type = "text/javascript" src  = "despam.js">
//	</script>
// 3. Add the folowing <a> link to the body of your html file:
//	<a href="mailto:[encrypted]" onclick="FixMail (this);">Email</a>



// Global variables to form email addresses
// Edit these to your form your email address
var at1 = "@";
var dot = ".";
var tld = "com";	// TLD
var id1 = "yng";	// Recipient mail box
var id2 = "ve";		// split in two parts
var id3 = "bern";	// Recipient mail box
var id4 = "ardo";		// split in two parts
var id5 = "ha";	// Recipient mail box
var id6 = "ns";		// split in two parts
var id7 = "len";	// Recipient mail box
var id8 = "nart";		// split in two parts
var id9 = "sal";	// Recipient mail box
var id10 = "es";		// split in two parts
var id11 = "sup";	// Recipient mail box
var id12 = "port";		// split in two parts
var id13 = "in";	// Recipient mail box
var id14 = "fo";		// split in two parts
var url = "egocontrols";	// Domain


function FixMail1 (obj1) {

  //Next line changes the href in the calling HTML to the correct address
  obj1.href = "mailto:" + id1 + id2 + at1 + url + dot + tld;

  var x = confirm( "Yngve's email address is: \n\n"
                  + obj1.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send him a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj1.href = "team.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail2 (obj2) {

  //Next line changes the href in the calling HTML to the correct address
  obj2.href = "mailto:" + id3 + id4 + at1 + url + dot + tld;

  var x = confirm( "Bernardo's email address is: \n\n"
                  + obj2.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send him a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj2.href = "team.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail3 (obj3) {

  //Next line changes the href in the calling HTML to the correct address
  obj3.href = "mailto:" + id5 + id6 + at1 + url + dot + tld;

  var x = confirm( "Hans' email address is: \n\n"
                  + obj3.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send him a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj3.href = "team.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail4 (obj4) {

  //Next line changes the href in the calling HTML to the correct address
  obj4.href = "mailto:" + id7 + id8 + at1 + url + dot + tld;

  var x = confirm( "Lennart's email address is: \n\n"
                  + obj4.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send him a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj4.href = "team.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail5 (obj5) {

  //Next line changes the href in the calling HTML to the correct address
  obj5.href = "mailto:" + id9 + id10 + at1 + url + dot + tld;

  var x = confirm( "Sales' email address is: \n\n"
                  + obj5.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send them a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj5.href = "sales.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail6 (obj6) {

  //Next line changes the href in the calling HTML to the correct address
  obj6.href = "mailto:" + id11 + id12 + at1 + url + dot + tld;

  var x = confirm( "Support's email address is: \n\n"
                  + obj6.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send them a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj6.href = "support.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function

function FixMail7 (obj7) {

  //Next line changes the href in the calling HTML to the correct address
  obj4.href = "mailto:" + id13 + id14 + at1 + url + dot + tld;

  var x = confirm( "Our email address is: \n\n"
                  + obj7.href.substr(7)		//this strips off "mailto:" prefix
                  + "\n\n"
                  + "Click OK to send us a message... \n");

  if (x) {
         return true;
         }

  else   {
          obj7.href = "home.html";	//clear the mailto: link so it won't start emailer
          return false;
         }

} //End Function
























