$(document).ready(function() {
	// init banner gallery
	// Gallery.init(imageHolder, imageWrapper, imageCountHolder, nextButton, prevButton)
	
	// a quick and hacky way of dispaying a random banner image
	$("div#main-banner-wrapper").css("visibility", "hidden");
	var bannerGallery = new Gallery($("div#main-banner-wrapper"), $("div.banner"), null, null, null);
	timer = setInterval(function() { bannerGallery.next(); }, 9000);
	bannerGallery.gotoImage(Math.floor(Math.random() * bannerGallery.maxCount));
	setTimeout(function() { $("div#main-banner-wrapper").css("visibility", "visible"); }, 500);
	
	// init sponsors gallery
	// Gallery.init(imageHolder, imageWrapper, imageCountHolder, nextButton, prevButton)
	var sponsorsGallery = new Gallery($("div#sponsors-logos-wrapper"), $("div#sponsors-logos-wrapper img"), null, null, null);
	timer = setInterval(function() { sponsorsGallery.next(); }, 5000);
	
	// init events gallery
	// Gallery.init(imageHolder, imageWrapper, imageCountHolder, nextButton, prevButton)
	var eventsGallery = new Gallery($("div#events-wrapper"), $("div#events-wrapper div.event"), null, $("a#next-event-action"), $("a#previous-event-action"));
	var tariffsGallery = new Gallery($("div#tariffs-wrapper"), $("div#tariffs-wrapper div.tariff"), null, $("a#next-tariff-action"), $("a#previous-tariff-action"));
});