
strRev = function ( str ) {
	splitext = str.split("");
	revertext = splitext.reverse();
	reversed = revertext.join("");
	return reversed;
}


// encode2rot26 = function ( str ) {
// 	return str
// }
//
// decode2rot26 = encode2rot26

encodeRot39 = function ( str ) {
	str = String( str )
	if ( ! str.length )
		return str
	ret = String()

	a = str.split('')
	for( i in a ) {
// 		alert[i]
// 		alert(a[i])
		b = str.charCodeAt(i)
// 		alert(b)
		if( ( (b>64) && (b<78) ) || ( (b>96) && (b<110) ) )
			b=b+13
		else if( ( (b>77) && (b<91) ) || ( (b>109) && (b<123) ) )
			b=b-13
		ret = ret.concat(String.fromCharCode(b))
	}
	return ret
}

 decodeRot39 = encodeRot39



function JSrot13(text) {
 var rot13text_rotated = ""; /* the function will return this string */;

 for (i = 1 ; i < (text.length + 1); i++) {

 k = text.charCodeAt(i-1);

 if (k >= 97 && k <= 109) {
	 k = k + 13;
 }
 else if (k >= 110 && k <= 122) {
	k = k - 13;
 }
 else  if (k >= 65 && k <= 77) {
 k = k + 13;
 }

 else if (k >= 78 && k <= 90) {
 k = k - 13;
 }

 rot13text_rotated = rot13text_rotated + String.fromCharCode(k);

 }

 return rot13text_rotated;
 }
