// define functions for page
function Testimonial(_member, _age, _link, _linktext, _image) { 
  if (_member)    	this.member    	= _member; 
  if (_age)    		this.age    	= _age; 
  if (_link)    	this.link    	= _link; 
  if (_linktext)    this.linktext	= _linktext; 
  if (_image) 		this.image 		= _image; 
} 

Testimonial.prototype.MEMBER    = function() { return this.member;    } 
Testimonial.prototype.AGE    = function() { return this.age;    } 
Testimonial.prototype.LINK    = function() { return this.link;    } 
Testimonial.prototype.LINKTEXT = function() { return this.linktext; } 
Testimonial.prototype.IMAGE  = function() { return this.image;  } 

function cycleTestimonial() {
	if (++_which > myTestimonial.length-1) _which=1;
    loadTestimonial();
    window.setTimeout('cycleTestimonial();',10000); // 1000 = 1 SECOND, 10000 = 10 SECONDS
}

function returnObjById( id )
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

function loadTestimonial() {
	_textOutput  = '';
	_textOutput += '<h3>Member Spotlight</h3><p>' + myTestimonial[_which].MEMBER() + (myTestimonial[_which].AGE() ? ', age ' + myTestimonial[_which].AGE() : '') + '</p>';
	_textOutput += '<p><a target="_blank" href="' + myTestimonial[_which].LINK() + '">' + myTestimonial[_which].LINKTEXT() + '</a></p>'; 
    
	_imageOutput = '';
	_imageOutput += '<a target="_blank" href="' + myTestimonial[_which].LINK() + '"><img src="' + myTestimonial[_which].IMAGE() + '" alt="photos" /></a>';

	var x = returnObjById('testimonial-text');
	x.innerHTML = _textOutput;
	var y = returnObjById('testimonial-image');
	y.innerHTML = _imageOutput;
}

var _which=0;
var _textOutput  = '';
var _imageOutput = '';

var myTestimonial = new Array(); 
// end of functions - DO NOT ALTER ABOVE HERE

// define testimonial data here
myTestimonial[0] = new Testimonial("member","age","link","linktext","image"); // DUMMY FIRST ONE
myTestimonial[1] = new Testimonial("Bouthsara","","http://www.acne.org/regimen-before-after.html#bouthsara","View photos","images/beforeafter1.gif");
myTestimonial[2] = new Testimonial("Tevelision","27","http://www.acne.org/regimen-before-after.html#tevelision","View photos","images/beforeafter2.gif");
myTestimonial[3] = new Testimonial("Sharpshot201","","http://www.acne.org/regimen-before-after.html#sharpshot201","View photos","images/beforeafter3.gif");
myTestimonial[4] = new Testimonial("Soul","20","http://www.acne.org/regimen-before-after.html#soul","View photos","images/beforeafter4.gif");
myTestimonial[5] = new Testimonial("Star Logic","19","http://www.acne.org/regimen-before-after.html#starlogic","View photos","images/beforeafter5.gif");
myTestimonial[6] = new Testimonial("Celebration","","http://www.acne.org/regimen-before-after.html#celebration","View photos","images/beforeafter6.gif");
myTestimonial[7] = new Testimonial("Clueless99","25","http://www.acne.org/regimen-before-after.html#clueless99","View photos","images/beforeafter7.gif");
myTestimonial[8] = new Testimonial("Danjapan","","http://www.acne.org/regimen-before-after.html#danjapan","View photos","images/beforeafter8.gif");
myTestimonial[9] = new Testimonial("pandasofdoom","","http://www.acne.org/regimen-before-after.html#pandasofdoom","View photos","images/beforeafter9.gif");
myTestimonial[10] = new Testimonial("Michelle","","http://www.acne.org/regimen-before-after.html#mich","View photos","images/beforeafter11.gif");
myTestimonial[11] = new Testimonial("Jennifer","","http://www.acne.org/regimen-before-after.html#jenn","View photos","images/beforeafter10.gif");
myTestimonial[12] = new Testimonial("caffeinefree","","http://www.acne.org/regimen-before-after.html#caffeinefree","View photos","images/beforeafter12.gif");