/*******************************************************
 * Functions for e-mail address encryption/decryption. *
 *******************************************************/
/**
 * Encrypt an e-mail address.
 *
 * @param	email_plain
 *			The e-mail address to encrypt.
 * @return	email_encr
 *			The encrypted e-mail address.
 */
function addr_encrypt(email_plain){
	email_plain = "mailto:" + email_plain;
	var email_encr = '';
	email_plain = email_plain.replace('.','#');
	for(i=0; i<email_plain.length; i++){
		email_encr = email_encr + String.fromCharCode(email_plain.charAt(i).charCodeAt(0)+1);
	}
	return email_encr;
}
/**
 * Decrypt an e-mail address that was encrypted using addr_encrypt().
 *
 * @param	email_encr
 *			The encrypted e-mail address to decrypt.
 * @return	email_plain
 *			The decrypted e-mail address.
 */
function addr_decrypt(email_encr){
	//email_encr = unescape(email_encr);
	var email_plain = '';
	for(i=0; i<email_encr.length; i++){
		email_plain = email_plain + String.fromCharCode(email_encr.charAt(i).charCodeAt(0)-1);
	}
	email_plain = email_plain.replace('#','.');
	return email_plain;
}
/**
 * Create a e-mail link in the HTML code using an encrypted e-mail address.
 *
 * @param	email_encr
 *			The e-mail address for the link in encrypted form.
 * @param	link_text
 *			The text to show for the link in the browser window.
 */
function email_link(email_encr, link_text){
	document.write(link_text.link(addr_decrypt(email_encr)));
}

/*************************************
 * Functions for language switching. *
 *************************************/
 /**
  *
  */
 function switch_language(){
	 document.write(document.location.pathname);
 }
