//CONTROLS DISPLAY OF JPEG IMAGES ON THE SPLASH SCREEN index.php
//PICTURES should be 780 x 431
var today = new Date();
var thisMonth = today.getMonth();
var thisYear = today.getFullYear();
var thisDay = today.getDate();

var debugstring = '';
var season = 'na';
var seasondir = season;
var numPicsEvent = -1;
var normflag = 0;
//number of pictures is the biggest picture number//////
if (thisMonth == 11 || thisMonth == 0 || thisMonth == 1) {
	season = 'Winter';
	seasondir = season;
	numPicsEvent = 14;
	normflag = 1;
}
else if (thisMonth >= 2 && thisMonth <= 4) {
	season = 'Spring';
	seasondir = season;
	numPicsEvent = 12;
	normflag = 1;
}
else if (thisMonth >= 5 && thisMonth <= 7) {
	season = 'Summer';
	seasondir = season;
	numPicsEvent = 12;
	normflag = 1;
}
else {
	season = 'Autumn';
	seasondir = season;
	numPicsEvent = 15;
	normflag = 1;
}
/////SOME SPECIAL TIMES/////////////////////////////////////
if (thisMonth == 1 && thisDay >= 12  && thisDay <= 16) {
	season = "Valentine's Day";
	seasondir = 'vday';
	numPicsEvent = 8;
}
if (thisMonth == 5 && thisDay >= 18 && thisDay <= 22) {
	season = 'Father\'s Day';
	seasondir = 'fathersday';
	numPicsEvent = 5;
}
//set random pictureset quantity
var numRandomPics = 9;
var totalPics = numRandomPics + numPicsEvent;
////////////////////////////////////////////////////////////
// NO EDIT BEYOND THIS POINT |||||||||||||||||||||||||||||||
//set picture number from 1 to n inclusive
var picdir='n/a';
// tend towards the pictureset with more pictures unless it 
//  is a special day in which case the special pictureset takes priority
function randomizePictures(){
	if ((Math.ceil(Math.random()*totalPics) > numPicsEvent) && normflag==1) {
		picdir = 'randomized/' + (Math.ceil(Math.random() * numRandomPics));
	} else{
		picdir = seasondir + '/' + seasondir + (Math.ceil(Math.random() * numPicsEvent));
	}
}
randomizePictures();