// eMail Obfuscator Script 2.1 by Tim Williams - freeware
//Adapted by Russell Freeman
function email(coded,name,address){
	var cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890";
	shift=coded.length;
	link="";
	for (i=0; i<coded.length; i++){
		if (cipher.indexOf(coded.charAt(i))==-1){
			ltr=coded.charAt(i);
			link+=(ltr);
		}
		else {     
			ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length;
			link+=(cipher.charAt(ltr));
		}
	}
	document.write("<p><a href='mailto:"+address+"@maxwellwinward.com' title='"+name+"'><img src='../images/email_icon.gif' alt='email' /><span>"+address+"@maxwellwinward.com</span></a></p>");
}

function email_news(coded,name,address){
	var cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890";
	shift=coded.length;
	link="";
	for (i=0; i<coded.length; i++){
		if (cipher.indexOf(coded.charAt(i))==-1){
			ltr=coded.charAt(i);
			link+=(ltr);
		}
		else {     
			ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length;
			link+=(cipher.charAt(ltr));
		}
	}
	document.write("<p><a href='mailto:"+link+"' title='"+name+"'><img src='images/email_icon_blue.gif' alt='email' /><span>"+address+"@maxwellwinward.com</span></a></p>");
}
