function rotateText(el, textGroup) {
  setOpacity(el, 0);
  var t = rotateText.texts[textGroup];
  var t = t[Math.floor(Math.random() * (t.length))];
  el.innerHTML = t;
  unfadeText(el, textGroup);
}
rotateText.texts = {
  quotes: [
    "<p class=\"quoteText\">\"<em>MESA helps us fulfill our commitment to excellence and equity in education for all of California students.<br>We are proud to serve as the statewide home for this innovative and effective program.</em>\"<br>- <strong>President Mark Yudof, University of California</strong></p>",
	"<p class=\"quoteText\">\"<em>I am extremely proud of the results that the MESA community college program has achieved.</em>\"<br>– <strong>Chancellor Jack Scott, California Community Colleges</strong></p>",
	"<p class=\"quoteText\">\"<em>The MESA program is a critical component of the CSU\'s outreach efforts to get<br>underserved students to take and master math and science classes.</em>\"<br>– <strong>Chancellor Charles B. Reed, California State University</strong></p>",
	"<p class=\"quoteText\">\"<em>MESA provides the right mix of tools<br>to help students achieve in some of the most critical areas of study.</em>\"<br>– <strong>Jonathan Brown, President Association of Independent California Colleges and Universities</strong></p>",
	"<p class=\"quoteText\">\"<em>MESA is a shining example of how educators, from primary to postsecondary,<br>can form partnerships to work toward closing the achievement gap.</em>\"<br>– <strong>Jack O\' Connell, State Superintendent of Public Instruction</strong></p>"
/*    '<p class="quoteText">"<em>Quote 4</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>',
    '<p class="quoteText">"<em>Quote 5</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>',
    '<p class="quoteText">"<em>Quote 6</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>',
    '<p class="quoteText">"<em>Quote 7</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>',
    '<p class="quoteText">"<em>Quote 8</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>',
    '<p class="quoteText">"<em>Quote 9</em>"<br>- <strong>President Mark Yudof, University of California</strong></p>'	*/
  ]
};

function setOpacity(el, value) {
  el.style.opacity = value / 100;
  el.style.filter = "alpha(opacity=" + value + ")";
}

function unfadeText(el, tg) {
  var v = el.style.opacity * 100 + 1;
  if(v > 100) {
    setOpacity(el, 100);
    setTimeout(bundleFunction(null, fadeText, [el, tg]), 15000); // 15 seconds
    return;
  }
  setOpacity(el, v);
  setTimeout(bundleFunction(null, unfadeText, [el, tg]), 10);
}

function fadeText(el, tg) {
  var v = el.style.opacity * 100 - 1;
  if(v < 0) {
    setOpacity(el, 0);
    rotateText(el, tg);
    //or... setTimeout(bundleFunction(null, rotateText, [el, tg]), NUMBER);
    return;
  }
  setOpacity(el, v);
  setTimeout(bundleFunction(null, fadeText, [el, tg]), 10);
}

function bundleFunction(context, func, args) {
  context = context || null;
  if(typeof func == "string" && context)
    func = context[func];
  if(!args)
    args = [];
  else if(!(args instanceof Array))
    args = [args];
  return function() {
    return func.apply(context, args);
  };
}