function splashSwitch(){
	var splashUpdater = null;
	var splash = null;
	var currentIndex = 0;
	var menuItems = $('splashmenucontainer').getElementsByTagName("div");
	var splashContainer = $('splashcontainer');
	this.loadImages = function(){
		for(var i=0;i<menuItems.length;i++){
			var img = new Image(940,300);
			img.src = menuItems[i].getAttribute('imgrel');
		}
	}
	this.startSplashSwitch = function(){
		splashUpdater = new PeriodicalExecuter(splashswitcher.switchToNext, 5);
	}
	this.stopSplashSwitch = function(){
		splashUpdater.stop();
	}
	this.mouseOver = function(menuElm){
		for(var i=0;i<menuItems.length;i++){
			menuItems[i].style.background = '';
			menuItems[i].style.color = '#FFFFFF';
		}
		if(menuElm.getAttribute('imgrel')){
			menuElm.style.background = '#F7F7F7';
			menuElm.style.color = '#2C2C2C';
			splashContainer.style.background = 'url('+menuElm.getAttribute('imgrel')+')';
			for(var i=0;i<menuItems.length;i++){
				if(menuItems[i]==menuElm){
					currentIndex = i;
				}
			}
		}
	}
	this.mouseOut = function(){
		for(var i=0;i<menuItems.length;i++){
			menuItems[i].style.background = '';
			menuItems[i].style.color = '#FFFFFF';
		}
	}
	this.switchToNext = function(){
		for(var i=0;i<menuItems.length;i++){
			menuItems[i].style.background = '';
			menuItems[i].style.color = '#FFFFFF';
		}
		if(currentIndex<menuItems.length){
			if(menuItems[currentIndex].getAttribute('imgrel')){
				splashContainer.style.background = 'url('+menuItems[currentIndex].getAttribute('imgrel')+')';
				menuItems[currentIndex].style.background = '#F7F7F7';
				menuItems[currentIndex].style.color = '#2C2C2C';
				currentIndex ++;
			} else {
				currentIndex ++;
				splashswitcher.switchToNext();
			}
		} else {
			currentIndex = 0;
			splashswitcher.switchToNext();
		}
	}
}
var splashswitcher = null;
function splashLoad(){
	splashswitcher = new splashSwitch();
	splashswitcher.startSplashSwitch();
	splashswitcher.loadImages();
}