// quotableQuotes.js
// version 2.0
// this version will not repeat a random selection until 3/4 of them have been shown, at which point all are again available.
// written by Dave Arnett for the solarshieldaz.com website
var strQuoteHeading;
var numQuote;
var strQuote;
var strQuoteSource;
var arrQuote = new Array();
var arrSource = new Array();
var numQuoteCount;
var arrQuoted = new Array();
var numUnshownQuotes;
var numTotalQuotes;
var boolInitQuote = true;
//
funcBuildQuoteArray();
funcSelectRandomQuote();
funcDisplayQuote();
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ funcBuildQuoteArray()
function funcBuildQuoteArray() {
   // begin the 19 Dali Lama quotes...
    arrQuote[1] = "Take into account that great love and great achievements involve great risk.";
   arrSource[1] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[2] = "When you lose, don't lose the lesson.";
   arrSource[2] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[3] = "Follow these three <b><u>R</u></b>'s:<br /><b><u>R</u></b>espect for self,<br /><b><u>R</u></b>espect for others and<br /><b><u>R</u></b>esponsilility for all your actions.";
   arrSource[3] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[4] = "Remember that <i>not</i> getting what you want is sometimes a wonderful stroke of luck.";
   arrSource[4] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[5] = "Learn the rules so you know how to break them properly.";
   arrSource[5] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[6] = "Don't let a little dispute injure a great relationship.";
   arrSource[6] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[7] = "When you realize you've made a mistake, take immediate steps to correct it.";
   arrSource[7] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[8] = "Spend some time alone each day.";
   arrSource[8] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[9] = "Open arms to change, but don't let go of your values.";
   arrSource[9] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[10] = "Remember that silence is sometimes the best answer.";
   arrSource[10] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[11] = "Live a good, honorable life. Then when you get older and think back, you'll be able to enjoy it a second time.";
   arrSource[11] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[12] = "A loving atmosphere in your home is the foundation for your life.";
   arrSource[12] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[13] = "In disagreements with loved ones, deal only with the current situation. Don't bring up the past.";
   arrSource[13] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[14] = "Share your knowledge. It's a way to achieve immortality.";
   arrSource[14] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[15] = "Be gentle with the earth.";
   arrSource[15] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[16] = "Once a year, go someplace you've never been before.";
   arrSource[16] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[17] = "Remember that the best relationship is one in which your love for each other exceeds your need for each other.";
   arrSource[17] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[18] = "Judge your success by what you had to give up in order to get it.";
   arrSource[18] = "the Dali Lama<br />Instructions for<br />Life, 2006";
    arrQuote[19] = "Approach love and cooking with reckless abandon.";
   arrSource[19] = "the Dali Lama<br />Instructions for<br />Life, 2006";
   // begin the 11 Mis-Predictions...
    arrQuote[20] = "I think there is a world market for maybe five computers.";
   arrSource[20] = "IBM chairman<br />Thomas Watson,<br />1943";
    arrQuote[21] = "There is no reason anyone would want a computer in their home.";
   arrSource[21] = "Ken Olson, DEC founder & chairman,<br />1977";
    arrQuote[22] = "640K (of RAM) ought to be enough for anybody.";
   arrSource[22] = "Bill Gates,<br />1981";
    arrQuote[23] = "Computers in the future may weigh no more than 1.5 tons.";
   arrSource[23] = "Popular Mechanics,<br />forecasting the<br />relentless march<br />of science,<br />1949";
    arrQuote[24] = "Everything that can be invented has already been invented.";
   arrSource[24] = "Charles Duell, director<br />US Patent Office,<br />1899";
    arrQuote[25] = "A rocket will never be able to leave the earth's atmosphere.";
   arrSource[25] = "New York Times,<br />1936";
    arrQuote[26] = "I can assure you that data processing is a fad that won't last out the year.";
   arrSource[26] = "The editor in charge<br />of business books<br />for Prentice Hall,<br />1957";
    arrQuote[27] = "Television won't last because people will soon get tired of staring at a plywood box every night.";
   arrSource[27] = "Darryl Zanuck,<br />20th Century Fox,<br />1946";
    arrQuote[28] = "This telephone has too many shortcomings to be seriously considered as a means of communication. The device is inherently of no value to us.";
   arrSource[28] = "Internal<br />Western Union<br />memo, 1876";
    arrQuote[29] = "Louis Pasteur's theory of germs is ridiculous fiction.";
   arrSource[29] = "Pierre Pachet,<br />Professor of Physiology<br />at Toulouse,<br />1872";
    arrQuote[30] = "Forget it. No Civil War picture ever made a nickel.";
   arrSource[30] = "MGM executive, advising against investing in Gone With The Wind";
   // on with the rest of the quotable quotes...
    arrQuote[31] = "If you're looking for friends when you need them... it's too late.";
   arrSource[31] = "Mark Twain";
    arrQuote[32] = "Speak in anger and you'll give the greatest speech you'll ever regret.";
   arrSource[32] = "Anonymous";
    arrQuote[33] = "It is useless for sheep to pass a resolution in favor of vegetarianism while wolves remain of a different opinion.";
   arrSource[33] = "William Inge";
    arrQuote[34] = "Vegetarian is an old Indian word meaning <i>bad hunter</i>.";
   arrSource[34] = "Anonymous";
    arrQuote[35] = "If you think nobody cares if you are alive, try missing a couple of car payments.";
   arrSource[35] = "Earl Wilson";
    arrQuote[36] = "Resentment is like taking poison and hoping the other person dies.";
   arrSource[36] = "St Augustine";
    arrQuote[37] = "Creativity is the sudden cessation of stupidity.";
   arrSource[37] = "Dr E Land";
    arrQuote[38] = "Progress depends on people knowing they'll be able to profit from their ideas.";
   arrSource[38] = "Deborah Neville";
    arrQuote[39] = "Forgiveness is not an occasional act: it is a permanent attitude.";
   arrSource[39] = "Martin L King, Jr";
    arrQuote[40] = "Smooth seas do not make for a skillful sailor.";
   arrSource[40] = "African Proverb";
    arrQuote[41] = "Always do right. This will gratify some people and astonish the rest.";
   arrSource[41] = "Mark Twain";
    arrQuote[42] = "The reason that worry kills more people than work is because there are more people who worry than work.";
   arrSource[42] = "Robert Frost";
    arrQuote[43] = "Better to light one small candle than to curse the darkness.";
   arrSource[43] = "Chinese Proverb ";
    arrQuote[44] = "We can easily forgive a child who is afraid of the dark; the real tragedy is when men are afraid of the light.";
   arrSource[44] = "Plato";
    arrQuote[45] = "When in doubt, tell the truth.";
   arrSource[45] = "Mark Twain";
    arrQuote[46] = "If you can't explain it to a six year old, you don't understand it yourself.";
   arrSource[46] = "Albert Einstein";
    arrQuote[47] = "I am not young enough to know everything.";
   arrSource[47] = "Oscar Wilde";
    arrQuote[48] = "He who praises himself has a congregation of one.";
   arrSource[48] = "Jewish proverb";
    arrQuote[49] = "Everyone is ignorant, only on different subjects";
   arrSource[49] = "Will Rogers";
    arrQuote[50] = "I not only use all the brains I have, but all I can borrow.";
   arrSource[50] = "Woodrow Wilson";
    arrQuote[51] = "Things are only impossible until they're not.";
   arrSource[51] = "Jean-Luc Picard";
    arrQuote[52] = "It is not necessary to advertise food to hungry people, fuel to cold people, or houses to the homeless.";
   arrSource[52] = "John Kenneth Galbraith";
    arrQuote[53] = "Go out and preach the gospel and if you must, use words.";
   arrSource[53] = "St Francis of Assisi";
    arrQuote[54] = "A man travels all over the world in search of what he needs and returns home to find it.";
   arrSource[54] = "George Moore";
    arrQuote[55] = "I know God will not give me anything I can't handle. I just wish He wouldn't trust me so much.";
   arrSource[55] = "Mother Teresa";
    arrQuote[56] = "The trouble with being in the rat race is that even if you win, you're still a rat.";
   arrSource[56] = "Lily Tomlin";
    arrQuote[57] = "In politics, stupidity is not a handicap.";
   arrSource[57] = "Napoleon Bonaparte";
    arrQuote[58] = "Adversity does not make us frail; it only shows us how frail we are.";
   arrSource[58] = "Abraham Lincoln";
    arrQuote[59] = "Success in marriage is more than finding the right person: it is being the right person.";
   arrSource[59] = "Robert Browning";
    arrQuote[60] = "The most difficult part of golf is learning not to talk about it.";
   arrSource[60] = "Anonymous";
    arrQuote[61] = "Never tell people how to do things. Tell them what to do, and they will surprise you with their ingenuity.";
   arrSource[61] = "Gen George Patton";
    arrQuote[62] = "An appeaser is one who feeds a crocodile, hoping it will eat him last.";
   arrSource[62] = "Winston Churchill";
    arrQuote[63] = "We're not primarily put on this earth to see through one another, but to see one another through.";
   arrSource[63] = "Peter De Vries";
    arrQuote[64] = "Time is really the only capital that any human being has, and the one thing that he can't afford to lose.";
   arrSource[64] = "Thomas Edison";
    arrQuote[65] = "Violence can only be concealed by a lie, and the lie can only be maintained by violence.";
   arrSource[65] = "Solzhenitsyn";
    arrQuote[66] = "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.";
   arrSource[66] = "Albert Einstein";
    arrQuote[67] = "The man who does not read good books has no advantage over the man who cannot read them.";
   arrSource[67] = "Mark Twain";
    arrQuote[68] = "What would you attempt to do if you knew you would not fail?";
   arrSource[68] = "Dr Robert Schuller";
    arrQuote[69] = "We judge ourselves by what we feel capable of doing, while others judge us by what we already have done.";
   arrSource[69] = "Longfellow";
    arrQuote[70] = "Lord, grant that I may always desire more than I accomplish.";
   arrSource[70] = "Michelangelo";
    arrQuote[71] = "The trouble with most of us is that we would rather be ruined by praise than saved by criticism.";
   arrSource[71] = "Norman Vincent Peale";
    arrQuote[72] = "You can't hold a man down without staying down with him.";
   arrSource[72] = "Booker T Washington";
    arrQuote[73] = "We have no more right to consume happiness without producing it than to consume wealth without producing it.";
   arrSource[73] = "George Bernard Shaw";
    arrQuote[74] = "Have more than thou showest; Speak less than thou knowest.";
   arrSource[74] = "Shakespeare";
    arrQuote[75] = "The shortest and surest way to live with honor in the world is to be in reality what we appear to be.";
   arrSource[75] = "Socrates";
    arrQuote[76] = "The reason why the Ten Commandments are short and clear is that they were handed down direct, not through several committees.";
   arrSource[76] = "Dan Bennett";
    arrQuote[77] = "The flower that follows the sun does so even on cloudy days.";
   arrSource[77] = "Leighton";
    arrQuote[78] = "The most human thing we can do is comfort the afflicted and afflict the comfortable.";
   arrSource[78] = "Clarence Darrow";
    arrQuote[79] = "Avoid studies of which the result dies with the worker.";
   arrSource[79] = "from the Notebooks of Leonardo Da Vinci";
    arrQuote[80] = "Success is a journey, not a destination.";
   arrSource[80] = "Vince Lombardi";
    arrQuote[81] = "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.";
   arrSource[81] = "Frank Sinatra";
    arrQuote[82] = "The man on top of the mountain didn't fall there.";
   arrSource[82] = "Vince Lombardi";
    arrQuote[83] = "If you would not be forgotten, either write things worth reading or do things worth the writing.";
   arrSource[83] = "Benjamin Franklin";
    arrQuote[84] = "Habit is overcome by habit.";
   arrSource[84] = "Thomas Kempis";
    arrQuote[85] = "Nobody goes there anymore; it's too crowded.";
   arrSource[85] = "Yogi Berra";
    arrQuote[86] = "Thanks, you don't look so hot yourself.";
   arrSource[86] = "Yogi Berra<br />(after being told<br />he looked cool)";
    arrQuote[87] = "Love the giver more than the gift.";
   arrSource[87] = "Brigham Young";
    arrQuote[88] = "Remember, a chip on the shoulder is a sure sign of wood higher up.";
   arrSource[88] = "Brigham Young";
    arrQuote[89] = "Instead of getting married again, I'm going to find a woman I don't like and just give her a house.";
   arrSource[89] = "Steven Seagal";
    arrQuote[90] = "A rich man is nothing but a poor man with money.";
   arrSource[90] = "W C Fields";
    arrQuote[91] = "Never miss a good chance to shut up.";
   arrSource[91] = "Will Rogers";
    arrQuote[92] = "Why does a slight tax increase cost you two hundred dollars and a substantial tax cut saves you thirty cents?";
   arrSource[92] = "Anonymous taxpayer";
    arrQuote[93] = "How is it one careless match can start a forest fire, but it takes an entire box to start a campfire?";
   arrSource[93] = "Anonymous";
    arrQuote[94] = "A fanatic is one who can't change his mind and won't change the subject.";
   arrSource[94] = "Winston Churchill";
    arrQuote[95] = "It's easy to make a buck. It's a lot tougher to make a difference.";
   arrSource[95] = "Tom Brokaw";
    arrQuote[96] = "Time flies like the wind. Fruit flies like bananas.";
   arrSource[96] = "Groucho Marx";
    arrQuote[97] = "As long as algebra is taught in school, there will be prayer in school.";
   arrSource[97] = "Cokie Roberts";
    arrQuote[98] = "Quote me as saying I was mis-quoted.";
   arrSource[98] = "Groucho Marx";
    arrQuote[99] = "Inspiration is a guest who does not like to visit lazy people.";
   arrSource[99] = "Tchaikowsky";
   // these are the ones that funcSelectRandomQuote will randomly choose from when the page first loads...
    arrQuote[100] = "Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did.";
   arrSource[100] = "Mark Twain";
    arrQuote[101] = "Show me a thoroughly satisfied man, and I will show you a failure.";
   arrSource[101] = "Thomas Edison";
    arrQuote[102] = "Sharing money is what gives it its value.";
   arrSource[102] = "Elvis Presley";
    arrQuote[103] = "Goodness is the only investment that never fails.";
   arrSource[103] = "Henry Thoreau";
    arrQuote[104] = "Too many people miss the silver lining because they're expecting gold.";
   arrSource[104] = "Maurice Setter";
    arrQuote[105] = "Experience is the worst teacher; it gives the test before presenting the lesson.";
   arrSource[105] = "Vernon Law";
    arrQuote[106] = "Don't pray when it rains if you don't pray when the sun shines.";
   arrSource[106] = "Satchel Paige";
    arrQuote[107] = "You can get everything you want if you help enough others get what they want.";
   arrSource[107] = "Zig Ziglar";
    arrQuote[108] = "You don't have to be great to get started but you have to get started to be great.";
   arrSource[108] = "Les Brown";
    arrQuote[109] = "The best time to plant a tree is 20 years ago. The second best time to plant a tree is today.";
   arrSource[109] = "African Proverb";
    arrQuote[110] = "You can't turn back the clock, but you can wind it up again.";
   arrSource[110] = "Bonnie Prudden";
    arrQuote[111] = "The more you have to live for, the less you need to live on. Those who make acquisition their goal never have enough.";
   arrSource[111] = "Sydney Harris";
    arrQuote[112] = "Research is the process of going up alleys to see if they are blind.";
   arrSource[112] = "Marston Bates";
    arrQuote[113] = "Everything comes to him that hustles while he waits.";
   arrSource[113] = "Thomas Edison";
    arrQuote[114] = "I like my way of doing things better than your way of not doing them.";
   arrSource[114] = "D L Moody";
    arrQuote[115] = "Not everything that can be counted counts, and not everything that counts can be counted.";
   arrSource[115] = "Albert Einstein";
    arrQuote[116] = "We tire of those pleasures we take, but never of those we give.";
   arrSource[116] = "J Petit-Senn";
    arrQuote[117] = "The man who makes no mistakes does not usually make anything.";
   arrSource[117] = "Edward J Phelps";
    arrQuote[118] = "It is amazing what you can accomplish if you do not care who gets the credit.";
   arrSource[118] = "Harry Truman";
    arrQuote[119] = "People expect too much of one year and too little of ten.";
   arrSource[119] = "George Bernard Shaw";
    arrQuote[120] = "It is not real work unless you would rather be doing something else.";
   arrSource[120] = "J M Barrie";
   // more can be added here...
    arrQuote[121] = "Today the greatest single source of wealth is between your ears.";
   arrSource[121] = "Brian Tracy";
    arrQuote[122] = "Don't judge each day by the harvest you reap, but by the seeds you plant.";
   arrSource[122] = "Robert Louis Stevenson";
    arrQuote[123] = "What lies behind us and what lies before us are tiny matters compared to what lies within us.";
   arrSource[123] = "Ralph Waldo Emerson";
    arrQuote[124] = "It ain't what a man don't know that makes him a fool, but what he does knows that ain't so.";
   arrSource[124] = "Josh Billings";
    arrQuote[125] = "It ain't the size of the dog in the fight that counts, but rather the size of the fight in the dog.";
   arrSource[125] = "Will James";
    arrQuote[126] = "All that we are is a result of what we have thought.";
   arrSource[126] = "Buddha<br />(563-483 BC)";
    arrQuote[127] = "The Lord gave us two ends - one to sit on and the other to think with. Success depends on which one we use the most.";
   arrSource[127] = "Ann Landers";
    arrQuote[128] = "The measure of success is not whether you have a tough problem to deal with, but whether it is the same problem you had last year.";
   arrSource[128] = "John Foster Dulles";
    arrQuote[129] = "Successful people make money. It's not that people who make money become successful, but that successful people attract money. They bring success to what they do.";
   arrSource[129] = "Wayne Dyer";
    arrQuote[130] = "Many a man owes his success to his first wife and his second wife to his success.";
   arrSource[130] = "Jim Backus";
   //
   for (numQuoteCount=1; numQuoteCount<arrQuote.length; numQuoteCount++) {
      arrQuoted[numQuoteCount] = false;
   }
   numTotalQuotes = arrQuote.length - 1;
   numUnshownQuotes = arrQuote.length - 1;
}
// end funcBuildQuoteArray()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ funcDisplayQuote()
function funcDisplayQuote() {
   if (boolIsIEmac) {
      return;
   } else {
      document.write('<table width="120" border="0" cellspacing="0" cellpadding="0" style="background-color:#eee8cc; border:2px solid #b1a800;">\n');
      document.write('   <tr><td align="center" class="qqHeading" id="thoughtHeading">'+strQuoteHeading+'</td></tr>\n');
      document.write('   <tr><td><img src="gfx/spacer.gif" width="120" height="6" border="0" alt="" /></td></tr>\n');
      document.write('   <tr><td width="120" class="qqBody" id="thoughtBody">&#147;'+strQuote+'&#148;</td></tr>\n');
      document.write('   <tr><td><img src="gfx/spacer.gif" width="120" height="6" border="0" alt="" /></td></tr>\n');
      document.write('   <tr><td width="120" class="qqBodyTag" id="thoughtSource">&#8212; '+strQuoteSource+'</td></tr>\n');
      document.write('   <tr><td><img src="gfx/spacer.gif" width="120" height="6" border="0" alt="" /></td></tr>\n');
      document.write('</table>\n');
   }
}
// end funcDisplayQuote()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ funcSelectRandomQuote()
function funcSelectRandomQuote() {
   if (boolInitQuote == true) {
      var numLowEnd = 100;//the first of the initial quotes
      var numHighEnd = 120;//the last of the initial quotes
      var numRange = ((numHighEnd - numLowEnd)+1);
      var numFirstQuote = randomNumber(1,numRange);
      numQuote = numFirstQuote+(numLowEnd-1);
      boolInitQuote = false;
   } else {
      numQuote = randomNumber(1,numTotalQuotes);
   }
   if (arrQuoted[numQuote] == false) {
      arrQuoted[numQuote] = true;
      numUnshownQuotes = numUnshownQuotes - 1;
   } else {
      boolUniqueNumberSelected = false;
      while (boolUniqueNumberSelected == false) {
         numQuote = randomNumber(1,numTotalQuotes);
         if (arrQuoted[numQuote] == false) {
            boolUniqueNumberSelected = true;
            arrQuoted[numQuote] = true;
            numUnshownQuotes = numUnshownQuotes - 1;
         }
      }
   }
   strQuote = arrQuote[numQuote];
   strQuoteSource = arrSource[numQuote];
   if ((numQuote >= 1)&&(numQuote <= 19)) {
      strQuoteHeading = "Quotable Quotes";
   } else if ((numQuote >= 20)&&(numQuote <= 30)) {
      strQuoteHeading = "Mis-Predictions";
   } else if ((numQuote >= 31)&&(numQuote <= numTotalQuotes)) {
      strQuoteHeading = "Quotable Quotes";
   }
}// end funcSelectRandomQuote()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ funcSelectAgain()
function funcSelectAgain() {
   // select another random quote...
   if (numUnshownQuotes > (numTotalQuotes/4)) {
      funcSelectRandomQuote();
   } else {
      //alert("Three quarters of the "+numTotalQuotes+" quotes have been shown.\r\rThe array will now be re-populated.");
      for (numQuoteCount=1; numQuoteCount<arrQuote.length; numQuoteCount++) {
         arrQuoted[numQuoteCount] = false;
      }
      numTotalQuotes = arrQuote.length - 1;
      numUnshownQuotes = arrQuote.length - 1;
      funcSelectRandomQuote();
   }
   if (document.getElementById) {
      document.getElementById("thoughtHeading").innerHTML = strQuoteHeading;
      document.getElementById("thoughtBody").innerHTML = "&#147;"+strQuote+"&#148;";
      document.getElementById("thoughtSource").innerHTML = "&#8212; "+strQuoteSource;
   } else {
      alert("Your browser will not properly implement this feature.");
   }
}// end funcSelectAgain()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~