/* 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] = "http://www.tagservices.com.au";
  arrFadeTitles[0] = "<b>Alistair Currie, TAG Services, Sydney</b> - a breadth of knowledge and experience which enables them to work at a very granular level during project management, whilst maintaining control over the bigger strategic picture.";
  arrFadeLinks[1] = "http://www.yourconveyancer.co.uk";
  arrFadeTitles[1] = "<b>Kyle Peddie, Your Convenyancer</b> - Without exaggeration, getting Ian and Futurestate on board to help us is the best thing we have ever done";
  arrFadeLinks[2] = "http://www.locaplanet.co.uk";
  arrFadeTitles[2] = "<b>Paul Brennan - MD, Local Planet Solutions</b> - We had a large and complex project to undertake for a client with insufficiently specified objectives. Ian helped the client identify the objectives and match them to an appropriate solution. His input was crucial to delivering a positive outcome. ";
  arrFadeLinks[3] = "http://www.microsoft.com";
  arrFadeTitles[3] = "<b>Peter Proud - Microsoft Global Alliances</b> - Ian is honest, enthusiastic, and someone who I would always look to to provide great advice and a holistic approach to solving business problems ";
  arrFadeLinks[4] = "http://www.lvrsolutions.com";
  arrFadeTitles[4] = "<b>Lizelle van Rhyn - LVR Ltd</b> - Ian is a detail-oriented manager who watches the balance sheet like a hawk without losing sight of the people driving the business forward. He has vision and drive and delivers results every-time!";
  arrFadeLinks[5] = "http://www.yourconveyancer.co.uk";
  arrFadeTitles[5] = "<b>Steven Lilly, Your Conveyancer</b> - The involvement of Ian has his team has quite literally revolutionised our business capabilities and not only from an IT perspective. We now have extremely well organised IT management systems and processes and have achieved ISO 9001 & 20000 accreditations.";

}

// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.

var m_FadeOut = 255;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 6;
var m_FadeWait = 5000;
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, 30);
  arrFadeLinks = new Array();
  arrFadeTitles = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
}

function setFadeLink() {
  var ilink = document.getElementById("fade_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
  ilink.href = arrFadeLinks[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("fade_link");
  if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
    ilink.style.color = "#" + ToHex(m_Fade);
}

function Faderesume() {
  m_iFadeInterval = setInterval(fade_ontimer, 30);
}

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)
  {
  }
}


