$(document).ready(function() {
	
	// header slide show
	if($().cycle) {
		$('#slideshow_1').cycle({
			fx: 'fade',
			speed: 4200,
			timeout: 1000,
			delay: 3500
			
		});
		
		$('#slideshow_2').cycle({
			fx: 'fade',
			speed: 2200,
			timeout: 3700,
			delay: 2500
		});
		
		$('#slideshow_3').cycle({
			fx: 'fade',
			speed: 3800,
			timeout: 1800,
			delay: 4500
		});
		
		$('#slideshow_lg').cycle({
			fx: 'fade',
			speed: 3200,
			timeout: 4500,
			delay: 1000
		});

		// home slide show
		if ($('#home_slideshow').length != 0) {
			$('#home_slideshow').cycle({
				fx: 'fade',
				speed: 1500,
				timeout: 200000,
				pager: '#home_slideshow_pager',
				pause: true,
				cleartype: true
			});
		}
	}

	// sets the height of the subnav section on the home page to recess into the footer
	$('#nd_home .subnav_wrapper').css('min-height',$('#main_content').height() - '204' +'px');

	//removes dividers from the last element of the nav
	$('#nav ul.nav1 li:last-child').css('border-right', 'none');
	
	$('#nav ul li ul li:last-child a').css('border-bottom', 'none');
	
	//$('#subnav ul li ul li:last-child a').css('border-bottom', 'none');
		
	
	
	//removes the subnav if it isn't present
	if ($("#subnav ul li.on").children("ul").length == 0) {
		$("#subnav_area_wrapper").remove();
	}

	
	//changes the page width on pages w/o a subnav area
	if ($("#subnav_area").children().size() == 0) {					
		$("#main_content").css({
			"width": "auto",
			"margin-left": "0",
			"float": "none"
		});
	}

});


