/*
Text Fade In/Out (Website Secrets Version)
Version 1.0
March 1, 2009
Will Bontrager
http://www.willmaster.com/
Copyright 2009 Bontrager Connection, LLC
*/

// Three places to customize --

// Place One:
// Between the quotes, specify the id value of the div 
//   or other container with text to fade in/out.
var ContainerID = "attentionid";

// Place Two:
// In the color mask, put an 0 for the color digits that will 
//   change and otherwise for digits that will remain static.
var ColorMask = "#0000FF";

// Place Three:
// Specify the number of milliseconds to wait between each 
//  fade in/out step.
var FadePause = 50;

var FadingId = null;

/*************************************/
// No further customizations required.
var numlist = "0123456789ABCDEF".split("");
var pointer = 15;
var direction = 'up';
var counter = 0;
var MaxChanges = 0;
if( FadePause < 1 ) { FadePause = 1; }
function FadeColorInOut() {
	if( pointer == 15 ) { direction = 'down'; }
	else if( pointer == 0 ) { direction = 'up'; }
	if( direction == 'up' ) { pointer++; }
	else { pointer--; }
	counter++;
	if( MaxChanges > 0 && counter > MaxChanges ) { clearInterval(Changing); }
	re = /0/g;
	var thiscolor = ColorMask.replace(re,numlist[pointer]);
	if (document.getElementById(ContainerID)){
		document.getElementById(ContainerID).style.color = thiscolor;
	}
}

function WhiteOutContainer(){
    clearInterval(FadingId);
}

FadingId = setInterval("FadeColorInOut()",FadePause);
setTimeout("WhiteOutContainer()",5000);
