/* *****
 * 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 : 20000);

  // 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[0] = "'In 1999, your firm was hired to automate my company's accounting department by implementing an accounting system. After this task was completed in a timely and cost effective manner, you continued providing us with training for the system. Since you applied considerable technical expertise along with a creative and practical approach to the many issues that my company currently faces, we've asked you for many more services such as accounting, consulting, payroll, quarterly maintenance and year-end support, which have proven invaluable. I won't hesitate to recommend your firm as one of the best I've worked with.'<br /><br /><em>-<strong>Leslie B. Park</strong><br />Universal Travel Services, Inc.</em>";
fader[2].msg[1] = "'When we met with Pereira Enterprises, we were drowning in confusion with a previous accountant who was throwing up his hands and unable to manage, or make sense of, our Design Manager software. That accountant's solution was to start over with a different system, but we were reluctant to give up years of data carefully entered into our existing system. Steuart and his team specialize in our designer software, they methodically cleaned up and reorganized what we had, and they made our procedures more efficient. With team training and personalized service, we improved our entire accounting operation. I have since referred him to my close friend and colleague and have a sense of relief when it comes to anything related to accounting.'<br /><br /><em>-<strong>Liz Levin, Principal</strong><br />Liz Levin Interiors</em>";
fader[2].msg[2] = "'We have been using Pereira Enterprises, Inc. since 1998 as our sole 'in-house' accountant. The complexities of running a business are great and keeping track of the hundreds of transactions we do annually is complicated. Your maintenance of our accounting records gives me 100% confidence that my numbers are correct at all times.'<br /><br /><em>-<strong>P. Michael Greenwald, Owner</strong><br />Personalized Travel, Inc.</em>";
fader[2].msg[3] = "'Pereira Enterprises has provided us with fundamental training that we wish we had had before we ever touched Design Manager. Because of their experience with multi-faceted and large scale design projects, they bring to the table 'best practices' in accounting and design management. In addition, they want me to be a profitable thriving business. They challenge me to think about the way I run my business, what my profit margins are, how I structure my contracts, etc. I can't recommend them enough. I wouldn't dream of starting with Design Manager without the assistance of Pereira Enterprises, Inc.'<br /><br /><em>-<strong>Heidi Scanlon, Principal</strong><br />Color Drenched Interiors</em>";
fader[2].msg[4] = "'Your consulting and accounting services allowed my company to modernize and efficiently organize its financial tracking and accounting systems at a critical juncture. I am grateful to you for your eminent professionalism, your high level of attention to detail, and your devotion to assessing and filling the financial needs of my company.'<br /><br /><em>-<strong>Bruno M. Damiani, President</strong><br />Brumar Communications Corporation</em>";

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