//gathering.js used by calendar.html, index.html & gatherings.html to display information on Gatherings
//initialize variables
var nowDate = new Date();
var monthNum = nowDate.getMonth();
//gathLocArray stores data displayed in Calendar
//Arrays have 13 slots to allow roll over into next year
var gathLocArray = new Array("Christ UMC, College Station","St Johns UMC, Rockdale","Pleasant Retreat UMC, Thorndale","Candlelight","First UMC, Bryan","Hilltop Lakes Chapel","Chapell Hill UMC","TBA","Lexington UMC","Candlelight","First UMC, Brenham","TBA","");
//gathMapArray stores the variable (dir-xxxxxxx.html) portion of the call to the filename to display the map
var gathMapArray = new Array("cscumc","rockumc","thornprumc","","bryafumc","hilltopchpl","chplhllumc","","lexumc","","brenumc","","");//Poss Hilltop for June, Brenham FUMC for Nov
var gathDateArray = new Array("14","4","3","","5","2","7","4","8","","3","","");
var gathContactArray = new Array("Sally Miller","David Ogee","Shirley McCoy","","Jeff Gage","Swen Crone","Eric Dehmer","","David Worden","Patrice Summerour","","","");
var gathLoc = "";
var gathMap = "";
var gathDate = "";
var gathNote = "";
var banner1Switch = 'off';
var bannerAnnounce = 'off';//for special announcements to display in banner, set using "if" datecheck below
		//if ((monthNow=='October' && (currentDay>=25 && currentDay<=31))||(monthNow=='November' && (currentDay>=1 && currentDay<=25)))
		//	{
		//		bannerAnnounce='on';
		//	}
//set variables used by index.html for banner and community info
switch (monthNum)//defines date and location for Monthly Gatherings
		//set switch to on if current date falls within dates specified
		//var month is pulled from month array in bvec_script.js
{
	case 0: //January
		gathNote = '';
		gathDate = months[0] + " " + gathDateArray[0];
		gathLoc = gathLocArray[0];
		gathMap = gathMapArray[0];
	//This IF statement sets banner from the first of the month to the Gathering	
		if (currentDay<=gathDateArray[0])
			{
			banner1Switch='on';
			}
	//Else IF sets Gathering info for the next Gathering
		else if (currentDay>gathDateArray[0])
			{
				gathNote = '';
				gathDate = months[1] + " " + gathDateArray[1];
				gathLoc = gathLocArray[1];
				gathMap = gathMapArray[1];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 1: //February
		gathNote = '';
		gathDate = months[1] + " " + gathDateArray[1];
		gathLoc = gathLocArray[1];
		gathMap = gathMapArray[1];	
		if (currentDay<=gathDateArray[1])
			{
			banner1Switch='on';
			}
	//Else IF sets Gathering info for the next Gathering
		else if (currentDay>gathDateArray[1] )
			{
				gathNote = '';
				gathDate = months[2] + " " + gathDateArray[2];
				gathLoc = gathLocArray[2];
				gathMap = gathMapArray[2];
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}	
		break;
	case 2: //March
		gathNote = '';
		gathDate = months[2] + " " + gathDateArray[2];
		gathLoc = gathLocArray[2];
		gathMap = gathMapArray[2];	
		if (currentDay<=gathDateArray[2])
			{
			banner1Switch='on';
			}
	//Else IF sets Gathering info for the next Gathering
		else if (currentDay>gathDateArray[2])
			{
				gathNote = '';
				gathDate = months[4] + " " + gathDateArray[4];
				gathLoc = gathLocArray[4];
				gathMap = gathMapArray[4];	
			if (currentDay>=5)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='candle';
				}
			}
		break;
	case 3: //April
		gathNote = '';
		gathDate = 'April';
		gathLoc = '';	
		if (currentDay<=14)
			{
				banner1Switch='candle';
			}
		else if (currentDay>=23)//Else IF sets Gathering info for the next Gathering
			{
				gathNote = '';
				gathDate = months[4] + gathDateArray [4];
				gathLoc = gathLocArray[4];
				gathMap = gathMapArray[4];
			if (currentDay>=23)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 4: //May
		gathNote = '&amp; Fish Fry ';
		gathDate = months[4] + gathDateArray [4];
		gathLoc = gathLocArray[4];
		gathMap = gathMapArray[4];
		if (currentDay<=gathDateArray[4])
			{
			banner1Switch='on';
			}
		else if	(currentDay>gathDateArray[4])//set banner for next month's Gathering
			{
			gathNote = "";
			gathDate = months[5] +" " + gathDateArray[5];
			gathLoc = gathLocArray[5];
			gathMap = gathMapArray[5];
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 5: //June
		gathNote = '';
		gathDate = months[5] + " " + gathDateArray[5];
		gathLoc = gathLocArray[5];	
		gathMap = gathMapArray[5];
		if (currentDay<=gathDateArray[5])
			{
				banner1Switch='on';
			}
		else if (currentDay>gathDateArray[5])//Else IF sets Gathering info for the next Gathering
			{
			gathDate = months[6] + " " + gathDateArray[6];
			gathLoc = gathLocArray[6];
			gathMap = gathMapArray[6];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 6: //July
		gathNote = '';
		gathDate = months[6] + " " + gathDateArray[6];
		gathLoc = gathLocArray[6];	
		gathMap = gathMapArray[6];
		if (currentDay<=gathDateArray[6])
			{
				banner1Switch='on';
			}
		else if (currentDay>gathDateArray[6])//Else IF sets Gathering info for the next Gathering
			{
			gathNote = ' &amp; Hullabaloo ';
			gathDate = months[7] + " " + gathDateArray[7];
			gathLoc = gathLocArray[7];
			gathMap = gathMapArray[7];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 7: //August
		gathNote = ' &amp; Hullabaloo ';
		gathDate = months[7] + " " + gathDateArray[7];
		gathLoc = gathLocArray[7];	
		gathMap = gathMapArray[7];
		if (currentDay<=gathDateArray[7])
			{
				banner1Switch='on';
			}
		else if (currentDay>gathDateArray[7])//Else IF sets Gathering info for the next Gathering
			{
			gathNote = '';
			gathDate = months[8] + " " + gathDateArray[8];
			gathLoc = gathLocArray[8];
			gathMap = gathMapArray[8];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 8: //September
		gathNote = '';
		gathDate = months[8] + " " + gathDateArray[8];
		gathLoc = gathLocArray[8];	
		gathMap = gathMapArray[8];
		if (currentDay<=gathDateArray[8])
			{
				banner1Switch='on';
			}
		else if (currentDay>gathDateArray[8])//Else IF sets Gathering info for the next Gathering
			{
			gathNote = '';
			gathDate = months[10] + " " + gathDateArray[10];
			gathLoc = gathLocArray[10];
			gathMap = gathMapArray[10];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='candle';
				}
			}
		break;
	case 9: //October
		gathNote = '';
		gathDate = months[10] + " " + gathDateArray[10];
		gathLoc = gathLocArray[10];	
		gathMap = gathMapArray[10];
		if (currentDay<=20)
			{
			banner1Switch='candle';
			}
		else if (currentDay>=24)//Else IF sets Gathering info for the next Gathering
			{
			gathNote = '';
			gathDate = months[10] + " " + gathDateArray[10];
			gathLoc = gathLocArray[10];
			gathMap = gathMapArray[10];	
			if (currentDay>=22)//turns on banner 2 weeks prior to Gathering
				{banner1Switch='on';
				}
			}
		break;
	case 10: //November
		gathNote = '';
		gathDate = months[10] + " " + gathDateArray[10];
		gathLoc = gathLocArray[10];	
		gathMap = gathMapArray[10];
		if (currentDay<=gathDateArray[10])
			{
				banner1Switch='on';
			}
		else if (currentDay>gathDateArray[10])//Else IF sets Gathering info for the next Gathering
			{
			gathNote = '';
			gathDate = months[12] + " " + gathDateArray[12];//Since there is no Gathering in Dec jumping to monthnum for Jan
			gathLoc = gathLocArray[12];
			gathMap = gathMapArray[12];	
			}
		break;
	default: //December 
		gathNote = '';
		gathDate = months[12] + " " + gathDateArray[12];
		gathLoc = gathLocArray[12];	
		gathMap = gathMapArray[12];
		if (currentDay>=20)
			{
			banner1Switch='on';
			}
}



