var SetBanner = function(sBannerPosition){
	var o_req = new Request.HTML({
		'url': '/ajax/banner/' + sBannerPosition + '/',
		'method': 'get',
		'update': $('banner-' + sBannerPosition)
	}).send();
};

// ====== Initialize ==============
var InitEvents = function(){
	$$('div.timeUnit.event').each(function(oEvent){
		oEvent.getChildren().each(function(oEl){
			oEl.addEvent('click', function(){
				document.location = '/agenda/';
			});
		});
	});

};
// ====== ondomready ==============
window.addEvent('domready', function(){
	if ($('containerHeight')){
		oAgendaScroller = new AgendaScroller({
			iLeftRightMax: -2550,
			//350ms per uur
			iLeftRightTime: 8925,
			iVisibleArea: 360
		});
		InitEvents();
	}
	
	if ($('banner-top')){
		// banners
		SetBanner('top');
		(function(){
			SetBanner('top');
		}).periodical(30000);
	}
	
	if ($('banner-middle')){	
		SetBanner('middle');
		(function(){
			SetBanner('middle');
		}).periodical(30000);
	}
	
	if ($('banner-bottom')){
		// banners
		SetBanner('bottom');
		(function(){
			SetBanner('bottom');
		}).periodical(30000);
	}
});