/* 
SB3D Email address obfuscation script 
copyright 2008 Steve Beuret / SB3D 
Version 1.0
*/
function goPostal(code,label){
	var str = decode64(code.substring(4));
	var key = code.substring(0,4);
	var e = '';
	for(i=0; i<str.length; i += 1)e = e + String.fromCharCode(str.charCodeAt(i) - key.charCodeAt(i % 4));
	if(null==label)label = e;
	document.write("<a href='mailto:"+e+"'>"+label+"</a>");
}
function decode64(encStr) {
	var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";	
	var bits, decOut = '', i = 0;
	for(; i<encStr.length; i += 4){
		bits =
		 (base64s.indexOf(encStr.charAt(i))    & 0xff) <<18 |
		 (base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12 | 
		 (base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6 |
		  base64s.indexOf(encStr.charAt(i +3)) & 0xff;
		decOut += String.fromCharCode(
		 (bits & 0xff0000) >>16, (bits & 0xff00) >>8, bits & 0xff);
	}
	if(encStr.charCodeAt(i -2) == 61)
		undecOut=decOut.substring(0, decOut.length -2);
	else if(encStr.charCodeAt(i -1) == 61)
		undecOut=decOut.substring(0, decOut.length -1);
	else undecOut=decOut;
	return undecOut;
}