//-----------------------------------------------------------------------------
//
// SMA Timetable 2010
//
//-----------------------------------------------------------------------------

_year                   = 2010;

monthLabels         	= new Array(    'January',
                                        'February',
                                        'March',
                                        'April',
                                        'May',
                                        'June',
                                        'July',
                                        'August',
                                        'September',
                                        'October',
                                        'November',
                                        'December'
				);


monthNumbDays	        = new Array(    31,
                                        29,
                                        31,
                                        30,
                                        31,
                                        30,
                                        31,
                                        31,
                                        30,
                                        31,
                                        30,
                                        31
				);

monthStartDay	        = new Array(    5,
                                        1,
                                        1,
                                        4,
                                        6,
                                        2,
                                        4,
                                        7,
                                        3,
                                        5,
                                        1,
                                        3
				);



//-----------------------------------------------------------------------------
// All Classes
//
// Green  - JunFan / FMA =  junfanfma
// Blue   - JunFan / JKD =  junfanjkd
// Red    - Grappling    =  grappling
// Yellow - Filipino MA  =  filipinoma
//
//-----------------------------------------------------------------------------
classesCombined 	= new Array(
                                	    new Array(1, 4, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(1, 4, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(1, 5, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(1, 7,	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(1, 7, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(1, 11, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(1, 11,	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(1, 12, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(1, 14, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(1, 14, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(1, 18, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(1, 18, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(1, 19, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(1, 21, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(1, 21, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(1, 25,	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(1, 25, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(1, 26, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(1, 28, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(1, 28, 	'filipinoma', 	'senior', 'Portsmouth'),

					    new Array(2, 1, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(2, 1, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(2, 2, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(2, 4,	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(2, 4, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(2, 8, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(2, 8,	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(2, 9, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(2, 11, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(2, 11, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(2, 15, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(2, 15, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(2, 16, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(2, 18, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(2, 18, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(2, 22,	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(2, 22, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(2, 23, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(2, 25, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(2, 25, 	'filipinoma', 	'senior', 'Portsmouth'),

                                            new Array(3, 1, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(3, 1, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(3, 2, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(3, 4,	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(3, 4, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(3, 8, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(3, 8,	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(3, 9, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(3, 11, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(3, 11, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(3, 15, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(3, 15, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(3, 16, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(3, 18, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(3, 18, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(3, 21, 	'seminar', 	'senior', '(10:00am - 2:00pm)\n\nPhil Norman MMA Seminar \n\nMountbatten Centre\nAlexandra Park, Portsmouth, Hampshire. PO2 9QA'),
					    new Array(3, 22,	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(3, 22, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(3, 23, 	'junfanjkd', 	'mixed', 'Portchester'),
	                                    new Array(3, 25, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(3, 25, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(3, 28, 	'seminar', 	'junior', '(10:00am - 12:00pm)\n\nJunior Filipino Martial Arts / Games\n\nAdmiral Lord Nelson School (Main Hall)\nDundas Lane, Portsmouth. PO3 5XT'),
	                                    new Array(3, 29, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(3, 29, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(3, 30, 	'junfanfma', 	'mixed', 'Portchester'),





                                            new Array(4, 1, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(4, 1, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(4, 5, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(4, 5,	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(4, 6, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(4, 8, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(4, 8,	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(4, 12, 	'grappling',    'junior', 'Portsmouth'),
	                                    new Array(4, 12, 	'grappling',   'senior', 'Portsmouth'),
                                            new Array(4, 13, 	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(4, 15, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(4, 15, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(4, 19, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(4, 19, 	'junfanjkd',    'senior', 'Portsmouth'),
                                            new Array(4, 20, 	'junfanjkd',    'mixed', 'Portchester'),
	                                    new Array(4, 22, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(4, 22, 	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(4, 26, 	'junfanjkd',    'junior', 'Portsmouth'),
	                                    new Array(4, 26, 	'junfanjkd',    'senior', 'Portsmouth'),
                                            new Array(4, 27, 	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(4, 29, 	'grappling',    'junior', 'Portsmouth'),
                                            new Array(4, 29, 	'grappling', 	'senior', 'Portsmouth'),


                                            // Bank Holiday - new Array(5, 3, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            // Bank Holiday - new Array(5, 3, 	'junfanjkd',    'senior', 'Portsmouth'),
                                            new Array(5, 4, 	'junfanjkd',    'mixed', 'Portchester'),
                                            //new Array(5, 6,	'junfanjkd', 	'junior', 'Portsmouth'),
                                            //new Array(5, 6, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(5, 10, 	'grappling',    'junior', 'Portsmouth'),
					    new Array(5, 10,	'grappling', 	'senior', 'Portsmouth'),
	                                    new Array(5, 11, 	'junfanfma',    'mixed', 'Portchester'),
	                                    new Array(5, 13, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(5, 13, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                	    new Array(5, 16, 	'grading', 	'mixed', '(10:00am - 4:00pm)\n\nSMA Grading\n(by invitation only)\n\nAdmiral Lord Nelson School (Main Hall)\nDundas Lane, Portsmouth. PO3 5XT'),
                                            new Array(5, 17, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(5, 17, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(5, 18, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(5, 20, 	'seminar', 	'senior', '(7:00pm - 10:00pm)\n\nRich Faye Seminar \n\nAnchorage Lodge\nAnchorage Park, Portsmouth, Hampshire. PO3 5UB'),
                                            //new Array(5, 20, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            //new Array(5, 20, 	'filipinoma',    'senior', 'Portsmouth'),
					    new Array(5, 24,	'junfanjkd',    'junior', 'Portsmouth'),
					    new Array(5, 24,	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(5, 25,	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(5, 27,	'grappling',    'junior', 'Portsmouth'),
                                            new Array(5, 27,	'grappling', 	'senior', 'Portsmouth'),


                                            // Bank Holiday new Array(5, 31,	'junfanjkd',    'junior', 'Portsmouth'),
                                            // Bank Holiday new Array(5, 31,	'junfanjkd', 	'senior', 'Portsmouth'),

                                            new Array(6, 1, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(6, 3, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(6, 3, 	'junfanjkd',    'senior', 'Portsmouth'),
                                            new Array(6, 7,	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(6, 7, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(6, 8, 	'junfanfma', 	'mixed', 'Portchester'),
					    new Array(6, 10,	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(6, 10, 	'junfanjkd',    'senior', 'Portsmouth'),
	                                    new Array(6, 14, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(6, 14, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(6, 15, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(6, 17, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(6, 17, 	'filipinoma',    'senior', 'Portsmouth'),
                                            new Array(6, 21, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(6, 21, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(6, 22,	'junfanfma', 	'mixed', 'Portchester'),
	                                    new Array(6, 24, 	'grappling', 	'junior', 'Portsmouth'),
					    new Array(6, 24, 	'grappling',    'senior', 'Portsmouth'),
	                                    new Array(6, 28, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(6, 28, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(6, 29, 	'junfanjkd', 	'mixed', 'Portchester'),

                                            new Array(7, 1, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(7, 1, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(7, 5, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(7, 5,	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(7, 6, 	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(7, 8, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(7, 8,	'junfanjkd', 	'senior', 'Portsmouth'),

                                            new Array(7, 11, 	'seminar', 	'junior', '(10:00am - 12:00pm)\n\nJunior Kickboxing / Filipino Martial Arts / Games\n\nAdmiral Lord Nelson School (Main Hall)\nDundas Lane, Portsmouth. PO3 5XT'),
	                                    new Array(7, 12, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(7, 12, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(7, 13, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(7, 15, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(7, 15, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(7, 19, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(7, 19, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(7, 20, 	'junfanfma',    'mixed', 'Portchester'),
					    new Array(7, 22,	'grappling', 	'junior', 'Portsmouth'),
	                                    new Array(7, 22, 	'grappling', 	'senior', 'Portsmouth'),
					    new Array(7, 26, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(7, 26, 	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(7, 27, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(7, 29, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(7, 29, 	'junfanjkd', 	'senior', 'Portsmouth'),

                                            new Array(8, 2, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(8, 2, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(8, 3, 	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(8, 5,	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(8, 5, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(8, 9, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(8, 9,	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(8, 10, 	'junfanjkd',    'mixed', 'Portchester'),
	                                    new Array(8, 12, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(8, 12, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(8, 16, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(8, 16, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(8, 17, 	'junfanfma',    'mixed', 'Portchester'),
                                            new Array(8, 19, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(8, 19, 	'grappling', 	'senior', 'Portsmouth'),
					    new Array(8, 23,	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(8, 23, 	'filipinoma', 	'senior', 'Portsmouth'),
					    new Array(8, 24, 	'junfanjkd',    'mixed', 'Portchester'),
					    new Array(8, 26, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(8, 26, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(8, 27, 	'seminar', 	'senior', 'SMART 2010 - Friday\n\nPaulines Lodge\nManor Farm Country Park, Pylands Lane, Hamble, Southampton, Hamphire. SO31 1BH'),
                                            new Array(8, 28, 	'seminar', 	'senior', 'SMART 2010 - Saturday\n\nPaulines Lodge\nManor Farm Country Park, Pylands Lane, Hamble, Southampton, Hamphire. SO31 1BH'),
                                            new Array(8, 29, 	'seminar', 	'senior', 'SMART 2010 - Sunday\n\nPaulines Lodge\nManor Farm Country Park, Pylands Lane, Hamble, Southampton, Hamphire. SO31 1BH'),
                                            new Array(8, 30, 	'seminar', 	'senior', 'SMART 2010 - Monday\n\nPaulines Lodge\nManor Farm Country Park, Pylands Lane, Hamble, Southampton, Hamphire. SO31 1BH'),
					    new Array(8, 31, 	'junfanfma', 	'mixed', 'Portchester'),

                                            new Array(9, 2, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(9, 2, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(9, 6, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(9, 6,	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(9, 7, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(9, 9, 	'junfanjkd',    'junior', 'Portsmouth'),
					    new Array(9, 9,	'filipinoma', 	'senior', 'Portsmouth'),
	                                    new Array(9, 13, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(9, 13, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(9, 14, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(9, 16, 	'grappling',    'junior', 'Portsmouth'),
                                            new Array(9, 16, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(9, 20, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(9, 20, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(9, 21, 	'junfanjkd', 	'mixed', 'Portchester'),
					    new Array(9, 23,	'junfanjkd',    'junior', 'Portsmouth'),
	                                    new Array(9, 23, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(9, 27, 	'grappling', 	'junior', 'Portsmouth'),
	                                    new Array(9, 27, 	'grappling', 	'senior', 'Portsmouth'),
	                                    new Array(9, 28, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(9, 30, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(9, 30, 	'junfanjkd',   'senior', 'Portsmouth'),

                                            new Array(10, 4, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(10, 4, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(10, 5, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(10, 7,	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(10, 7, 	'filipinoma',    'senior', 'Portsmouth'),
                                            new Array(10, 11, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(10, 11,	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(10, 12, 	'junfanfma', 	'mixed', 'Portchester'),
	                                    new Array(10, 14, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(10, 14, 	'grappling',    'senior', 'Portsmouth'),
                                            new Array(10, 18, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(10, 18, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(10, 19, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(10, 21, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(10, 21, 	'junfanjkd',    'senior', 'Portsmouth'),
					    new Array(10, 25,	'grappling', 	'junior', 'Portsmouth'),
	                                    new Array(10, 25, 	'grappling', 	'senior', 'Portsmouth'),
					    new Array(10, 26, 	'junfanfma', 	'mixed', 'Portchester'),
	                                    new Array(10, 28, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(10, 28, 	'junfanjkd',   'senior', 'Portsmouth'),

                                            new Array(11, 1, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(11, 1, 	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(11, 2, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(11, 4,	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(11, 4, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(11, 8, 	'junfanjkd', 	'junior', 'Portsmouth'),
					    new Array(11, 8,	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(11, 9, 	'junfanfma',    'mixed', 'Portchester'),
	                                    new Array(11, 11, 	'grappling', 	'junior', 'Portsmouth'),
                                            new Array(11, 11, 	'grappling', 	'senior', 'Portsmouth'),
                                            new Array(11, 15, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(11, 15, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(11, 16, 	'junfanjkd',    'mixed', 'Portchester'),
                                            new Array(11, 18, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(11, 18, 	'junfanjkd', 	'senior', 'Portsmouth'),
					    new Array(11, 22,	'grappling', 	'junior', 'Portsmouth'),
	                                    new Array(11, 22, 	'grappling', 	'senior', 'Portsmouth'),
					    new Array(11, 23, 	'junfanfma',    'mixed', 'Portchester'),
	                                    new Array(11, 25, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(11, 25, 	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(11, 29, 	'junfanjkd', 	'junior', 'Portsmouth'),
	                                    new Array(11, 29, 	'junfanjkd', 	'senior', 'Portsmouth'),
	                                    new Array(11, 30, 	'junfanjkd', 	'mixed', 'Portchester'),

                                            new Array(12, 2, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(12, 2, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(12, 6, 	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(12, 6,	'junfanjkd', 	'senior', 'Portsmouth'),
                                            new Array(12, 7, 	'junfanfma', 	'mixed', 'Portchester'),
                                            new Array(12, 9, 	'grappling',    'junior', 'Portsmouth'),
					    new Array(12, 9,	'grappling', 	'senior', 'Portsmouth'),
	                                    new Array(12, 13,	'junfanjkd', 	'junior', 'Portsmouth'),
                                            new Array(12, 13, 	'filipinoma', 	'senior', 'Portsmouth'),
                                            new Array(12, 14, 	'junfanjkd', 	'mixed', 'Portchester'),
                                            new Array(12, 16, 	'junfanjkd',    'junior', 'Portsmouth'),
                                            new Array(12, 16, 	'junfanjkd', 	'senior', 'Portsmouth')

				    );

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthFarehamMixed(month) {

        timetableMonthHeader(month);
        timetableMonthComplex(month, classesCombined, 'Portchester', 'mixed', 0);
        timetableMonthFooterBlank();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthPortsSenior(month) {

        timetableMonthHeader(month);
        timetableMonthComplex(month, classesCombined, 'Portsmouth', 'senior', 0);
        timetableMonthFooterBlank();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthPortsJunior(month) {

        timetableMonthHeader(month);
        timetableMonthComplex(month, classesCombined, 'Portsmouth', 'junior', 0);
        timetableMonthFooterBlank();
}


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthHeader(index) {

        label = monthLabels[index - 1];
        document.write('<tr><td width="120" class="tt_titleheader" id="date_' + index + '">&nbsp;' + label + '</td>');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthFooter(link) {

	document.write('<td width="15" class="tt_more">&nbsp;<a href="' + link + '">more</a></td>');
        document.write('</tr>');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthFooterBlank() {

        document.write('</tr>');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableHeader() {

        document.write('<table cellpadding="2" cellspacing="1" border="0" width="550" bgcolor="black">');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableFooter() {

        document.write('</table>');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function ttHoverOver(ttEntry) {

	switch(ttEntry.className) {

		case 'tt_junfanfma':
			ttEntry.className='tt_junfanfma_hi';
                        if(parent.document.all.junfanfma != null) {
				parent.document.all.junfanfma.className='tt_junfanfma_hi';
                        }
			break;
		case 'tt_junfanjkd':
			ttEntry.className='tt_junfanjkd_hi';
                        if(parent.document.all.junfanjkd != null) {
				parent.document.all.junfanjkd.className='tt_junfanjkd_hi';
                        }
			break;
		case 'tt_filipinoma':
			ttEntry.className='tt_filipinoma_hi';
                        if(parent.document.all.filipinoma != null) {
				parent.document.all.filipinoma.className='tt_filipinoma_hi';
                        }
			break;
		case 'tt_grappling':
			ttEntry.className='tt_grappling_hi';
                        if(parent.document.all.grappling != null) {
				parent.document.all.grappling.className='tt_grappling_hi';
                        }
			break;
		default:
			break;
	}
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function ttHoverOut(ttEntry) {

	switch(ttEntry.className) {

		case 'tt_junfanjkd_hi': 	ttEntry.className=parent.document.all.junfanjkd.className	='tt_junfanjkd';	break;
		case 'tt_junfanfma_hi': 	ttEntry.className=parent.document.all.junfanfma.className	='tt_junfanfma';	break;
		case 'tt_filipinoma_hi': 	ttEntry.className=parent.document.all.filipinoma.className	='tt_filipinoma';	break;
		case 'tt_grappling_hi': 	ttEntry.className=parent.document.all.grappling.className	='tt_grappling';	break;
		default:
			break;
	}
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthPortsSeniorAllComplex() {

        timetableHeader();

        for (iMonths = 1; iMonths <= 12; iMonths ++) {
                timetableMonthHeader(iMonths);
        	timetableMonthComplex(iMonths, classesCombined, 'Portsmouth', 'senior', 9);
                timetableMonthFooterBlank();
        }

        timetableFooter();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthPortsJuniorAll() {

        timetableHeader();

        for (iMonths = 1; iMonths <= 12; iMonths ++) {
                timetableMonthHeader(iMonths);
        	timetableMonthComplex(iMonths, classesCombined, 'Portsmouth', 'junior', 9);
                timetableMonthFooterBlank();
        }

        timetableFooter();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthFarehamMixedAll() {

        timetableHeader();

        for (iMonths = 1; iMonths <= 12; iMonths ++) {
                timetableMonthHeader(iMonths);
        	timetableMonthComplex(iMonths, classesCombined, 'Portchester', 'mixed', 5);
        	timetableMonthFooterBlank();
        }

        timetableFooter();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthComplex(month, timetable, club, student, filler) {

        var entries = 0;

        for (iIndex = 0; iIndex < timetable.length; iIndex++) {

                if ((timetable[iIndex][0] == month) &&
                    (timetable[iIndex][3] == student) &&
                    (timetable[iIndex][4] == club)
		   ) {

                        timetableEntryComplex(	timetable[iIndex][0],
						timetable[iIndex][1],
						timetable[iIndex][2],
						timetable[iIndex][3],
						timetable[iIndex][4] );
                        entries ++;
                }
        }

        if (filler != 0) {
                var spacer = filler - entries;
                for (i = 0; i < spacer; i ++) {
                	document.write('<td width="72" class="tt_titleheader"></td>');
                }
        }
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableEntryComplex(entrymonth, entrydate, entryclass, entrystudent, entrylocation) {

        var today = new Date();
        var date = new Date();
        date.setFullYear(_year, entrymonth - 1, entrydate);

        var title = getFormattedDate(date) + "\n(" +
		    getClassTimeTitle(date.getDay(), entrystudent)+ ")\n\n" +
                    getClassTitle(entryclass) + "\n\n" +
		    getStudentTitle(entrystudent) + "\n\n" +
		    getLocationTitle(entrylocation);

        if ((date.getDate() == today.getDate()) && (date.getMonth() == today.getMonth())) {

        	document.write('<td width="80" class="tt_' + entryclass + '" align="middle">' +
			'<a href="#" title="' + title + '">' +
                        '<table cellpadding="0" cellspacing="0" border="0" bordercolor="white" width="100%" height="100%"><tr><td align="middle" onmouseover="ttHoverOver(this)" onmouseout="ttHoverOut(this)" class="tt_' + entryclass + '">' +
			'<u>' + entrydate + '</u>'+
                        '</td></tr></table>' +
			'</a></td>');

                // '<font class="tt_today">* ' + entrydate + ' *</font>'+

        } else {
        	document.write('<td width="80" class="tt_' + entryclass + '" align="middle">' +
			'<a href="#" title="' + title + '">' +
                        '<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="middle" onmouseover="ttHoverOver(this)" onmouseout="ttHoverOut(this)" class="tt_' + entryclass + '">' +
			entrydate +
                        '</td></tr></table>' +
			'</a></td>');

        }
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getClassTitle(className) {

        var title = '';
	switch (className) {
                case 'junfanfma':  	title = 'Jun Fan Martial Arts / Filipino Martial Arts';  	break;
                case 'junfanjkd': 	title = 'Jun Fan Martial Arts / Jeet Kune Do / MMA';  		break;
                case 'filipinoma':      title = 'Filipino Martial Arts / Kali';         		break;
                case 'grappling':       title = 'Grappling / Combat Submission Wrestling (CSW)';	break;
                default:                title = '';							break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getClassShortTitle(className) {

        var title = '';
	switch (className) {
                case 'junfanfma':  	title = 'JKD FMA';  	break;
                case 'junfanjkd': 	title = 'JKD';  	break;
                case 'filipinoma':      title = 'FMA';         	break;
                case 'grappling':       title = 'Grappling';	break;
                default:                title = '';		break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getStudentTitle(studentType) {

        var title = '';
	switch (studentType) {
                case 'junior':  	title = 'Juniors (<16 years)';  	break;
                case 'senior': 		title = 'Seniors only (16 years +)';  	break;
                case 'mixed':           title = 'Juniors and Seniors';         	break;
                default:                title = 'unknown';			break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getLocationTitle(location) {

        var title = '';
	switch (location) {
                case 'Portsmouth':  	title = 'Anchorage Lodge Dojo, Portsmouth';  			break;
                case 'Portchester': 	title = 'Portchester Community School Dojo, Portchester';  	break;
                default:                title = 'unknown';						break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getLocationShortTitle(location) {

        var title = '';
	switch (location) {
                case 'Portsmouth':  	title = 'Portsmouth';  	break;
                case 'Portchester': 	title = 'Portchester';  break;
                default:                title = 'unknown';	break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getClassTimeTitle(day, type) {

        var title = '';
	switch (type) {
                case 'junior':
			title = '7:00pm - 7:55pm';
			break;
                case 'senior':
			if (day == 1) { title = '8:00pm - 9:00pm'; }
                        if (day == 4) { title = '8:00pm - 9:00pm'; }
                        if (day == 2) { title = '8:00pm - 9:00pm'; }
                        break;
                case 'mixed':
			title = '7:15pm - 8:15pm';
			break;
                default:                
			title = '';				
			break;
        }
        return(title);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function highlightMonth() {

	var now 	= new Date();
	var strdate 	= 'date_' + (now.getMonth() + 1);
	var obj 	= eval('document.all.' + strdate);
	obj.className 	= 'tt_titlenow';
}


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function setTimetablePage(page) {

        setCookie("sma_timetable_page", page);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getTimetablePage() {

	page = getCookie("sma_timetable_page");
        if (page=="") {
                return("./timetable_insert_portsmouth_seniors.html");
        } else {
                return(page);
        }
}


//-----------------------------------------------------------------------------
//
// Calendar View Support
//
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableCalendarView() {


	// Get last setting for parameters
        var setMonth 	= getCookie('tt_manualmonth');


        if (setMonth == '') {
		var now = new Date();
	        setMonth = now.getMonth() +1;
		setTempCookie('tt_manualmonth', setMonth);
        }

        var setStudent 	= getCookie('tt_manualstudent');
        if (setStudent == '') {
        	setStudent = 'seniormixed';
	        setTempCookie('tt_manualstudent', setStudent);
        }

        timetableMonthOverviewCalendar(setMonth, classesCombined, setStudent);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableMonthOverviewCalendar(month, timetable, student) {

        var today       = new Date();

        var colCount 	= 1;
        var colMax      = 7;
        var thisMonth 	= new Array(monthNumbDays[month -1]);
        var today       = new Date();

        // Move this month to a separate array for the student types requested
        for (iBuild = 0; iBuild < timetable.length; iBuild++) {

                if ((timetable[iBuild][0] == month)
		 && (student.indexOf(timetable[iBuild][3]) != -1)) {

                        thisMonth[timetable[iBuild][1] -1]
					= new Array(	timetable[iBuild][0],
		        	       			timetable[iBuild][1],
				       			timetable[iBuild][2],
				       			timetable[iBuild][3],
				       			timetable[iBuild][4] );
                }
        }

        document.write('<form name="timetable">');
        document.write('<table cellpadding="4" cellspacing="1" border="0" bgcolor="black">');

        // Output Month and Controls row
        document.write('<tr><td colspan="7" class="tt_titlenow">');

	document.write('<select name="month" class="month_select" onchange="setMonth(document.timetable.month.options[document.timetable.month.selectedIndex].value)">');
        for (iMonths = 0; iMonths < monthLabels.length; iMonths ++) {

                document.write('<option class="month_select" value="' + (iMonths + 1) + '"' + ((iMonths == (month - 1)) ? ' selected' : '')+ '>' + monthLabels[iMonths] + '</option>');
        }
	document.write('</select>');
       	document.write('<select name="student" class="month_select" onchange="setStudent(document.timetable.student.options[document.timetable.student.selectedIndex].value)">>');
	document.write('<option value="seniormixed"' + ((student.indexOf('senior') != -1) ? ' selected' : '') + '>Senior</option>');
	document.write('<option value="juniormixed"' + ((student.indexOf('junior') != -1) ? ' selected' : '') + '>Junior</option>');
	document.write('</select>');

        // TODO - month forward and back buttons
        // document.write('&nbsp;<a href=""><b><</b></a>');
        // document.write('&nbsp;<a href=""><b>></b></a>');

	document.write('</td></tr>');

        // Output Titles
        document.write('<tr><td align="center" width="72" class="tt_titleheader">Mon</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Tue</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Wed</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Thu</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Fri</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Sat</td>');
	document.write('<td align="center" width="72" class="tt_titleheader">Sun</td></tr>');

        document.write('<tr height="30">');

        // Lead in to start day of month
        for (iOffSet = 1; iOffSet < monthStartDay[month -1]; iOffSet ++) {

                document.write('<td width="72" class="tt_transparent">&nbsp;</td>');
                colCount ++;
        }

        // Output days of month with classes
        for (iIndex = 0; iIndex < thisMonth.length; iIndex++) {

                // If there is data in the month array then there is a class to output
                if (thisMonth[iIndex] != null) {

			timetableEntryComplexCalendar(thisMonth[iIndex][0], thisMonth[iIndex][1], thisMonth[iIndex][2], thisMonth[iIndex][3], thisMonth[iIndex][4] );
                } else {

	                // document.write('<td width="72" class="tt_blank" align="middle">' + (iIndex + 1) + '</td>');

                        if (((iIndex + 1) == today.getDate()) && (month == (today.getMonth() + 1))) {

                        	document.write('<td width="72" class="tt_blank" align="middle"><font class="tt_todayblank">--- ' + (iIndex + 1) + ' ---</font></td>');
                        } else {

                		document.write('<td width="72" class="tt_blank" align="middle">' + (iIndex + 1) + '</td>');
                	}
                }

                if (colCount == colMax) {

                        // New row ...
                        if (iIndex < thisMonth.length -1 ) {
	                        document.write('</tr><tr height="30">');
                        }
                        colCount = 1;
                } else {
                        colCount ++;
                }

        }

        // Lead out to end of month
        if (colCount != 1) {
	        for (; colCount <= colMax; colCount ++) {
	                document.write('<td width="72" class="tt_transparent">&nbsp;</td>');
	        }
        }

        document.write('</tr>');
        document.write('</table>');
        document.write('</form>');
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function timetableEntryComplexCalendar(entrymonth, entrydate, entryclass, entrystudent, entrylocation) {

        var today = new Date();
        var date = new Date();
        date.setFullYear(_year, entrymonth - 1, entrydate);
        var title = "";
        var shortTitle = "";


        if (entryclass == 'seminar') {

                shortTitle = "Seminar";
        	title = getFormattedDate(date) + "\n\n" + entrylocation;
                link = "./seminars.html";

        } else if (entryclass == 'grading') {

                shortTitle = "SMA Grading";
        	title = getFormattedDate(date) + "\n\n" + entrylocation;
                link = "./grades.html";

        } else {
                shortTitle = getClassShortTitle(entryclass);
        	title = getFormattedDate(date) + "\n(" +
		    	getClassTimeTitle(date.getDay(), entrystudent)+ ")\n\n" +
                    	getClassTitle(entryclass) + "\n\n" +
		    	getStudentTitle(entrystudent) + "\n\n" +
			getLocationTitle(entrylocation);
                link ="#";
        }

        if ((date.getDate() == today.getDate()) && (date.getMonth() == today.getMonth())) {

                document.write('<td width="80" class="tt_' + entryclass + '" align="middle">' +
				'<a href="' + link + '" title="' + title + '" target="_parent">' +
	                        '<table cellpadding="0" cellspacing="0" border="0" bordercolor="white" width="100%" height="100%"><tr><td align="middle" class="tt_' + entryclass + '" onmouseover="return(ttHoverOver(this))" onmouseout="return(ttHoverOut(this))">' +
				'<u>' + entrydate + '</u><br>' + shortTitle + '</td></tr></table>' +
				'</a></td>');
        } else {

                document.write('<td width="80" class="tt_' + entryclass + '" align="middle">' +
				'<a href="' + link + '" title="' + title + '" target="_parent">' +
	                        '<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="middle" class="tt_' + entryclass + '" onmouseover="return(ttHoverOver(this))" onmouseout="return(ttHoverOut(this))">' +
				entrydate + '<br>' + shortTitle + '</td></tr></table>' +
				'</a></td>');
        }
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

function setMonth(month) {

        setTempCookie('tt_manualmonth', month);
        document.location.reload();
}

function setStudent(student) {

	setTempCookie('tt_manualstudent', student);
        document.location.reload();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

function getClassShortName(className) {

        var title = '';
	switch (className) {
                case 'junfanfma':  	title = 'Jun Fan - FMA';  	break;
                case 'junfanjkd': 	title = 'Jun Fan - JKD';  	break;
                case 'filipinoma':      title = 'FMA - Kali';         	break;
                case 'grappling':       title = 'Grappling';		break;
                default:                title = '';			break;
        }
        return(title);
}

function getTodaysClass(student) {

        var today = new Date();
        var todaysClass = "";



	for (indexClasses = 0; indexClasses < classesCombined.length; indexClasses++) {

		if ((classesCombined[indexClasses][0] == (today.getMonth() + 1)) &&
                    (classesCombined[indexClasses][1] == today.getDate()) &&
		    (student.indexOf(classesCombined[indexClasses][3]) != -1) ) {

                    todaysClass = getClassShortName(classesCombined[indexClasses][2])
		    			+ ' in ' + classesCombined[indexClasses][4];
                }
        }
        return(todaysClass);
}


function getTodaysAdultClass() {

	return(getTodaysClass('seniormixed'));
}

function getTodaysJuniorClass() {
	return(getTodaysClass('juniormixed'));
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------