/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com */

function setupFadeLinks() {
  arrFadeLinks[0] = "&quot;It&rsquo;s good to work with a company that is enthusiastic and has the ability to do the job.&quot;";
  arrFadeTitles[0] = "Charlie Russell, Crew Chief and Carpenter";
  arrFadeLinks[1] = "&quot;Our supervisor on site was very pleased with the lads yesterday and said how very well they worked.&quot;";
  arrFadeTitles[1] = "Media Structures";
  arrFadeLinks[2] = "&quot;Many thanks for finding extra crew at such short notice. Much appreciated.&quot;";
  arrFadeTitles[2] = "Karavelle";
  arrFadeLinks[3] = "&quot;Your guys were first class and a friendly bunch.&quot;";
  arrFadeTitles[3] = "Bower Wood Production Services";
  arrFadeLinks[4] = "&quot;Our decision to use your services in favour of our tried and tested crew was not taken lightly but we have been genuinely impressed. The professionalism, coupled with the excellent backup service have proved to be a winning combination.&quot;";
  arrFadeTitles[4] = "Spice Lumb";
  arrFadeLinks[5] = "&quot;Just wanted to say that your guys were brilliant over the weekend.&quot;";
  arrFadeTitles[5] = "Logistik";
  arrFadeLinks[6] = "&quot;It has been a great pleasure to work for Show Support Services. The crew are excellent and we all work together as a team.&quot;";
  arrFadeTitles[6] = "Tyrone Goodliffe, Labourer";
  arrFadeLinks[7] = "&quot;Just to say thank you, excellent crew.&quot;";
  arrFadeTitles[7] = "Spice Lumb";
  arrFadeLinks[8] = "&quot;Many thanks for your quick response again in getting a team together at short notice.&quot;";
  arrFadeTitles[8] = "ARB Audio Visual Hire";
  arrFadeLinks[9] = "&quot;It has been an absolute pleasure to work for you these last few years&quot;";
  arrFadeTitles[9] = "Mark Beaton, Crew Chief";
}

// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.

var m_FadeOut = 211;
var m_FadeIn=0;
var m_Fade = 4;
var m_FadeStep = 3;
var m_FadeWait = 2500;
var m_bFadeOut = true;

var m_iFadeInterval;

//window.onload = Fadewl;

var arrFadeLinks;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;

function Fadewl() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
  arrFadeLinks = new Array();
  arrFadeTitles = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
}

function setFadeLink() {
  var ilink = document.getElementById("dynamic_quotes");
  var icompany = document.getElementById("dynamic_company");
  ilink.innerHTML = arrFadeLinks[arrFadeCursor];
  icompany.innerHTML = arrFadeTitles[arrFadeCursor];
}

function fade_ontimer() {
  if (m_bFadeOut) {
    m_Fade+=m_FadeStep;
    if (m_Fade>m_FadeOut) {
      arrFadeCursor++;
      if (arrFadeCursor>arrFadeMax)
        arrFadeCursor=0;
      setFadeLink();
      m_bFadeOut = false;
    }
  } else {
    m_Fade-=m_FadeStep;
    if (m_Fade<m_FadeIn) {
      clearInterval(m_iFadeInterval);
      setTimeout(Faderesume, m_FadeWait);
      m_bFadeOut=true;
    }
  }
  var ilink = document.getElementById("dynamic_quotes");
  var icompany = document.getElementById("dynamic_company");
  if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
    ilink.style.color = "#000000";
	icompany.style.color = "#000000";
}

function Faderesume() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
}

function ToHex(strValue) {
  try {
    var result= (parseInt(strValue).toString(16));

    while (result.length !=2)
            result= ("0" +result);
    result = result + result + result;
    return result.toUpperCase();
  }
  catch(e)
  {
  }
}