$(document).ready(function(){
	$('#main-sections li').each(function(_ind, _el) {
		var _box = $(_el).find('div:first');

		if($(_el).find('li').hasClass('active')) {
			_box.height('auto');
			_box.addClass('expanded');
		}

		if (_box.length > 0) {
			$(_el).find('a:first').click(
				function(){
					if (_box.hasClass('expanded'))
					    _box.stop().css('overflow','hidden').animate({height:0}, 500);
					else
					    _box.stop().css('overflow','hidden').animate({height: _box.children('ul').outerHeight()}, 500, 
					  	function (){ _box.css('height','auto'); });
					_box.toggleClass('expanded');
					return false;
				}
			);
		}

		if ($(_el).hasClass('active')) {
			_box = $(_el).find('div:first');
			_box.height('auto');
			_box.addClass('expanded');
		}
	});
	
	// Table - even/odd rows
    $('table tbody tr:odd').addClass('odd');
    $('table tbody tr:even').addClass('even');
    $('table tfoot tr:odd').addClass('odd');
    $('table tfoot tr:even').addClass('even');
	
	
});
