$(document).ready(function(){
						   
	$("ul.nav li").hover(function(){
		$(this).children("a").addClass("active");
		$(this).children("ul").css("display", "block");

		},function(){
			$(this).children("a").removeClass("active");
			$(this).children("ul").css("display", "none");	
	});
	
	$('.nav7 > ul > li:first').removeClass('navTopper').addClass('navTopperLeft');
	
	$('.slideShow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:  'slow',
		cleartypeNoBg: true,
		//timeout: 6000,
		cleartypeNoBg: true, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) 
		pager:  '#nav', //heres how you call the thumbnail pager into being.
		pagerAnchorBuilder: function(idx, slide) { //and this is the function of the pager
			// return selector string for existing anchor 
			return '#nav li:eq(' + idx + ') a'; 
		} 
	});
	
	$closePortlet = $(".closePortlet");
	$(".btn-slide").click(function(){
				$(".closePortlet").css("display", "block");
				$(this).parent().next("div").slideToggle("slow");
				$(this).toggleClass("active"); 
				var activeCount = $("div.resourceMenu h4 a.active");
				if(activeCount.length == 0){
					$closePortlet.css("display","none");
				}
				return false;
				
	});
	$closePortlet.click(function(){
				$(".btn-slide").parent().next("div").slideUp("slow");
				$(".btn-slide").removeClass("active");
				$(this).css("display", "none");
	});
	
});
