<!--
hex = '0123456789ABCDEF';
function encode(theEmail,theName,theCode){
if((theEmail.value.length>0)&&(theName.value.length>0)){
new_text = hex_string('document.write(\'<a href="mailto:' + theEmail.value + '">' + theName.value + '</a>\')');
theCode.value = '<script language="JavaScript" type="text/javascript"><!-- \neval(unescape("' + new_text + '"))\n // --><' + '/script>';
} else {alert('Enter "Email address" and or "Display Text" you would like encoded!')}
}
function hex_string(mystring){
newstring = '';
for (i=0; i<mystring.length; i++){
newstring = newstring + '%' + tohex(mystring.charCodeAt(i));}
return newstring;
}
function tohex(n){
var hs='0123456789ABCDEF'
return hs.charAt(Math.floor(n/16))+hs.charAt(n%16);
}
function preview(theCode){
if(theCode.value.length>0){
pr=window.open("","Preview","status=1, width=320,height=150,left=50,top=50");
pr.document.write(theCode.value);
pr.document.close();}
else alert('You have nothing to be previewed at this time!')
}
function encoden(theEmail,theName,theCode){
if((theEmail.value.length>0)&&(theName.value.length>0)){
new_mail = KeyCode(theEmail.value)
new_name = KeyCode(theName.value)
code = '<a href="mailto:' + new_mail + '">' + new_name + '</a> ';
theCode.value = new_text;
}else alert('There is nothing to be encoded at this time!')
}
function KeyCode(mystring){
newstring = '';
for (i=0; i<mystring.length; i++){ newstring = newstring + '&#' + charcode.mystring.charCodeAt(i) + ';'}
return newstring;}
// -->