$(function(){		
		//Takes all the nav items with subnav elements and adds appropriate accordian classes
		$('#sidebar-left li a').each(function(){			
			if($(this).siblings('ul').length == 1){
				$(this).addClass('head').addClass('acrdnParent');
			}
		});
		
		//Removes previously assigned accordian classes from subnav items 
		$('#sidebar-left ul ul a').removeClass('head').removeClass('acrdnParent');
		
		//Adds background color hover state to parent nav items when subnav items are being hovered over
		$('#sidebar-left ul li').hover(function(){
			$(this).children('a.acrdnParent').css('background','#9bcce2 url(/sites/all/themes/spar/images/arrow2.gif) no-repeat 95%')
			.css('color','#0b2464');
		},function(){
			$(this).children('a.acrdnParent').css('background','#cde6f1 url(/sites/all/themes/spar/images/arrow.gif) no-repeat 95%')
			.css('color','#015D7C');
		});
		
		//The parent UL of the current subnav nav element will always show even if other subnavs are opening and closing (
		//done by removing the 'head' class which the accordian plugin uses to add functionality)
		$('.active').parents('ul').addClass('showMe');
		$('.showMe').siblings('a').removeClass('head').attr('href','javascript:void');

		
		//Assigns accordian class to navigation
		$('#sidebar-left').accordion({ 
			autoHeight: false,
			active: false,
			header: '.head',
			navigation: true
		});
	
		//Removes animation if using Internet Explorer (because animation was causing bugs)
		if($.browser.msie){
			$('#sidebar-left').accordion('option', 'animated',false);
		}
	});