/* *****
 * 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 fader = new Array();

var hash = new Array();
function throb(item) {

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

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

  // If we have exceeded the number of messages in this fader, start over again at fader array number
  if (++hash[item] > fader[item].msg.length * 2 - 1) hash[item] = 0;
}

fader[0] = new fadeObject('fade1', '20316a', 'fad364', 60, 60);

//repeat lines many times over and over to have a more continual effect as when the array ends there is a pause until restarting
fader[0].msg[0] = "<br /><br /><br /><br /><br /><br /><br /><font style=\"font-family: Arial; font-weight: normal; font-size: 15px;\"><b>&quot;We have found SMP's<br />&nbsp;professionalism to be<br />&nbsp;at the very highest<br />&nbsp;standards and we view<br />&nbsp;them as part of our<br />&nbsp;team.&quot;<br /><br /></b></font><font face\"Arial Narrow\" style=\"font-size: 10px;\">&nbsp;&nbsp;Sr Manager, Channel Marketing<br />&nbsp;&nbsp;Comsumer Electronics Channel Supplier</font>";
fader[0].msg[1] = "<br /><br /><br /><br /><font style=\"font-family: Arial; font-weight: normal; font-size: 15px;\"><b>&quot;Our grocery program<br />&nbsp;is extremely important<br />&nbsp;and I can honestly say<br />&nbsp;that it would not have<br />&nbsp;been as successful as<br />&nbsp;it is without SMP. They<br />&nbsp;helped design the<br />&nbsp;program from the first<br />&nbsp;day and have really<br />&nbsp;made an impact for our<br />&nbsp;company.&quot;<br /><br /></b><font face\"Arial Narrow\" style=\"font-size: 10px;\">&nbsp;&nbsp;Executive Director, Retail Merchandising<br />&nbsp;&nbsp;Grocery Channel Supplier</font>";
fader[0].msg[2] = "<br /><br /><br /><br /><br /><br /><font style=\"font-family: Arial; font-weight: normal; font-size: 15px;\"><b>&quot;I am confident that<br />&nbsp;SMP was a major<br />&nbsp;contributor to our<br />&nbsp;success last season.<br />&nbsp;It was our biggest sales<br />&nbsp;performance season<br />&nbsp;ever with the largest unit<br />&nbsp;growth rate in 7 years.&quot;<br /><br /></b><font face\"Arial Narrow\" style=\"font-size: 10px;\">&nbsp;&nbsp;Vice President, Sales and Distribution<br />&nbsp;&nbsp;High Tech Channel Supplier</font>";

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