function rot_13(text)
{
	var keycode    = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	var textrot    = new String()

	for(var i = 0; i < text.length; i++)
	{
		var codechar    = text.substring(i, i + 1)
		var pos = keycode.indexOf(codechar.toUpperCase())

		if(pos >= 0)
		{
			pos = (pos + keycode.length / 2) % keycode.length
			codechar    = (codechar == codechar.toUpperCase()) ?
						keycode.substring(pos, pos + 1) :
						keycode.substring(pos, pos + 1).toLowerCase()
		}
		textrot    = textrot + codechar
	}
	return textrot
}