
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. Sheep-dog. Sheep dog. Sheepdoooog. Sheepdog. SHEEPDOG.",
		"Ever wanted to own a Saab? Good news. I know a guy who knows a guy.",
		"Doctor Sandwich is Barack Obama's longtime 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 face this fact. (Or else.)",
		"I once knew a girl from Scottsdale. No, 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 attempted to serve it to me is now face down in a shallow grave in Bayonne, New Jersey.",
		"I really wish I had brought that leftover cheesesteak to work today.",
		"Boy howdy. This new axle grease is really gumming up the works.",
		"I'll have the Alecco.",
		"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.",
		"The berry eating contest was to take place in a hotel conference room in downtown Seattle.",
		"'Participant' trophies for Little Leaguers are available on the third floor. One per guest, please.",
		"It has been said that 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, as I say, an unseasonably warm day, and though my thin body bore heat well, I too had begun to sweat.",
		"Let's have a little nosh and discuss several twentieth century 'novels of ideas.'",
		"Who left this goddamn quarter on the piano? ? ?",
		"You know, Mother always said it was best to darn socks and hem trousers on separate days of the week.",
		"Yes &mdash; as a matter of fact my driver's license did come from a Cracker Jack box.",
		"Dear Sir or Madam: 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 the intense study of a man in his prime.",
		"Cyborg or not, I loved him for his body.",
		"Dear Murray: We are out of Fun Dip. Please advise.",
		"You cannot catch me, Secundus, for I have been told to run.",
		"Yo, Tony: 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.",
		"No no, it's cheese, it doesn't count. ",
		"One A.M. chicken wings are never a bad idea unless you allow them to be. Instead, allow them to fulfill their midnight destinies.",
		"Never trust men who spit inside a subway car.",
		"I want a nice soft bread, nothing with the little bits that will irritate my stomach, just some nice bread. Can you do that for me?",
		"Each pitcher of iced tea gets three sugars, or preferably a natural, non-sugar sweetener.",
		"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."
		
		);
		
	/*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);
}