// 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 */

//Wrap arrFadeTitles in "A" tag in index.HTML doc to invoke arrFadeLinks

function setupFadeLinks() {
  //add links in form http://www.url.com
 /* arrFadeLinks[0] = "#";
  arrFadeTitles[0] = 'Webalo is the fast, easy, affordable alternative to time-consuming, costly mobile application development.';*/
  arrFadeLinks[0] = "#";
  arrFadeTitles[0] = '"The Webalo environment is really flexible and very easy to use. Since we didn\'t have to write any code, we were able to connect the SAP data warehouse to users\' BlackBerrys much faster and a great deal cheaper than if we were using a traditional software development toolkit." <br><strong>Grupo Familia</strong>';
  arrFadeLinks[1] = "#";
  arrFadeTitles[1] = '"The economic crisis has helped Inland focus on making sure that every IT initiative has a positive impact on cost-control, and Webalo is both a cost-effective and an ideal way to leverage our existing investments in our Oracle ERP software and BlackBerry smartphones."<br> <strong>Inland Group</strong>';
  arrFadeLinks[2] = "#";
  arrFadeTitles[2] = '"How would Lionsgate have gotten the pertinent business and distribution information to its mobile executives and distributors without Webalo? We wouldn\'t have done it at all, Webalo was an enabler."<br><strong>Lionsgate</strong>';
  arrFadeLinks[3] = "#";
  arrFadeTitles[3] = '"It wasn\'t possible for us, even with the most crackerjack developer to build mobile apps over a period of just days or weeks so instead of custom development or buying a mobile version of each app from software vendors, we turned to Webalo and its mobile connectivity software."<br><strong>Developers Diversified Realty</strong>';
  //arrFadeLinks[5] = "#";
  //arrFadeTitles[5] = "Spare";
}

// 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=10;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 15000;
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, 20);
  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)
  {
  }
}