// Common Moo needed for SDA


window.addEvent('domready', function() {
		
		// Add a class to the last list item on the submenu pages, only needed until IE properly supports css selectors
		if($('side-bar-list')) {
			$$('li:last-child').addClass('sub-menu-item-last');
		}	
		
		// Format the dates caledar with zebra stripes and blue overlays
		if($$('.calendarTable').length > 0) {
			
			$$('.calendarTable').each(function(el) {
				el.getElements('tr:odd').setStyle('background-color', '#e5e5e5');
				el.getElements('tr:odd').setStyle('border', '#000');
				
				// Hover
				el.getElements('tr').addEvents({
						'mouseenter': function(){
							$(this).toggleClass("highlight");
						},
						'mouseleave': function(){
							$(this).toggleClass("highlight");
						}
					});
			});

		}
		
		if($('accordion')) {
			// Add the accordian where available
			var myAccordion = new Accordion($('accordion'), 'span.toggler', 'div.element', {
				opacity: false,
				onActive: function(toggler, element){
					toggler.setStyle('color', '#41464D');
				},
				onBackground: function(toggler, element){
					toggler.setStyle('color', '#528CE0');
				}
			});
		}
});
