
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 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', '004100', '00FF33', 300, 300);
fader[2].msg[1] = "Annual Day on March 7,2010";
fader[2].msg[2] = "Holiday Good Friday on April 2,2010";
fader[2].msg[3] = "School remain closed on April 02, 2010";
fader[2].msg[4] = "Registeration Open";

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


