<!-- Begin

addEventListener("load", function()
{
		setTimeout(updateLayout, 0);
}, false);

var currentWidth = 0;

function updateLayout()
{
		if (window.innerWidth != currentWidth)
		{
				currentWidth = window.innerWidth;

				var orient = currentWidth == 320 ? "profile" : "landscape";
				document.body.setAttribute("orient", orient);
				setTimeout(function()
				{
						window.scrollTo(0, 1);
				}, 100);            
		}
}

setInterval(updateLayout, 400);

function beginIt() {
msg = new Array("I bought a case to protect my iPhone from myself.",
"The great aim of education is not knowledge but action.",
"Employ thy time well, if thou meanest to get leisure.",
"I sold my old mobile phone before buying my iPhone.",
"I type faster with my thumbs than with my nose.",
"I never think of the future - it comes soon enough.",
"Please do not drive and type at the same time.",
"I did not know that my face was so greasy.",
"How fast can you type without looking at your keyboard?",
"My milkshake brings all the boys to the yard.",
"Our destiny is frequently met in the very paths we take to avoid it.",
"Opinions cannot survive if one has no chance to fight for them.",
"The universe is flux, life is opinion.",
"I phone, you phone, we all phone with the iPhone.",
"Life is something that everyone should try at least once.",
"There is no remedy for love but to love more.",
"Although prepared for martyrdom, I preferred that it be postponed.",
"Why be a man when you can be a success?",
"I want freedom for the full expression of my personality.",
"The character of a man is known from his conversations.",
"Be not ashamed of mistakes and thus make them crimes.",
"I have never let my schooling interfere with my education.",
"Before God we are all equally wise - and equally foolish.",
"To forget one's purpose is the commonest form of stupidity.",
"The quick brown fox jumps over the lazy dog.")
/* word = 10 */
now = new Date();
seed = now.getSeconds();
var random_number = Math.random(seed);
var range = random_number*msg.length;
var rounded_number = Math.round(range);
if (rounded_number == msg.length){rounded_number = 0}
randSentence = rounded_number;
msgToType = msg[randSentence];
word = (msgToType.length/5);
day = new Date();
startType = day.getTime();
document.getElementById('test').innerHTML = "<p>" + msgToType + "</p>";
document.thisForm.typed.focus();
}
function stopIt() {
dayTwo = new Date();
endType = dayTwo.getTime();
totalTime = ((endType - startType) / 1000)
typedWord = ((document.thisForm.typed.value).length / 5);
spd = Math.round((typedWord/totalTime) * 60);
if (typedWord == 0) {
	alert("You didn't type anything")
}
else if (typedWord < (word - 1)) {
	alert("You didn't finish the sentence but you typed approximately " + typedWord + " words at a rate of " + spd + " words per minute.")
}
else {
	if ("<p>" + document.thisForm.typed.value + "</p>" == document.getElementById('test').innerHTML) {
	alert("You perfectly typed " + typedWord + " words in " + totalTime + " seconds, a speed of about " + spd + " words per minute! Great job!")
	}
	else {
	alert("You made error(s) but you typed " + typedWord + " words in " + totalTime + " seconds, a speed of about " + spd + " words per minute!")
		 }
	}
}
// End -->