var intervalId;
var startInterval = false;

function displaySplash() {
		intervalId = setInterval(splash, 30000);
}

function splash() {

	var temp = $('splashWrapper').getElementsByClassName('splash');
	var numSplash = temp.length;
	var splash = new Array();
	var splashDisplay = new Array();

	for (var i = 1; i < numSplash + 1; i++) {
		splash[i] = "splash" + i;
		splashDisplay[i] = false;

		if (document.getElementById(splash[i]).style.display == "block") {
			document.getElementById(splash[i]).style.display = "none"
			if (numSplashHolders > 1) {
				document.getElementById("splashSpacer" + i).style.display = "none";
			}
		}
	}

	var rand;
	var finish = 0;

	for (; ; ) {
		rand = Math.floor(Math.random() * numSplash + 1);

		if (splashDisplay[rand] == false) {
			document.getElementById(splash[rand]).style.display = "block";
			if (numSplashHolders > 1) {
				document.getElementById("splashSpacer" + rand).style.display = "block";
			}
			splashDisplay[rand] = true;
			finish += 1;
		}

		if (finish == numSplashHolders) {
			if (startInterval == false) {
				startInterval = true;
				displaySplash();
				break;
			}
			
			break;
		}
	}
}