
function word(str, containerID)
{
	if( str.length == 0 )
		return;
	
	var thisWord;
	var nextWord;
	
	if( str.indexOf(" ") >= 0 )
	{
		thisWord = str.substr(0, str.indexOf(" "));
		nextWords = str.substr(str.indexOf(" ")+1);
	}
	else
	{
		thisWord = str;
		nextWords = "";	
	}
	
	document.getElementById(containerID).innerHTML += "<div class='separate'>" + thisWord + "</div> ";
	setTimeout("word(\"" + nextWords + "\", \"" + containerID + "\")", 375);
}


function doWords()
{
	var messages = Array(
		"I live in a dunderheaded pop fantasia.",
		"Sha na na na na na na na. Sha na na na na na na na.",
		"I just ate six hot dogs. Hello, my name is Curtis.",
		"Sheepdog. Sheepdog. Sheepdog.",
		"Ever wanted to own a Saab? Good news. I know a guy who knows a guy.",
		"Doctor Sandwich is Barack Obama's boyhood confidant.",
		"I don't mean to be rude, because we've just met. But your shoe is untied . . . Ha! Just kidding. You're fine.",
		"Baklava is a fine dessert sandwich, and soon the world will come to know it as such.",
		"I once knew a girl from Scottsdale. Nothing dirty rhymes with Scottsdale. She was just real nice.",
		"Low fat mayonnaise, also known as lite or light mayonnaise, is the scourge of mankind. The last hapless soul who served it to me is face down in a shallow grave in Bayonne, New Jersey.",
		"I wish I had brought that leftover cheesesteak to work today.",
		"Yes, very good. I'll have a Bloody Mary and a steak sandwich and a steak sandwich, please.",
		"It's got ham, it's got cheese &mdash; it's delicious!",
		"I would have won the berry eating contest if that grizzly had not wandered in from the mountains.",
		"Participant trophies for Little Leaguers are available on the third floor.",
		"In St. Louis, a man can walk for hours before he sees a kind face.",
		"In the spring of 1917, when Doctor Richard Diver first arrived in Zurich, he was twenty six years old, a fine age for a man; indeed, the very acme of bachelorhood.",
		"It was an unseasonably warm day and I too had begun to sweat.",
		"Let's have a little nosh and discuss twentieth century novels of ideas.",
		"Who left this goddamn quarter on the piano? ? ?",
		"Mother always said it was best to darn socks and hem trousers on different days of the week.",
		"Yes &mdash; my driver's license did come from a Cracker Jack box.",
		"It has come to my attention that you have filched my Nip-Chee crackers. Please return them, immediately.",
		"Jellies, jams, and preserves are worthy of intense study.",
		"Cyborg or not, I loved him for his body.",
		"Dear Murray: We are out of Fun Dip. Please advise.",
		"You want I should get you some Jolly Ranchers while I'm down at the truck ?",
		"This is a surface on which no hair can grow.",
		"This is just to say: I have eaten the plums that were in the icebox and which you were probably saving for breakfast. Forgive me &mdash; they were delicious. So sweet and so cold.",
		"So much depends upon a red wheel barrow glazed with rain water beside the white chickens.",
		"Debbie makes the best enchiladas.",
		"If it's cheese, it does not count.",
		"Chicken wings are never a bad idea unless you allow them to be.",
		"Never trust a man who spits inside a subway car.",
		"Picard and Riker are waiting in the car. If I don't come out in ten minutes, you can expect them to kick in your door with phasers set to stun.",
		"Henry and Ramona were psychologically my first peers. That said, whenever Ribsy was mentioned, I always got hungry. What does that mean?",
		"Doctor Sandwich maintains personal relationships with heart throbs and rock stars, but tries not to be conceited about it.",
		"I would like to meet more people named Zach.",
		"You're not recording this, are you?",
		"For an extra grand, I'll let you take me out to dinner.",
		"I can't figure out what I was doing in Utah this morning.",
		"Hey! It's all ball bearings nowadays. Now you prepare that Fetzer valve with some 3 in 1 oil and some gauze pads.",
		"Can I borrow your towel for a sec? My car just hit a water buffalo.",
		"This is what happens when you find a stranger in the Alps.",
		"It's like what Lenin said . . . you look for the person who will benefit, and, uh, uh . . .",
		"Uh, I'm just gonna go find a cash machine.",
		"Sometimes, there's a man.",
		"Donnie was a good bowler, and a good man."
		
		);
		
	/*var messages = Array("I am the poop monster ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !");*/
	
	var i = Math.floor((messages.length)*Math.random());
	
	var randomString = messages[i];



	word(randomString, "togethertext");
	
	var ary = randomString.split(" ");
	var countdown = (ary.length + 2) * 375;
	
	var fn = "word(\"P.S. Doctor Sandwich makes websites. He can make one for you.\", \"websitetext\")";
	
	setTimeout(fn, countdown); 
	
	

}


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
	for(var i=0; i < document.images.length; i++)
	{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";

			
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<div " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='crop'); \"></div>" 
			img.outerHTML = strNewHTML
		
			i = i-1
		}
	}
	window.attachEvent("onload", correctPNG);
}
