var quotes = new Array();

quotes[0] = "<blockquote>The pong balls turned out great and my boyfriend is gonna freak out when he gets them for Christmas! Thanks again! :) <cite>- Kimberly, Baltimore MD</cite></blockquote>";
quotes[1] = "<blockquote>Just placed an order on the 20th and already got them in the mail today (less than a week later... awesome)! <cite> - Kimberly, Baltimore MD</cite></blockquote>";
quotes[2] = "<blockquote>THANKS, the balls look amazing! :) I didn't expect the image to have such a great look or the high quality of the balls. Absolutely fantastic! I'm definitely using Adams Balls again!! <cite> - Melissa CT</cite></blockquote>";
quotes[3] = "<blockquote>I just wanted to say thanks i got my balls the other day and they are f!#%$g great!!!!!!!!! <cite> - Joshua, Salem MA</cite></blockquote>";
quotes[4] = "<blockquote>The product is great. Thanks again for the help. <cite> - Spencer, Virginia</cite></blockquote>";
quotes[5] = "<blockquote>That's awesome! [...] Thanks so much, the balls look great! <cite> - Chrissy, Michigan</cite></blockquote>";
quotes[6] = "<blockquote>AWESOME!!! These \"stocking stuffers\" are sure to be a hit this year! thanks for the prompt response.. <cite> - Kelly, Rockville MD</cite></blockquote>";
quotes[7] = "<blockquote>Thank you so much....you have made my day!!!!!!!!!!!  Ashley will love them! <cite> - Dawn, Marlton NJ</cite></blockquote>";
quotes[8] = "<blockquote>perfect! thanks so much for all your help. <cite> - Jess</cite></blockquote>";
quotes[9] = "<blockquote>Thank you so much for your help in redesigning the ball.  I love it. <cite> - Margot, New York NY</cite></blockquote>";
quotes[10] = "<blockquote>received them friday and they're perfect. thanks again. I'll definitely stay in touch and plan to buy more from you guys at some point. <cite> - Alex, New York NY</cite></blockquote>";
quotes[11] = "<blockquote>thanks so much for your help with this!  I know she'll get a huge kick out of it! <cite> - Alex, Atlanta GA</cite></blockquote>";
quotes[12] = "<blockquote>awesome <cite> - Zachary, Narberth PA</cite></blockquote>";
quotes[13] = "<blockquote>your balls were quite the hit at our X-mas party <cite> - Johnal, Costa Mesa CA</cite></blockquote>";
quotes[14] = "<blockquote>sweet!! <cite> - Ryan, Las Vegas NV</cite></blockquote>";
quotes[15] = "<blockquote>It looks awesome!  Thank so much!! <cite> - Alyssa, Sunnyvale CA</cite></blockquote>";
quotes[16] = "<blockquote>PERFECT!  Thank you so much. <cite> - Christina, Dallas TX</cite></blockquote>";
quotes[17] = "<blockquote>Got your balls! they are AWESOME! <cite> - Amir, CollegeHumor.com</cite></blockquote>";
quotes[18] = "<blockquote>SHUT UP and SHUT UP!! there is no way you already printed our balls.  you're joking right??  <cite> - We weren't - Morganne, San Francisco CA</cite></blockquote>";
quotes[19] = "<blockquote>Just wanted to let you know everyone has loved your balls. <cite> - Eric, Fresno CA</cite></blockquote>";
quotes[20] = "<blockquote>just wanted to let you know that we got our balls in and they look great!! Awesome job and thanks so much!  <cite> - Camron, Dallas TX</cite></blockquote>";
quotes[21] = "<blockquote>They look freaking sweet! Thanks!!! :)  <cite> - Marianne, Pylesville MD</cite></blockquote>";
quotes[22] = "<blockquote>Thanks, you guys are awesome. Top notch!  <cite> - Bruce, Dublin VA</cite></blockquote>";
quotes[23] = "<blockquote>I got them! They look great!  <cite> - Adam, New York NY</cite></blockquote>";
quotes[24] = "<blockquote>They look freaking sweet! Thanks!!! :)  <cite> - Marianne, Pylesville MD</cite></blockquote>";
quotes[25] = "<blockquote>Does this mean my order is completed, balls printed and out the door on their way to me? All i can say is, THATS AWESOME!  <cite> - Damon, Indianapolis IN</cite></blockquote>";
quotes[26] = "<blockquote>Just received them and they look great!!  Thanks for getting them to me so quickly.  <cite> - Drew, Baltimore MD</cite></blockquote>";
quotes[27] = "<blockquote>I chose to go with [a competitor site] [...] However that was a mistake because the logo on the balls is tiny, bad quality, has a glossy feel on the logo while the rest of the ball is fine and the worst part is there's a japanese logo of the brand who makes the ball.  <cite> - An Unfortunate Consumer</cite></blockquote>";
quotes[28] = "<blockquote>Thanks for all your help, you guys have really good customer service.  <cite> - Jayme, Calgary Canada</cite></blockquote>";
quotes[29] = "<blockquote>We ordered ping pong balls from [a competitor site] and was not pleased with the balls once received.  They looked cheap and very sad. Your balls turned out GREAT.  Wonderful job and we will definitely be back for more.   <cite> - Karen, Frederick MD</cite></blockquote>";
quotes[30] = "<blockquote>Oh my gosh, those look sweet!!! Thank you so much! I especially want to thank you for getting back to me so quickly. I\'ve already placed my order. Thanks again!   <cite> - Melissa, Indianapolis IN</cite></blockquote>";
quotes[31] = "<blockquote>WOW...that looks amazing!  Thank you so much...I love it.   <cite> - Trisha, Southgate MI</cite></blockquote>";
quotes[32] = "<blockquote>I\'ll never play with any other balls ever again.   <cite> - Joey, Waldorf MD</cite></blockquote>";

var duration = 1000;
var steps = 20;
var delay = 5000;

function getElement(id, doc) {
	if((id)&&((typeof id == "string")||(id instanceof String))){
		if (!doc) { doc = document; }
			var ele = doc.getElementById(id);
			if (ele && (ele.id != id) && doc.all) {
				ele = null;
				eles = doc.all[id];
				if (eles) {
					if (eles.length) {
						for (var i=0; i < eles.length; i++) {
							if (eles[i].id == id) {
								ele = eles[i];
								break;
							}
						}
					} else {
						ele = eles;
					}
				}
			}
		return ele;
	}
	return id;
}

function rotate() {
	var testimonial = getElement('testimonial');
	testimonial.innerHTML = quotes[Math.floor(Math.random()*quotes.length)];
}

/* set the opacity of the element (between 0.0 and 1.0) */
function setOpacity(level) {
	var testimonial = getElement('testimonial');
	
  testimonial.style.opacity = level;
  testimonial.style.MozOpacity = level;
  testimonial.style.KhtmlOpacity = level;
  testimonial.style.filter = "alpha(opacity=" + (level * 100) + ");";
}

function fadeIn(){
  var testimonial = getElement('testimonial');
  
  if (testimonial) {
	  for (i = 0; i <= 1; i += (1 / steps)) {
	    setTimeout("setOpacity(" + i + ")", i * duration);
	  }
	  rotate();
	  setOpacity(0);
	  setTimeout("fadeOut()", delay);
	}
}

function fadeOut() {
  for (i = 0; i <= 1; i += (1 / steps)) {
    setTimeout("setOpacity(" + (1 - i) + ")", i * duration);
  }
  setTimeout("fadeIn()", duration);
}