var basePath;
var currentImage = 1;
var aCurrent;

LoadImageSwitch = function (e) {
	basePath = document.getElementsByTagName('base')[0].href+'_images/';
	setInterval(ImageSwitch, 4000);
	aCurrent = Array();
	aCurrent[0] = $('switch-second').src.replace(basePath,'');
	aCurrent[1] = $('switch-third').src.replace(basePath,'');
	aCurrent[2] = $('switch-fourth').src.replace(basePath,'');
	aCurrent[3] = $('switch-fifth').src.replace(basePath,'');
	aCurrent[4] = $('switch-first').src.replace(basePath,'').substring(6);
}

ImageSwitch = function () {
	if (currentImage==aCurrent.length) {
		currentImage = 0;
	}
	
	$('switch-first').src = '_images/groot-'+aCurrent[currentImage];
	
	currentImage++;
}

Event.observe(window,'load',LoadImageSwitch);