$(function(){
	// populating the redirect field
	$("input[name=redirect]").val(window.location.pathname);
	// if they click on the login link
	$("a.loginlink").click(function(){
		$("form#redirectlogin").submit();
		return false;
	});
	
	// adding a hover hand
	$(".hover, .button91").hover( 
		function () {
	      	$(this).css('cursor', 'pointer');
	        $(this).css('cursor', 'hand');
	      }, 
	      function () {
	        $(this).css('cursor', 'auto');
	      }
	 );
	
	// toggling view all articles
	$("a#togglearticles").click(function(){
		if($("div.filmarticlesummary:hidden").length > 0)
		{
			$("div.filmarticlesummary:hidden").show();
			$(this).text('Hide all');
		}
		else
		{
			$("div.filmarticlesummary").hide();
			$("div.filmarticlesummary:first").show();
			$(this).text('View all');
			
		}
	});
	
	
	// registering the fancy box
	$("a.galleryimage, a.vidlink").fancybox({
		'frameHeight': 500,
		'frameWidth': 800,
		'callbackOnShow' : function() {
		/*
			var offsetBox = $("#fancybox-inner").offset();
			var offsetFB = $(".facebooklikeit iframe").offset();
			alert(offsetBox.top);
			alert(offsetBox.left);
			alert(offsetFB.top);
			alert(offsetFB.left);
			$(".facebooklikeit iframe").css('visibility', 'hidden');
			*/
		},
		'callbackOnClose': function() {
			$("#fancy_content").empty();
			$(".facebooklikeit iframe").css('visibility', 'visible');
		} 
	}); 
	


});

	
	
