$(document).ready(function() {

	if($().cycle) {
	
	var slidecount=$("#slideshow > div.slide").length;
	var randomnumber=Math.floor(Math.random()*1000000)%slidecount;
				
		$('#slideshow').cycle({
			fx: 'fade',
			speed: 1500,
			timeout: 5000,
			cleartype: 1,
			startingSlide:randomnumber, 
			pause: 1,
			pager: '#pager'
		});
	}


	
	//removes dividers from the last element of the nav
	$('#nav ul.nav1>li:last-child a').css({
		'background-image': 'none',
	
	});
		
		
	//removes the subnav if it isn't present
	if ($("#subnav ul li.on").children("ul").length == 0) {
		$("#subnav").remove();
	
	$("#main_content").css({
			"width": "auto",
			"float": "none"
		});
	}
});



