﻿// JScript File

<!-- 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] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[0] = "<font color='#f99b06' size='2'>Hebrews 4:12 (NKJV) </font><br/> <font color='#1e4471'>12 For the word of God is living and powerful, and sharper than any two-edged sword, piercing even to the division of soul and spirit, and of joints and marrow, and is a discerner of the thoughts and intents of the heart.</font>";
  arrFadeLinks[1] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[1] = "<font color='#f99b06' size='2'>Colossians 3:16 (NKJV)</font> <br/>  <font color='#1e4471'> 16 Let the word of Christ dwell in you richly in all wisdom, teaching and admonishing one another in psalms and hymns and spiritual songs, <br/>singing with grace in your hearts to the Lord. </font>";
  arrFadeLinks[2] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[2] = "<font color='#f99b06' size='2'>Joshua 1:8 (NKJV) </font><br/>  <font color='#1e4471'> 8 This Book of the Law shall not depart from your mouth, but you shall meditate in it day and night, that you may observe to do according to all that is written in it. For then you will make your way prosperous, and then you will have good success. </font>";
  arrFadeLinks[3] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[3] = "<font color='#f99b06' size='2'>1 Peter 1:23 (NKJV) </font><br/> <font color='#1e4471'>   23 having been born again, not of corruptible seed but incorruptible, through the word of God which lives and abides forever,...</font>";
  arrFadeLinks[4] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[4] = "<font color='#f99b06' size='2'>Psalm 119:105 (NKJV) </font><br/>  <font color='#1e4471'> 105 Your word is a lamp to my feet And a light to my path.</font>";
  arrFadeLinks[5] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[5] = "<font color='#f99b06' size='2'>Psalm 91:4 (NKJV) <br/> </font> <font color='#1e4471'> 4 He shall cover you with His feathers, and under His wings you shall take refuge; His truth shall be your shield and buckler.</font>";
  arrFadeLinks[6] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[6] = "<font color='#f99b06' size='2'>Psalm 37:23 (NKJV) <br/> </font> <font color='#1e4471'>  23 The steps of a good man are ordered by the LORD, and He delights in his way.font>";
  arrFadeLinks[7] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[7] = "<font color='#f99b06' size='2'>Colossians 1:9 (NKJV) <br/> </font> <font color='#1e4471'>9 For this reason we also, since the day we heard it, do not cease to pray for you, and to ask that you may be filled with the knowledge of His will in all wisdom and spiritual understanding;  </font>";
  arrFadeLinks[8] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[8] = "<font color='#f99b06' size='2'>John 16:13 (NKJV) <br/> </font> <font color='#1e4471'>13 However, when He, the Spirit of truth, has come, He will guide you into all truth; for He will not speak on His own authority, but whatever He hears He will speak; and He will tell you things to come.</font>";
  arrFadeLinks[9] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[9] = "<font color='#f99b06' size='2'>1 Peter 3:12 (NKJV) <br/> </font> <font color='#1e4471'> 12 For the eyes of the LORD are on the righteous, and His ears are open to their prayers; but the face of the LORD is against those who do evil.” </font>";
  arrFadeLinks[10] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[10] = "<font color='#f99b06' size='2'>Colossians 4:2 (NKJV) <br/> </font> <font color='#1e4471'> 2 Continue earnestly in prayer, being vigilant in it with thanksgiving; </font>";
  arrFadeLinks[11] = "/UI/Content/BibleStudy/Lesson/Default.aspx";
  arrFadeTitles[11] = "<font color='#f99b06' size='2'>Ephesians 6:10 (NKJV) <br/> </font> <font color='#1e4471'> 10 Finally, my brethren, be strong in the Lord and in the power of His might. </font>";
}

// 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 =5;
var m_FadeWait = 5000;
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, 80);
  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, 80);
}

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)
  {
  }
}

