
	function rot13(id) {
		var obj = document.getElementById(id);
		var res = "";

		var text    = new String(obj.value);
		for (i=0; i < text.length; i++) {
			var char = text.substring(i, i + 1);

			if((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
				var offset = char >= 'A' && char <= 'Z' ? "A".charCodeAt(0) : "a".charCodeAt(0);
				char = String.fromCharCode(offset + ((text.charCodeAt(i) - offset + 13) % 26));
			}

			res += char;
		}
		
		obj.value = res;
		
	}

