Encodes email address using javascript