/* *****
 * 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 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] = "<span onclick='showPage(1);'>AgreeYa Solutions Named in Top 500 Diversity Owned Businesses in the US</span>";
fader[2].msg[2] = "<span onclick='showPage(2);'>AgreeYa Solutions Recertified as Microsoft Gold Partner for 5th Consecutive Year</span>";
fader[2].msg[3] = "<span onclick='showPage(3);'>AgreeYa Solutions Awarded Two-Year IT Staffing Contract with the State of Texas</span>";
fader[2].msg[4] = "<span onclick='showPage(4);'>AgreeYa Solutions Exhibits at JiveWorld Conference in San Francisco</span>";
fader[2].msg[5] = "<span onclick='showPage(5);'>AgreeYa Solutions is 2nd largest certified WBE in Sacramento region</span>";
fader[2].msg[6] = "<span onclick='showPage(6);'>AgreeYa Solutions Expands to Bangladesh with 4th Global Delivery Center</span>";
// Start this fader
setTimeout(function() { throb(2); }, 1000);


function showPage(id){
	if(id==1){
		document.location.href='news_diversityAward.shtml';
	}
	if(id==2){
		document.location.href='news_MicroGP.shtml';
	}
	if(id==3){
		document.location.href='news_TexasITSA.shtml';
	}
	if(id==4){
		document.location.href='news_JiveW_Conf.shtml';
	}
	if(id==5){
		document.location.href='news_Sac_WBE.shtml';
	}
	if(id==6){
		document.location.href='news_bangladesh_gdc.shtml';
	}
}