/*
    Document   : testimonials.js
    Created on : July 20, 2010
    Author     : M. Bradley t/a Productive Inbox
    Description:
        Text change system using Javascript
*/

var m_FadeWait = 4000;
var m_textInterval;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;

window.onload = startProcess;

function startProcess() {
  m_textInterval = setInterval(change_ontimer, m_FadeWait);
  arrFadeTitles = new Array();
  setupText();
  arrFadeMax = arrFadeTitles.length;
  setText();
}

function setText() {
  var ilink = document.getElementById("text_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
}

function change_ontimer() {
    arrFadeCursor++;

    if (arrFadeCursor>=arrFadeMax)
        arrFadeCursor=0;
    setText();
}

function setupText() {
  arrFadeTitles[0] = "&quot;Just wanted to say a big thank you for the fantastic job you have done with my bouquet&quot;";
  arrFadeTitles[1] = "&quot;We are very pleased with the final framed flowers, they are very well displayed, together with the picture and verse.&quot;";
  arrFadeTitles[2] = "&quot;I just wanted to drop you a wee line to say how much I love the flowers, they are beautiful!&quot;";
  arrFadeTitles[3] = "&quot;Just wanted to say a big thank you for the fantastic job you have done with my bouquet&quot;";
}
