$(document).ready(function() {
	if($().cycle) {
		
	
		if ($('#home_slideshow').length != 0) {
			$('#home_slideshow').cycle({
				fx: 'fade',
				speed: 500,
				timeout: 8000,
				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
	});

	
	//accordion
	$('.acc_trigger a[id^="mpip"]').css({
		'background':'none',
		'display':'inline'
	});
	
	$('.acc_trigger:last').css('background', 'none')
	$('.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"
	    });
	}


});

