﻿function myUrlEncode(str) {
	var result = "";
	var i = 0;

	for (i=0; i < str.length; i++) {
		result = result + "%";
		result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/16)&0x0F);
		result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/1)&0x0F);
	}
	return result;
}

function emenc(name, company, domain) {
   locationstring = 'mai' + 'lto:' + myUrlEncode(name) + '&#64' + myUrlEncode(company) + '.' + myUrlEncode(domain);
   window.location.replace(locationstring);
}

