// eMail Obfuscator Script 2.1 by Tim Williams - freeware
// modified by Al Reynolds for multiple addresses and images
// generator at http://www.u.arizona.edu/%7Etrw/spam/spam4.ht

var coded = new Array();
var emaillink = new Array();

coded[0] = "L.B.NZ6IHK8@MGC0.A6I.ZE";	//dnb
coded[1] = "C.K.6ALLGME@MGC0.A6I.ZE";	//mer
coded[2] = "K.H.HADDOBL@MGC0.A6I.ZE";	//ehh
coded[3] = "4.M.JLPNI@NHD8.B4J.0F";	//rdg
coded[4] = "m.v.7qfz1xp9@ouya.17s.bw";	//ajr
coded[5] = "poonlkmu@msw7.y3q.9u";	//feedback
coded[6] = "HC82DQF@OIE6.C2K.8G";	//journal
coded[7] = "li3i@kqu3.wzo.5s";		//data

for (ci=0; ci<=7; ci++)
{
	cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890"
	shift=coded[ci].length
	emaillink[ci]=""
	for (i=0; i<coded[ci].length; i++)
	{
		if (cipher.indexOf(coded[ci].charAt(i))==-1)
		{
			ltr=coded[ci].charAt(i)
			emaillink[ci]+=(ltr)
		}
		else
		{     
			ltr = (cipher.indexOf(coded[ci].charAt(i))-shift+cipher.length) % cipher.length
			emaillink[ci]+=(cipher.charAt(ltr))
		}				
	}
}

imglocation="http://www.cimt.plymouth.ac.uk/siteimages/";

function SetImageLocation(imgloc)
{
	imglocation = imgloc;
}

function WriteEmailLink(emailname,subjecttext)
{
	if (subjecttext==undefined)	{ subjecttext="" }
	if (subjecttext!="")		{ subjecttext="?subject="+subjecttext }
	if (emailname=="dnb")	{ ei=0 }
	if (emailname=="mer")	{ ei=1 }
	if (emailname=="ehh")	{ ei=2 }
	if (emailname=="rdg")	{ ei=3 }
	if (emailname=="ajr")	{ ei=4 }
	if (emailname=="feedback")	{ ei=5 }
	if (emailname=="journal")	{ ei=6 }
	if (emailname=="data")	{ ei=7 }
	document.write("<a href='mailto:"+emaillink[ei]+subjecttext+"'><IMG src='"+imglocation+emailname+"email.gif' width='168' height='28' border='0'><"+"/"+"a>")
}


