// JavaScript Document
function hexval(c) {
	if (String('0').charCodeAt(0) <= c && c <= String('9').charCodeAt(0))
		return c - String('0').charCodeAt(0);
	if (String('A').charCodeAt(0) <= c && c <= String('F').charCodeAt(0))
		return c - String('A').charCodeAt(0) + 10;
	if (String('a').charCodeAt(0) <= c && c <= String('f').charCodeAt(0))
		return c - String('a').charCodeAt(0) + 10;
	return 0;
}
function hexval2(c) {
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;

	if (c == 'a') return 10;
	if (c == 'b') return 11;
	if (c == 'c') return 12;
	if (c == 'd') return 13;
	if (c == 'e') return 14;
	if (c == 'f') return 15;

	if (c == 'A') return 10;
	if (c == 'B') return 11;
	if (c == 'C') return 12;
	if (c == 'D') return 13;
	if (c == 'E') return 14;
	if (c == 'F') return 15;

	return 16;
}
function isxdigit(c) {
	return hexval2(c) < 16;
}
function decval(c) {
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;
	return 10;
}
function isdigit(c) {
	return decval(c) < 10;
}

	function myUrlEncode(str) {
		var result = "";
		var iii = 0;
	
		for (iii=0; iii < str.length; iii++) {
			result = result + "%";
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(iii)/16)&0x0F);
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(iii)/1)&0x0F);
		}
		return result;
		
	}
	
	function myUrlDecode(str) {
	var result = new String("");
	var i=0;

	for (i=0; i < str.length; i++) {
		if (str.charAt(i) == '%' && i+3 <= str.length) {
			var foo = 0;
			i++;
			result = result + 
			String.fromCharCode(
				hexval(str.charCodeAt(i)) * 16 +
				hexval(str.charCodeAt(i+1))
			);
			i++;

		} else
			result  = result + str.charAt(i);
	}
	return  result;
	/*lnk.href = "mailto:" + result;*/
}

function writeMail(name,domain){
var a=name;
var b=domain;
var c="&#64;";
document.write("<a" + " href="+"ma"+"il"+"to:"+myUrlDecode(a)+c+myUrlDecode(b)+" >"+myUrlDecode(a)+c+myUrlDecode(b)+"</a>");
}