// JavaScript Document

var totalJokes = 12;
var jokeIndex = Math.round((totalJokes-1)*Math.random());

punchLine = new Array();
comic = new Array();

punchLine[0] = "There's a new device to wake sleepy drivers. The old device was the car crash.";
punchLine[1] = "Signs on the freeway are funny. \"Orange Cones Mean Men at Work.\" What else could orange cones mean? Psychedelic witches embedded in asphalt?";
punchLine[2] = "Have you ever noticed? Anyone going slower than you is an idiot, and anyone going faster than you is a moron.";
punchLine[3] = "I failed my driver's test. The guy asked me, \"What do you do at a red light?\" I said, \"I don't know. Look around, listen to the radio?\"";
punchLine[4] = "One time a cop pulled me over for running a stop sign. He said, \"Didn't you see the stop sign?\" I said, \"Yeah, but I don't believe everything I read.\"";
punchLine[5] = "I just got a jaywalking ticket, which is the dumbest ticket of all. I said, \"Is this going to go on my record, or can I go to Walking School and have this taken off?\"";
punchLine[6] = "There was a 194-car crash in Los Angeles. Luckily, the guy in the first car was still able to complete his cell phone call.";
punchLine[7] = "I've finally got a car that turns heads. Mostly because of the knocking, rattling, and backfiring.";
punchLine[8] = "I hate those new Sport Utility Vehicles. I just got cut off by that new one, you know, the Ford Exhibitionist.";
punchLine[9] = "My dad's still driving at eighty-nine: \"What red light? What open drawbridge? Why is there a baby carriage on the hood?\"";
punchLine[10] = "I hate when people honk at me. Unless I'm making a left turn. Then I like it because that's how I know it's time to turn.";
punchLine[11] = "I was stopped once for doing 53 in a 35-miles-per-hour zone, but I got off. I told them I had dyslexia.";

comic[0] = "Craig Kilborn";
comic[1] = "Karen Babbitt";
comic[2] = "George Carlin";
comic[3] = "Bill Braudis";
comic[4] = "Steven Wright";
comic[5] = "Gary Shandling";
comic[6] = "Jay Leno";
comic[7] = "Reno Goodale";
comic[8] = "Daryl Hogue";
comic[9] = "Buddy Bolton";
comic[10] = "Rita Rudner";
comic[11] = "Spanky";

function DisplayJoke()
{
	if( jokeIndex == totalJokes )
		jokeIndex = 0;
	
	document.getElementById('joke').innerHTML = punchLine[jokeIndex];
	document.getElementById('comic').innerHTML = "-" + comic[jokeIndex++];
	window.setTimeout("DisplayJoke()",15*1000); //seconds times 1000
}

