/* 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] = "accolades.pdf";
	arrFadeTitles[0] = "...always... an excellent, audience friendly performance... consistently easy to work with... Their harmonies are true... their patter and stage personalities engaging... I can highly recommend them. - Cat Taylor, Entertainment Director, The Dickens Christmas Fair";
	arrFadeLinks[1] = "accolades.pdf";
	arrFadeTitles[1] = "...the stand out performance of the evening... excellent... a joy to work with... the epitome of professionalism - Ricardo Zegri, ObamaRama, Duck on Bike Productions";
	arrFadeLinks[2] = "accolades.pdf";
	arrFadeTitles[2] = "...dynamic, enjoyable... captivating... musically tight... fun... a wonderful show... I recommend them highly and without reservation. - Ariane Wolfe, Chair, Nova Albion Steampunk Exhibition";
	arrFadeLinks[3] = "accolades.pdf";
	arrFadeTitles[3] = "...in their period Victorian, pirate, and sailor costumes... refreshingly different... tankards, mugs, pints and jugs they carried testified to their love of the drinking song that is! - Tammy Heinsohn, The Human Voice, KKUP Cupertino";
	arrFadeLinks[4] = "accolades.pdf";
	arrFadeTitles[4] = "...an entertaining group singing happy songs while raising good cheer... What a party Brass Farthing had on that stage. What a privilege to have attended their ale house. - Stacy Lynne, From My Perspective";
	arrFadeLinks[5] = "accolades.pdf";
	arrFadeTitles[5] = "...tremendous response... very appropriate for a wide audience demographic... one of the most entertaining groups I've seen in years! - John Neal, President, Harmony Sweepstakes A Cappella Festival";
	arrFadeLinks[6] = "renprod.pdf";
	arrFadeTitles[6] = "...by far the most consistently pleasant experience I've had... They're very much reliable. I can't commend Brass Farthing enough as a pleasure to have and to work with. - Bill Watters, Renaissance Productions";
}

function setFadeLink(){
  var ilink = document.getElementById("fade_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
  ilink.href = arrFadeLinks[arrFadeCursor];
}

var m_FadeOut = 255;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 5000;
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 fade_ontimer(){
	if (m_bFadeOut){
		m_Fade += m_FadeStep;
		if (m_Fade > m_FadeOut){		
			clearInterval(m_iFadeInterval);
			setTimeout(Faderesume, m_FadeWait);
			m_bFadeOut=false;
		}
	}else{
		m_Fade -= m_FadeStep;
		if (m_Fade < m_FadeIn){
			arrFadeCursor++; // =1 add one to the arraycursr
			if (arrFadeCursor > arrFadeMax){
				arrFadeCursor = 0; // this would reset the curser back to the beginning of the array index
			}
			setFadeLink();
			m_bFadeOut = true; // ? i dont' know
		}	
	}
	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){ }
}