/* =======================================================
Email Spider Stumper v3.1
last modified 13 Oct 2005
Developed by Scott Clark & Kevin Duhe
The Source is available at http://www.clarksco.com/blog/
Copyright 2005 Clark Consulting
======================================================= */

// There are three arguments being passed into this array.
// "theName" is the username (or the portion of the email address prior to the @.
// "theExtras" are items such as "?subject=blah".  Can be blank if you don't want to use this feature.
// "theLink" is the text for the link.  For example "Contact Us".  Can be blank if you don't want to use this feature.
// 
// 9th November 2007
// This is a modified version of stumper v3.1 so that I can have multiple domain names that allow me to hide
// the email addresses of all the members of BRX Wycombe
// This has added a forth argument, theNumber, which is used to idenitfy which domain name you want to use.

function stumpIt(theName,theNumber,theExtras,theLink) {
var theDomain;
var theEmail;
theDomain = get_domain(theNumber);
theEmail = theName+"@"+theDomain;
if (theName == "")
	{
	theName = "ERROR";
	theLink = "ERROR";
	myEmail = theName;
	myLink = theLink;
	}
else
	{
	if ((theExtras == "") && (theLink ==""))
		{
		myEmail = theEmail;
		myLink = theEmail;
		}
	if ((theLink == "") && (theExtras != ""))
		{
		myLink = theEmail;
		myEmail = theEmail+theExtras;
		}
	if 	((theLink != "") && (theExtras != ""))
		{
		myLink = theLink;
		myEmail = theEmail+theExtras;
		}
	if 	((theLink != "") && (theExtras == ""))
		{
		myLink = theLink;
		myEmail = theEmail;
		}
	}
	document.write('<a href=mailto:' + myEmail + '>' + myLink + '</a>');
}

function get_domain(theNumber)
	{
	var theDomain;
	var allDomains = new Array("","isilwana.net","swbell.net","icon.co.za","jozi-jol.org","smack.co.za");
	theDomain = allDomains[theNumber];
	return theDomain;
	}
