// JavaScript Document

function setupFadeLinks() {

  arrFadeLinks[0] = "#";

  arrFadeTitles[0] = "“The Insurance Smith agents were knowledgeable and professional when helping me with my insurance needs.  I felt totally comfortable in switching my policies over to them and the companies they represent.  I will refer all my friends and family to them for their insurance needs.”   - Scott C. in Spotsylvania.";

  arrFadeLinks[1] = "#";

  arrFadeTitles[1] = "“I am very happy with my new policies that The Insurance Smith provided to my family.  I could not get my previous agent to call me back and I felt like I had no idea what was going on with my insurance.  I was referred by a friend to The Insurance Smith, and I’m so glad I called.  They took care of getting me quotes and meeting with me in person to make sure I understood my coverage.  They made switching over very easy and took care of everything for me.  Thank you Insurance Smith for your help!”   -Tanya in Stafford";

  arrFadeLinks[2] = "#";

  arrFadeTitles[2] = "“I was so excited when The Insurance Smith was able to save me so much money on my insurance.  I knew that I was paying too much, but once they gave me a quote and saw how much I was overpaying....I was floored.  I am going to save enough this year to almost pay for our summer vacation.  The best part was that I did not have to sacrifice coverage to save money, in fact the agent was able to provide me with better coverage at a much less expensive price.”   -Henry in Woodbridge";

  
  

}



// 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 = 3;

var m_FadeWait = 9000;

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)

  {

  }

}

// -- set the default cursor for the refer us page.
  if(document.referUs.block1Fname != null)
  {
	  document.referUs.block1Fname.focus();
  }