$(document).ready(function(){
	// Set image directory here (absolute URL)
	imageDir = 'http://steinhoffinternational.investoreports.com/wp-content/themes/steinhoff/img/';

	imageList = new Array(
		new Array ('logo-pgbison.gif','PG Bison', '/group-operations/by-brand/'),
		new Array ('hertz.gif','Hertz', '/group-operations/by-brand/'),
                new Array ('unitrans.gif','Unitrans', '/group-operations/by-brand/'),
                new Array ('esprit.gif','Espirit', '/group-operations/by-brand/')
               	);

	imageNo = imageList.length - 1; // -1 makes the loop function properly
	currentIndex = 0

	rotateImages(); // Start the script

	function rotateImages() {
		$('#brandLogos a').attr('href',imageList[currentIndex][2]); // Setting new URL for image link
		$('#brandNames a').attr('href',imageList[currentIndex][2]); // Setting new URL for text link
		$('#brandNames a').html(imageList[currentIndex][1]); // Setting new name of text link
		$('#brandLogos a img').attr('alt',imageList[currentIndex][1]); // Setting new ALT for image
		$('#brandLogos a img').attr('src',imageDir+imageList[currentIndex][0]); // Setting new source for image

		if(currentIndex == imageNo) {
			currentIndex = 0;
		}
		else {
			currentIndex++;
		}

		setTimeout(rotateImages,5000);
	}

});

