/* *****
 * User defined fade objects and messages
 *
 * These messages are used in fades triggered by mouseovers and
 * mouseouts on table cells.  They are the simplest type of fade and
 * require no extra Javascript code.
 */
var fader = new Array();

fader[0] = new fadeObject('fade0', 'dddddd', '000000', 20, 20);
fader[0].msg[0] = "This is an optional default message; the fade object on the right side has no default.  Mouseover each topic to make quotes fade in and out.";
fader[0].msg[1] = "Nowhere can a man find a quieter or more untroubled retreat than in his own soul.<br />- Marcus Aurelius";
fader[0].msg[2] = "Feeding the starving poor only increases their number.<br />- Ben Bova";
fader[0].msg[3] = "The limits of tyrants are prescribed by the endurance of those whom they oppose.<br />- Frederick Douglass";
fader[0].msg[4] = "The foolish man seeks happiness in the distance, the wise grows it under his feet.<br />- James Oppenheim";

fader[1] = new fadeObject('fade1', 'bbbbbb', '000000', 20, 20);
fader[1].msg[1] = "Success is relative. It is what we can make of the mess we have made of things.<br />- T.S. Eliot";
fader[1].msg[2] = "We have two ears and one mouth so we may listen more and talk the less.<br />- Epictetus";
fader[1].msg[3] = "It is better to be violent, if there is violence in our hearts, than to put on the cloak of nonviolence to cover impotence.<br />- Mahatma Gandhi";
fader[1].msg[4] = "Don't part with your illusions. When they are gone you may still exist, but you have ceased to live.<br />- Mark Twain";



/* *****
 * The code below describes how to make a throbbing or automatic fade
 * sequence of messages.  It is important to note that this function is
 * NOT part of the Buffered Text-Fade Effect, but merely an example of
 * how it can be used.  In this example, the throb() function controls
 * the commands which are sent to the fade engine; it is called
 * repeatedly at set time intervals rather than using mouseover events
 * as triggers.
 *
 * Notes:
 * - A global array "hash" is used to keep track of where each
 *   animation is currently in the sequence.
 * - The list of messages defined in the fader *must* start at one (1)
 *   and count upwards without skipping any integers.
 * - The third line of the throb() function controls how fast
 *   commands get sent to the fade engine.  It waits only 100 milli-
 *   seconds when fading out, but 5000 milliseconds (5 seconds) when
 *   fading in; this means the message will remain visible for about 5
 *   seconds before fading out again.
 *
 * Other types of fade animation are possible simply by designing
 * different ways to control the fade-ins and fade-outs!
 */
var hash = new Array();
function throb(item) {

  // If the hash array does not have an entry for this item, initialise it at 2
  if (!hash[item]) hash[item] = 2;

  // Send a fade command, using the hash array to tell us what parameters we should use
  fader[item].fade(Math.floor(hash[item] / 2), !(hash[item] % 2));

  // Call this function again for this same item after a certain amount of time
  setTimeout(function() { throb(item); }, (hash[item] % 2) ? 100 : 5000);

  // If we have exceeded the number of messages in this fader, start over again at 2
  if (++hash[item] > fader[item].msg.length * 2 - 1) hash[item] = 2;
}

fader[2] = new fadeObject('fade2', 'bbbbbb', '000000', 30, 30);
fader[2].msg[1] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>Each problem that I solved became a rule which served afterwards to solve other problems.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Rene Descartes (1596-1650), \"Discours de la Methode\"</h4>";

fader[2].msg[2] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>There are no facts, only interpretations.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Friedrich Nietzsche (1844-1900)</h4>";

fader[2].msg[3] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>The power of accurate observation is frequently called cynicism by those who don't have it.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- George Bernard Shaw (1856-1950)</h4>";

fader[2].msg[4] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>The significant problems we face cannot be solved at the same level of thinking we were at when we created them.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Albert Einstein (1879-1955)</h4>";

fader[2].msg[5] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>Obstacles are those frightful things you see when you take your eyes off your goal.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Henry Ford (1863-1947)</h4>";

fader[2].msg[6] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>A market is never saturated with a good product, but it is very quickly saturated with a bad one.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Henry Ford</h4>";

fader[2].msg[7] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>This may seem simple, but you need to give customers what they want, not what you think they want. And, if you do this, people will keep coming back.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- John Ilhan</h4>";

fader[2].msg[8] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime. Teach a man to create an artificial shortage of fish and he will eat steak.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Jay Leno</h4>";

fader[2].msg[9] = "<h4><em><span style='font-size: 11pt; line-height: 115%; color: #444444;'><span style='padding-left: 3px;'><img alt='' height='26' width='29' src='images/quotes-start.gif' /></span>The aim of marketing is to know and understand the customer so well that the product or service fits him or her and sells itself.</span></em><img alt='' height='27' width='35' src='images/quotes-ends.gif' style='vertical-align: top;'/><br /><br />- Peter Drucker</h4>";

// Start this fader
setTimeout(function() { throb(2); }, 1000);
