/* 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 */



// 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 = 100;
var m_FadeStep = 3;
var m_FadeWait = 1600;
var m_bFadeOut = true;
var m_iFadeInterval;

////////////////////////

var m_FadeOut2 = 255;
var m_FadeIn2 = 0;
var m_Fade2 = 100;
var m_FadeStep2 = 3;
var m_FadeWait2 = 1600;
var m_bFadeOut2 = true;
var m_iFadeInterval2;

////////////////////////

var m_FadeOut3 = 255;
var m_FadeIn3 = 0;
var m_Fade3 = 100;
var m_FadeStep3 = 3;
var m_FadeWait3 = 1600;
var m_bFadeOut3 = true;
var m_iFadeInterval3;

///////////////////////

var count = 0;
window.onload = Fadewl;

function Fadewl() {
    document.getElementById("fade_link").style.color = "#676767";
    document.getElementById("fade_link2").style.color = "#676767";
    document.getElementById("fade_link3").style.color = "#676767";
    m_iFadeInterval = setInterval(fade_ontimer, 20);
    setFadeLink();

    setTimeout('Display2()', 2000);
    setTimeout('Display3()', 4000);
}

function Display2() {
    m_iFadeInterval2 = setInterval(fade_ontimer2, 20);
    setFadeLink2();
}
function Display3() {
    m_iFadeInterval3 = setInterval(fade_ontimer3, 20);
     setFadeLink3();
}
function setFadeLink() {
    var ilink = document.getElementById("fade_link");
    ilink.innerHTML = "Discover.";
}
function setFadeLink2() {
    var ilink = document.getElementById("fade_link2");
    ilink.innerHTML = "Develop.";
} function setFadeLink3() {
    var ilink = document.getElementById("fade_link3");
    ilink.innerHTML = "Deliver.";
}
function fade_ontimer() {
    
        m_Fade += m_FadeStep;
      
    var ilink = document.getElementById("fade_link");
    if ((m_Fade < m_FadeOut) && (m_Fade > m_FadeIn)) {
        ilink.style.color = "#" + ToHex(m_Fade);
    }
 
    
}
function fade_ontimer2() {
    m_Fade2 += m_FadeStep2;
   
    var ilink2 = document.getElementById("fade_link2");
    if ((m_Fade2 < m_FadeOut2) && (m_Fade2 > m_FadeIn2))
        ilink2.style.color = "#" + ToHex(m_Fade2);
}
function fade_ontimer3() {
    m_Fade3 += m_FadeStep3;
    if (m_Fade3 > m_FadeOut3) {
        //setFadeLink3();
        m_bFadeOut3 = false;
    }
    var ilink = document.getElementById("fade_link3");
    if ((m_Fade3 < m_FadeOut3) && (m_Fade3 > m_FadeIn3))
        ilink.style.color = "#" + ToHex(m_Fade3);
}

function ToHex(strValue) {
    try {
        var result = (parseInt(strValue).toString(16));

        while (result.length != 2)
            result = ("0" + result);
        result = result + result + result;
       return result.toUpperCase();
//        alert(result);
//        return false;
    }
    catch (e) {
    }
}
