// 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] = "#";
  arrFadeTitles[0] = "&#8220;I had never heard of VELOX before and was pleased to see it holds up just like my old Line-X. I love its uniform finish.&#8221; &ndash; Richard (Texas)";
  arrFadeLinks[1] = "#";
  arrFadeTitles[1] = "&#8220;When I wanted to spray my truck, I had only heard of Line-x and Rhino. My local body shop was offering VELOX, so I went with it. It looks great.&#8221; &ndash; Lance (Arkansas)";
  arrFadeLinks[2] = "#";
  arrFadeTitles[2] = "&#8220;I always take my dog with me when I'm running errands, so I wanted a liner that was both safe for my dog and the environment. Velox has definitely proven to be the right choice for me.&#8221; &ndash; Bobby (Louisiana)";
  arrFadeLinks[3] = "#";
  arrFadeTitles[3] = "&#8220;When I got my first truck, my dad told me about VELOX. The company he works for uses it in their lawn care business trucks. Since I keep a ton of tools in the back, I need a liner that is always there to protect and Velox has kept my truck bed in like new condition.&#8221; &ndash; Rocky (Mississippi)";
  arrFadeLinks[4] = "#";
  arrFadeTitles[4] = "&#8220;I live in a somewhat rural area and didn't want to drive a long distance to have a bed liner applied. I found that my local body shop applied VELOX, checked it out and discovered it performed as well as the better known products. The combination of performance and convenience made the decision easy for me and I have been more than pleased with my decision. I recommend it to all my friends.&#8221; &ndash; Don (Oklahoma)";
  arrFadeLinks[5] = "#";
  arrFadeTitles[5] = "&#8220;I love that it was installed and delivered to me within a couple of hours.&#8221; &ndash; Richard (Alabama)";
  arrFadeLinks[6] = "#";
  arrFadeTitles[6] = "&#8220;I own a construction business in Garland and have used VELOX on my entire fleet of pickup trucks. It has held up well to the abuse we have put it through.&#8221; &ndash; Jimmy (Texas)";
  arrFadeLinks[7] = "#";
  arrFadeTitles[7] = "&#8220;This is the first time I've ever gotten a spray-on bedliner. I chose VELOX and it is way better than my old dinosaur drop-in liner. It looks great!!&#8221; &ndash; Roger (Louisiana)";
  arrFadeLinks[8] = "#";
  arrFadeTitles[8] = "&#8220;My VELOX bedliner is much like an invincible body guard. It can take abuse without getting damaged.&#8221; &ndash; Mike (Texas)";
  arrFadeLinks[9] = "#";
  arrFadeTitles[9] = "&#8220;I needed to sell my truck but the value was way too low. So I put a VELOX spray on liner on it and was able to increase the resale value.&#8221; &ndash; David (Louisiana)";
  arrFadeLinks[10] = "#";
  arrFadeTitles[10] = "&#8220;My VELOX spray on bed liner helps keep things from sliding around in the back of my truck. Its anti-skid feature holds objects pretty much  in place.&#8221; &ndash; Amanda (Texas)";
  arrFadeLinks[11] = "#";
  arrFadeTitles[11] = "&#8220;My first experience with VELOX was as a spray-on bed liner. I have since realized the versatility of the product and have used it on several projects around my farm and ranch. I have saved money by using VELOX as a protective coating due to the durability of the coating and one time application. No need to repaint or recoat my equipment any longer. Love it!!!&#8221; &ndash; Brad (West Texas)";
  arrFadeLinks[12] = "#";
  arrFadeTitles[12] = "&#8220;It looks great on my horse trailer and protects it well from damage that horses can cause.&#8221; &ndash; Joanne (Texas)";
}

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

var m_FadeOut = 0;
var m_FadeIn= 0;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 10000;
var m_bFadeOut = false;

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)
  {
  }
}
