// The id of the div or other container with text to fade in/out.
var containerId = "attentionid";

// In the color mask, put an 0 for the color digits that will change and otherwise for digits that will remain static.
var colorMask = "#000";

// Specify the number of milliseconds to wait between each fade in/out step. Default - 230
var fadePause = 230;

var currentContentIdx = 1; 
var totalContentItems = 4;
var previousContentIdx = totalContentItems;
var pointer = 25;  
var numlist = "01".split("");
var direction = 'up';
var counter = 0;
var maxChanges = 0;

if( fadePause < 1 ) 
	{ fadePause = 1; }

function fadeContentInOut() {
	if( pointer == 25 ) 
		{ direction = 'down'; contentRotate(); }
	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]);
	document.getElementById(containerId).style.color = thiscolor;
}

function contentRotate() {
	var cid = "placeholderdiv_" + currentContentIdx;
	document.getElementById(cid).style.display = 'block';
	var lid = "placeholderdiv_" + previousContentIdx;	
	document.getElementById(lid).style.display = 'none';
	previousContentIdx = currentContentIdx;
    	currentContentIdx = (currentContentIdx == totalContentItems ) ? 1 : currentContentIdx + 1;
}
function wait(msec){ 
}
setInterval("fadeContentInOut()", fadePause);
