// JavaScript Document

/* 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 = getLinks();
   arrFadeTitles = getTitles();
}
**/
// 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;

var fade_reference = 'Elmo References';

function Fadewl()
{
   m_iFadeInterval = setInterval(fade_ontimer, 10);
   arrFadeLinks = new Array();
   arrFadeTitles = new Array();
   // setupFadeLinks();
   arrFadeMax = refArray.length-1; // arrFadeLinks.length-1;
   setFadeLink();
}

function setFadeLink()
{
   var ilink = document.getElementById("fade_link");
   var iauthor = document.getElementById("fade_author");
   var iref = document.getElementById("fade_reference");
   ilink.innerHTML = getFadeTitle(arrFadeCursor); // arrFadeTitles[arrFadeCursor];
   iauthor.innerHTML = getFadeLinks(arrFadeCursor); // arrFadeLinks[arrFadeCursor];
   // iref.innerHTML = fade_reference;
}

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);
   var iauthor = document.getElementById("fade_author");
   if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
      iauthor.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)
   {
      //
   }
}
/**
name, title, company
refArray[x][1], refArray[x][2], refArray[x][0]

function getLinks()
{
	arrFadeLinks[0] = 'Frank Lewis, Owner<br>Red&#39;s Auto Glass';
	arrFadeLinks[1] = 'Frank Novelli, Co-Owner<br>T G Auto Glass';
	arrFadeLinks[2] = 'Russ Oden, Owner<br>Deb&#39;s Auto Glass';
	arrFadeLinks[3] = 'Bruce Arnold, Owner<br>Dallas Glass Company';
	arrFadeLinks[4] = 'Gail Hemley, Co-Owner<br>South Tacoma Glass';
	arrFadeLinks[5] = 'Tom Dawson, Owner<br>Auto Glass Specialties, Inc.';
	arrFadeLinks[6] = 'Rennie Deboer, Owner<br>Interstate Glass & Door';
	arrFadeLinks[7] = 'Lottie Short, Office Mgr.<br>Quick-Set Auto Glass';

	return arrFadeLinks;
}
**/
function getFadeLinks(num)
{
   return ( refArray[num][1] + ', ' + refArray[num][2] + '<br>' + refArray[num][0] );
}

/**
testimony = refArray[x][7]

function getTitles()
{
	arrFadeTitles[0] = 'After wasting 8 years and thousands of dollars on GlasPac, I switched to Elmo32. Elmo32 is so easy to use, even daily temps can give accurate quotes within seconds of their initial instruction. I am finally getting the responsive support I deserve and have been paying for all these years.';
	arrFadeTitles[1] = '24 hours a day I can call an 800 number and reach Technical Support. We have been with them for over five years and they are one of the best investments made for our business.';
	arrFadeTitles[2] = 'Elmo32 is fantastic!  The staff is super and I can call 24 hours a day, 7 days a week for Technical Support.  IBS actually wrote a special program to help me save time.  I am really happy with my decision to use IBS Software and Elmo32.';
	arrFadeTitles[3] = 'The Elmo32 program is fantastic. Information is easy to retrieve, there are over 80 reports that come pre-installed with Elmo32, and their Technical Support has always been there to assist my business.';
	arrFadeTitles[4] = 'We&#39;re really happy with Elmo32.  It is very user friendly.  The simplicity of use is very nice and is what everyone likes about Elmo32. The biggest plus is the phone support...it is worth everything.';
	arrFadeTitles[5] = 'What puts IBS above the rest is their superior service. We always feel our problems will be solved quickly AND, more importantly, that someone really cares about our business.';
	arrFadeTitles[6] = 'The Elmo32 software is very user friendly. IBS Technical Support has been very helpful to our business.';
	arrFadeTitles[7] = 'We have had the Elmo32 program for over two years and have always received patient, supportive assistance from Technical Support. We appreciate all the expert help.';

   return arrFadeTitles;
}
**/
function getFadeTitle(num)
{
   return refArray[num][7];
}