﻿function encodeMail(mail)
{
	toCode = mail;
	encoded = "";
			
	for(i=0;i<toCode.length;i++)
	{
		c = toCode.charCodeAt(i);
		if (c>=8364)
		{	//c = 128;
		}
		encoded += String.fromCharCode(c + (6));
	}	
	return encoded;			
}


function decodeMail(toDecode)
{
	toCode = toDecode;
	
	decoded = "";
			
	for(i=0;i<toCode.length;i++)
	{
		c = toDecode.charCodeAt(i) - (6);
		if(!isNaN(c))
		{	
			decoded += String.fromCharCode(c);
		}
				
				
		}
		return decoded;			
}

function doMail(toDecode)
{
	ref = "mailto:"+decodeMail(toDecode);
	window.location = ref;
}	