// ==================================================================
// ROTATING CATCH PHRASE
// ==================================================================
var phraseCount = 4;
var arPhrases = new Array();
var randomNumberPhrase = Math.round(Math.random()*(phraseCount-1));

function preBufferPhrases() {
	for (i = 0; i < phraseCount; i += 1) {
		arPhrases[i] = "images/catchPhrases/main/" + i + ".gif";
	}
	
	/*
	var preBuffer = new Array();
	for (i = 0; i < phraseCount; i += 1) {
		preBuffer[i] = new Image();
		preBuffer[i].src = arPhrases[i];
	}
	*/
}

var slideShowSpeed = 2500;
var crossFadeDuration = 0.3;
var currentPhrase = 0;

function showRandomPhrase() {

	var phraseEl = document.getElementById("catchPhrase");
	
	if (document.all){
		phraseEl.style.filter = "blendTrans(duration=" + crossFadeDuration + ")";
		phraseEl.filters.blendTrans.Apply();
	}
	
	phraseEl.src = arPhrases[currentPhrase];
	
	if (currentPhrase < (phraseCount-1)) { 
		currentPhrase += 1;
	} else {
		currentPhrase = 0;
	}
	
	if (document.all) {
		phraseEl.filters.blendTrans.Play();
	}
	
	t = setTimeout('showRandomPhrase()', slideShowSpeed);
}