jQuery(document).ready(function($) {

	$("body").append("<div id='opaque' style='display: none;'></div>");
	
	$(document).bind('loading.facebox', function() {
		$("#opaque").show();
	});
	$(document).bind('close.facebox', function() {
		$("#opaque").hide();
	});
	$(document).bind('afterReveal.facebox', function() {
		// this is a fix for IE6 which resets the height to 100% of the window height
		$("#opaque").height($(document).height());
	});

	if(jQuery.cookie('movie') == null)
	{
		jQuery('a[rel*=facebox]').facebox({
			loading_image : 'loading.gif',
			close_image   : 'closelabel.gif'
		  });
		  jQuery('a[rel*=facebox]').click();
		  jQuery.cookie('movie', '1', { expires: 180 });
	  }
  
});