$(document).ready(function(){
	
	/* block site from being loaded within a frameset */
	if (window!=top){
		top.location.href=location.href;
	}
	
	/* menu dropshadow */
	dropshadow_opties = {
		left: 1,
		top: 2, 
		blur: 0,
		opacity: 0.31
	};
	
	$("div#menu > ul > li[class!=active] > a").each(function(){
		$(this).dropShadow(dropshadow_opties);
	});
	
	$("div#menu > ul > li").mouseenter(function(){
		
		// remove dropshadow on this link
		$(this).children("a").removeShadow();
		
		// remove all other active classes
		//activeLink = $("div#menu > ul > li[class=active]");
		//activeLink.removeClass("active");
		
	}).mouseleave(function(){
		
		// add dropshadow on this link
		if (!$(this).hasClass("active")) $(this).children("a").dropShadow(dropshadow_opties);
		
		// add active class on other link
		//activeLink.addClass("active");
	});

	/* cycle plugin */
	if($("#header-image").hasClass('cycle'))
	{
		$("#header-pager").empty();
			$("#header-image.cycle").cycle({ 
		    fx: 'fade', 
		    timeout: 4000,
			pause: 1,
			pager: '#header-pager',
			activePagerClass: 'active',
			pagerEvent: 'mouseover', 
    		pauseOnPagerHover: true,
			allowPagerClickBubble: true,
			pagerAnchorBuilder: function(idx, slide) 
			{ 
	        	var alt = $(".cycle > #item"+idx+" > img").attr("alt");
				var href = $(".cycle > #item"+idx+" > .info > a").attr("href");
				return '<li><a href="'+href+'">' + alt +'</a></li>'; 
	   		} 
		});
	}
});
