// eMail Obfuscator Script 2.1 by Tim Williams - freeware
// http://www.u.arizona.edu/~trw/spam/spam4.htm

function maildecr(coded,containerId,text){
	
		cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890"
		shift=coded.length
		link=""
		cleantext=""
		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))
			}				
    	}
    	if (!text || text == undefined || text == '') {
			cleantext = link;
    	} else {
			textShift=text.length
			for (i=0; i<text.length; i++){
				if (cipher.indexOf(text.charAt(i))==-1){
					ltr=text.charAt(i)
					cleantext+=(ltr)
				}
				else {     
					ltr = (cipher.indexOf(text.charAt(i))-textShift+cipher.length) % cipher.length
					cleantext+=(cipher.charAt(ltr))
				}				
	    	}
    	};
    	
    	
    	
    	if (document.getElementById(containerId) != null) {
    		document.getElementById(containerId).innerHTML="<a href='mailto:"+link+"'>"+cleantext+"</a>";
    	};
			
    }