
function randomMessage()
{
  var message=new Array(4)
    message[0] = "I have total admiration for the extremely high quality of this program, its production quality, its breadth of content, and its value as an educational tool.<span>William M. Green, MD, FACEP<br /> Co-chair<br /> Section of Forensic Medicine<br /> American College of Physicians</span>";
    message[1] = "The pre-trial preparation was very useful. The court scenes show what it's like to be questioned by a defense attorney who's asking some difficult questions. I thought all the material and the way it was presented was excellent!<span>Jolene M. Culbertson, ARNP,  SANE-P<br /> SANE Coordinator<br /> Harrison Medical Center<br /> Bremerton, Washington</span>";
    message[2] = "This is a fantastic training and educational tool – incredible. Many, many thanks for the opportunity.<span>U.S. Army beta test participant</span>"
    message[3] = "Thanks so much for all the help you will be giving the SANE community with this sexual assault forensic program. It's wonderful.<span>Diana Faugno RN, MSN, CPN, FAAFS, SANE-A, SANE-P<br /> Forensic Nurse Consultant<br /> Board Director, EVAW International</span>"
    
  var index = Math.floor( Math.random() * message.length );
  return( message[index] );

}

function nextMessage() {

  var msgbox = $("#testimonialbox p").get(0);
  var oldMessage = $(msgbox).html();
  var newMessage = randomMessage();

  while ( newMessage == oldMessage ) {
    newMessage = randomMessage();
  }

  /* Define the viewing time for this message
  allow 6/100 second for each character
  but not less than 3 seconds nor more
  than 15 seconds */

  var sleepTime = 0.06 * newMessage.length;
  if ( sleepTime < 3 ) { sleepTime = 3; }
  if ( sleepTime > 20 ) { sleepTime = 20; }

  sleepTime = Math.round(sleepTime * 1000);
  $(msgbox).fadeOut('slow', function() {
    $(msgbox).html( newMessage ).fadeIn('slow');
  });

  /* Just before we finish, set a timer for
  changing the message again in a bit.  */
  return window.setTimeout('nextMessage();', sleepTime);

}

$(document).ready(function() {
  var t = nextMessage();
});

