$(document).ready(function() {
	if($().cycle){			
		if ($('#featured_slideshow').length != 0) {
			$('#featured_slideshow').cycle({
				fx: 'fade',
				speed: 500,
				timeout: 8000,
				cleartype: true,
				random: true	
			});
		}
		
		if ($('#slideshow').length != 0) {
			$('#slideshow').cycle({
				fx: 'fade',
				speed: 500,
				timeout: 8000,
				cleartype: true,
				random: true,
				next: '#next',
				prev:'#prev'
			});
		}
	}
	
	//removes divider from the last element of the nav
	$('#nav ul.nav1>li:last-child').css({
	    'background-image': 'none',
	    'padding-right' : 0
	});

	
	
	// fundraiser accordion
	//accordion
	$('.acc_trigger a[id^="mpip"]').addClass('edit');
	$('.acc_trigger:last').css('margin-bottom', '0')
	
	$('.acc_container').hide();
	$('.acc_trigger:first').addClass('active').next().show();
	
	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { 
			$('.acc_trigger').removeClass('active').next().slideUp(); 
			$(this).toggleClass('active').next().slideDown();}
		return false; 
	});

		    	
	    
	//removes the subnav if it isn't present
	if ($("#subnav ul li.on").children("ul").length == 0) {
	    $("#subnav_area").remove();
	}
	
	//changes the page width on pages w/o a subnav area
	if ($("#subnav_area").children().size() == 0) {					
	    $("#main_content").css({
			"width": "auto",
	    	"padding-left": "20px",
	    	"padding-right": "20px",
	    	"float": "none"
	    });
	}

});

