summaryrefslogtreecommitdiff
path: root/slideshows/default/template/events.js
blob: 702878c3b37534ca033a3bf1d81412205ae4badd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$(document).ready(function(){

	var tot=$('.event').length;
	
	var screenWidth = $('.events').width();

	var bord = $('.event').outerWidth() - $('.event').innerWidth();
	var padd = $('.event').innerWidth() - $('.event').width();
	var marg = $('.event').outerWidth(true) - $('.event').outerWidth();
	$('.event').width((screenWidth-(tot * (bord+padd+marg)))/tot);

	$('.eventDate').each(function(index, value) {
		var colours = ['blue', 'green', 'chreme'];
		$(this).addClass(colours[index % 3]);
	});

	$('.eventField').each(function(index, value) {
		var classStr = $(this).attr('class').split(/\s+/);
		if(classStr.indexOf('start') != -1) {
			$(this).show();
		} else if(classStr.indexOf('summary') != -1) {
			$(this).show();
		}
	});
	setTimeout("reloadPage()", 21600000);
});

function reloadPage() { 
	location.reload();
};