// http://javascript.internet.com/text-effects/fading-marquee.html
function setupFadeLinks() {
  arrFadeLinks[0] = "";
  arrFadeTitles[0] = '';
  arrFadeLinks[1] = "";
  arrFadeTitles[1] = '"I have known Alex Maas for several years and find him to be pleasant, honest and dedicated. I have no hesitation in recommending him" - Dr Margaret Robinson BM MFFP MRCGP FRSM';
  arrFadeLinks[2] = "";
  arrFadeTitles[2] = '"I met Alex Maas some years ago and was immediately impressed by his professional approach and kindness. I would not hesitate to recommend him" - Eva Fraser, Founder of Facial Fitness, Kensington, London';
  arrFadeLinks[2] = "";
  arrFadeTitles[3] = '"I would like to say how highly I regard the excellence with which Alex Maas conducted a course of treatments with me." - R. Lannoy, Lymington';
  arrFadeLinks[4] = "";
  arrFadeTitles[4] = '"For sheer quality of close personal attention in most agreeable surroundings. I regard what transpired between Mr Maas and myself as of the highest order. He is a brilliant new asset to the local community." - R. Lannoy, Lymington';
  arrFadeLinks[5] = "";
  arrFadeTitles[5] = '"I can wholeheartedly recommend visiting Alex for treatment. He is thorough, knows what he is doing, and judging by my experience is most effective. He is considerate and will carefully explain not only what he is doing but why it is being done." - Father Rudolf Loewenstein OP, St Dominics Priory, London';
  arrFadeLinks[6] = "";
  arrFadeTitles[6] = '"Alex combines the highest professional standards, great sensitivity to the person he is treating and a good insight into human nature. I’m sure his practice in Lymington will contribute to the well-being of many people there." - Father Dermot Morin OP, London';
  arrFadeLinks[7] = "";
  arrFadeTitles[7] = '"I was introduced to the wonders of facial acupuncture with Alex Maas a few years ago. The treatment is incredibly relaxing but that belies the work that is going on beneath the skin. You can see the benefits... I would wholeheartedly recommend this treatment to anyone. Acupuncture is amazing!" - SH, Leics';
  arrFadeLinks[8] = "";
  arrFadeTitles[8] = '"After the course I could see a marked improvement...and I generally felt a lot better. I find the transformation after each treatment very rewarding. For me it has been very helpful and has made me feel younger." - Chrissie, Hants';
  arrFadeLinks[9] = "";
  arrFadeTitles[9] = '"I have long been aware of the value of acupuncture. I have referred many patients for acupuncture and most of them have found it highly beneficial... I wholeheartedly recommend Alex Maas" - Dr Brian Mitchell BM DRCOG MFFP MRCGP FRSM MBSMDH MBSECH CBiol FLS';
}

var m_FadeOut = 255;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 8000;
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("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, 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)
  {
  }
}
