function rotate_char(input) {
	var basechar;
	if (input >= 97 && input <= 122) {
		// unicode char, lowercase
		basechar = 97;
		input -= 97;
	} else if (input >= 65 && input <= 90) {
		// unicode char, uppercase
		basechar = 65;
		input -= 65;
	} else {
		return input;
	}
	return ((input + 13) % 26) + basechar;
}

function rot13(str) {
	var retval = "";
	for(var i=0; i<str.length; i++) {
		retval += String.fromCharCode(rotate_char(str.charCodeAt(i)));
	}
	return retval;
}



