// JavaScript Document
<!-- Paste this code into an external JavaScript file named: marquee.js  -->

/* 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] = "testimonials.html";
  arrFadeTitles[0] = "Thank you so much for the video!! We absolutely love it, I think I have already watched it about 10 times!!! You did a great job and I will definitely be recommending you to people in the future.<br>Take Care,<br>Nicole & David Aglira (August 11, 2007)";
  arrFadeLinks[1] = "testimonials.html";
  arrFadeTitles[1] = "We watched the video last night and absolutely loved it! I can't thank you enough for the great work that you did capturing our special day. We will refer you to anyone that is looking for a videographer in the future.<br>Thank you again, Megan & Kevin Smith (August 26, 2006)";
  arrFadeLinks[2] = "testimonials.html";
  arrFadeTitles[2] = "I just wanted to thank you again for the amazing job that you did on our wedding video. You truly captured every detail of the day! It's just perfect! I will be sure to pass on your information to my friends who are getting married in the near future!<br>Thanks again, Lindsey & Michael Bonczak (September 24, 2005)";

}

// 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 = 10000;
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)
  {
  }
}


