// <!- randomsayings Javascript source

/* This script, if placed above the <body> tag, will display randomly selected sayings.
     R Scott  27-May-2004
 */
 
var SayCount = 25;
var RndSay;

function WeightedRandom()
  {
	var SC = SayCount - 1;	
	// Weight each number, 0 thru 10.
	var Weight = new Array(SayCount)
		Weight[0] = 2
		Weight[1] = 5
		Weight[2] = 5
		Weight[3] = 5
		Weight[4] = 5
		Weight[5] = 5
		Weight[6] = 2
		Weight[7] = 5
		Weight[8] = 1
		Weight[9] = 2
		Weight[10] = 5
		Weight[11] = 5
		Weight[12] = 5
		Weight[13] = 5
		Weight[14] = 2
		Weight[15] = 5
		Weight[16] = 5
		Weight[17] = 5
		Weight[18] = 5
		Weight[19] = 5
		Weight[20] = 5
		Weight[21] = 5
		Weight[22] = 5
		Weight[23] = 5
		Weight[24] = 5
		
	// Add up the weights.
		var TotalWeight = 0
		for(Loop1=0 ; Loop1<SayCount; Loop1++) TotalWeight = TotalWeight + Weight[Loop1];
		
	// Choose a random number between 1 and the total weight.
		var RandNum=Math.floor(Math.random()* TotalWeight);
			
		
	// Figure out which value this number corresponds to, using the weights.
		for(Loop2=0 ; Loop2<SayCount; Loop2++) 
		{
		  if (Weight[Loop2] > RandNum) return Loop2;
		  RandNum = RandNum - Weight[Loop2];
		  }
   }

	// Create array of sayings
	var BoozySaying = new Array(SayCount)
 	BoozySaying[0] = "Sometimes when I reflect back on all the beer I drink I feel shamed. Then I look into the glass and think about the workers in the brewery and all of their hopes and dreams. If I didn't drink this beer, they might be out of work and their dreams would be shattered. Then I say to myself, 'It is better that I drink this beer and let their dreams come true than be selfish and worry about my liver.' ~ Jack Handy"
	BoozySaying[1] = "I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day.  ~ Frank Sinatra"
	BoozySaying[2] = "An intelligent man is sometimes forced to be drunk to spend time with his fools.  ~ Ernest Hemingway"
	BoozySaying[3] = "When I read about the evils of drinking, I gave up reading.  ~ Henny Youngman"
 	BoozySaying[4] = "24 hours in a day, 24 beers in a case. Coincidence? I think not.  ~ Stephen Wright"
	BoozySaying[5] = "When we drink, we get drunk. When we get drunk, we fall asleep. When we fall asleep, we commit no sin. When we commit no sin, we go to heaven. Sooooo, let's all get drunk and go to heaven!  ~ Brian O'Rourke"
	BoozySaying[6] = "We hear of the conversion of water into wine at the marriage in Cana as of a miracle. But this conversion is, through the goodness of God, made every day before our eyes. Behold the rain which descends from heaven upon our vineyards, and which incorporates itself with the grapes, to be changed into wine; a constant proof that God loves us, and loves to see us happy.  ~ Benjamin Franklin"
	BoozySaying[7] = "Without question, the greatest invention in the history of mankind is beer. Oh, I grant you that the wheel was also a fine invention, but the wheel does not go nearly as well with pizza.  ~ Dave Barry"
 	BoozySaying[8] = "One afternoon at Cheers, Cliff Clavin was explaining the Buffalo Theory to his buddy Norm. Here's how it went: 'Well ya see, Norm, it's like this... A herd of buffalo can only move as fast as the slowest buffalo. And when the herd is hunted, it is the slowest and weakest ones at the back that are killed first. This natural selection is good for the herd as a whole, because the general speed and health of the whole group keeps improving by the regular killing of the weakest members. In much the same way, the human brain can only operate as fast as the slowest brain cells. Excessive intake of alcohol, as we know, kills brain cells. But naturally, it attacks the slowest and weakest brain cells first. In this way, regular consumption of beer eliminates the weaker brain cells, making the brain a faster and more efficient machine. That's why you always feel smarter after a few beers."
	BoozySaying[9] = "Wine: Helping ugly people get laid since 3000 B.C.!!!  ~ Unknown"
	BoozySaying[10] = "Philip Haberman Jr:  A gourmet is just a glutton with brains."
	BoozySaying[11] = "There cannot be good living where there is not good drinking.  ~ Benjamin Franklin" 
	BoozySaying[12] = "Wine makes daily living easier, less hurried, with fewer tensions and more tolerance.  ~ Benjamin Franklin" 
	BoozySaying[13] = "Take counsel in wine, but resolve afterwards in water.  ~ Benjamin Franklin" 
	BoozySaying[14] = "About Noah and Wine: Before Noah, men having only water to drink, could not find the truth. Accordingly...they became abominably wicked, and they were justly exterminated by the water they loved to drink. This good man, Noah, having seen that all his contemporaries had perished by this unpleasant drink, took a dislike to it; and God, to relieve his dryness, created the vine and revealed to him the art of making le vin. By the aid of this liquid he unveiled more and more truth.  ~ Benjamin Franklin" 
	BoozySaying[15] = "For every wound, a balm.<br> For every sorrow, cheer.<br> For every storm, a calm.<br> For every thirst, a beer.<br>  ~ Unknown" 
	BoozySaying[16] = "In heaven there is no beer...<br> That's why we drink ours here.<br>  ~ Unknown" 
	BoozySaying[17] = "Here's to a long life and a merry one.<br> A quick death and an easy one.<br> A pretty girl and an honest one.<br> A cold beer-and another one!<br>  ~ Unknown" 
	BoozySaying[18] = 'Come, come, good wine is a good familiar creature if it be well used; exclaim no more against it.  -- William Shakespeare, Othello, Act II, Sc. 3'
	BoozySaying[19] = "In victory, you deserve Champagne, in defeat, you need it.  ~ Napoleon Bonaparte"  
	BoozySaying[20] = "Beer makes you feel the way you ought to feel without beer. -- Henry Lawson"
	BoozySaying[21] = "The problem with the world is that everyone is a few drinks behind. -- Humphrey Bogart"
	BoozySaying[22] = "Not all chemicals are bad. Without chemicals such as hydrogen and oxygen, for example, there would be no way to make water, a vital ingredient in beer. -- Dave Barry"
	BoozySaying[23] = "Diet tip: Eat a chocolate bar before each meal. It'll take the edge off your appetite and you'll eat less."
	BoozySaying[24] = "The discovery of a new dish does more for human happiness than the discovery of a new star.  ~ Jean Anthelme Brillat-Savarin"


	// Define RndSay for Saying
	RndSay = BoozySaying[WeightedRandom()]
	
     document.write("<P class=caption>")
     document.write(RndSay)
     document.write('<\/p>')

	//  End of randomsayings Javascript source ->

