$(function() {
	$(".sidebar.left ul li").hover(function(e) {
		$(this).css("z-index", 999);
		$(this).find("ul").stop(true, true).fadeIn(200);
	}, function() {
		$(this).css("z-index", 400);
		$(this).find("ul").stop(true, true).fadeOut(200);
	});
	
	$("#gotfilm").fancybox();
	$("[rel*=fancybox]").fancybox();
	
	$("#load_more_announcements").click(function() {
		$(".more_announcements").fadeIn();
		return false;
	});
	
	$("#video_list .title a").each(function() {
			$(this).append("<span class='slide'>click to open</span>");
		});
		$("#video_list .title a").live("click", function() {
			var direction = $(this).find(".slide");
			if (direction.text() != "click to close") {
				direction.text("click to close");
			}
			else {
				direction.text("click to open");
			}
			
			var videoCont = $(this).parent().next();
			if (videoCont.find("iframe").attr("src") == "") {
				var iframeLink = videoCont.find(".frame_link").attr("href");
				console.log(iframeLink);
				videoCont.find("iframe").attr("src", iframeLink);
			}
			else {
				videoCont.find("iframe").attr("src", "");
			}
			videoCont.slideToggle();
			return false;
		});
	
	$('a[rel*="external"]').each(function() {$(this).attr("target", "_blank");});
});
