$(document).ready(function(){
	if ($('#home_slideshow').length !== 0){
		$('#home_slideshow').cycle({
			fx: 'fade',
			speed: 1000,
			random: true,
			cleartype: true,
			timeout: 6000,
			next:   '#next', 
   			prev:   '#prev'
		});
	}	
	
	// fundraiser accordion
	lastBlock = $("#a1");
	maxWidth = 354;
	minWidth = 140;	
    
	$("ul li div.trigger").hover(	
		function(){			
			$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
			currentBlock = this;				
			lastBlock = this;			
		}
	);
 	
 	//removes divider from the last element of the nav
	$('#nav ul.nav1>li:last-child').css({
	    'background-image': 'none',
	    'padding-right' : 0
	});
	    	  
	// Sub same height as Main
	$('.sub').css('min-height' , $('.main').height() -10 + 'px');
	
	//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"
	    });
	}

});
