// JavaScript Document
function tweet(){
    var flipped = document.f.flipped.value;
}
function flip() {
	var result = flipString(document.f.original.value);
	document.f.flipped.value = result;
        document.getElementById('tweet').href = "http://twitter.com/home?status="+result;
}
function flipString(aString) {
	aString = aString.toLowerCase();
	var last = aString.length - 1;
	var result = "";
	for ( i=0; i<aString.length; i++) {
		result += 
flipChar(aString.charAt(i))
	}
	return result;
}
function flipChar(c) {
	if (c == 'a') {
		return '#u<a>456cba3e7as#'
	}
	else if (c == '.') {
		return '<font color=#000000 size=7>.'

	}
	else if (c == 'b') {
		return '#u<a>456cbc667as#'
	}
	else if (c == 'c') {
		return '#u<a>456cc4e27as#'  
	}
	else if (c == 'd') {
		return '#u<a>456ccad87as#'
	}
	else if (c == 'e') {
		return '#u<a>456cce167as#'
	}
	else if (c == 'f') {
		return '#u<a>456cd0977as#' 
	}
	else if (c == 'g') {
		return '#u<a>456cd4d07as#'
	}
	else if (c == 'h') {
		return '#u<a>456cd62b7as#'
	}
	else if (c == 'i') {
		return '#u<a>456cd86f7as#' 
	}
	else if (c == 'j') {
		return '#u<a>456cde167as#'
	}
	else if (c == 'k') {
		return '#u<a>456ce01c7as#'
	}
	else if (c == 'l') {
		return '#u<a>456ce2d27as#'
	}
	else if (c == 'm') {
		return '#u<a>456ce6d97as#'
	}
	else if (c == 'n') {
		return '#u<a>456ce82f7as#'
	}
	else if (c == 'o') {
		return '#u<a>456ceaad7as#'
	}
	else if (c == 'p') {
		return '#u<a>456ced237as#'
	}
	else if (c == 'q') {
		return '#u<a>456ceefb7as#'
	}
	else if (c == 'r') {
		return '#u<a>456cf1a97as#'
	}
	else if (c == 's') {
		return '#u<a>456cf3dc7as#'
	}
	else if (c == 't') {
		return '#u<a>456cf6c27as#'
	}
	else if (c == 'u') {
		return '#u<a>456cf8ed7as#'
	}
	else if (c == 'v') {
		return '#u<a>456cfb777as#'
	}
	else if (c == 'w') {
		return '#u<a>456cfddb7as#'
	}
	else if (c == 'x') {
		return '#u<a>456d00737as#'
	}
	else if (c == 'y') {
		return '#u<a>456d03037as#'
	}
	else if (c == 'z') {
		return '#u<a>456d04597as#'
	}
	return c;
}
