$().ready(function()
{
	$("body.locked #menu-shows").attr("href","#");
	$("#news-window").height(25).hide();
	$("#news-header").click(function()
			{
				$(this).hide();
				$("#news-window").show().animate({height:'266px'});
			});

	$("#news-window").click(function()
			{
				$("#news-window").show().animate({height:'25px'},function()
						{
							$("#news-window").hide();
							$("#news-header").show();
						});
			});
	// hide gallery upload form submit button and submit after file input change
	$("#upload-image-form input[type=submit]").hide();
	$("#upload-image-form input[type=file]").change(function()
													{
														$("#upload-image-form").submit();
													});
	
	//add lightbox functionality
	$('body.locked .gallery-image a').lightBox({ txtImage: 'Billede' ,txtOf: 'af' }); // Select all links that contains lightbox in the attribute rel
	//$('#show-poster a').lightBox();
	
	
	//make reset link for edit show page
	$resetLink = $('#reset-link');
	if($resetLink.length>0)
	{
		$resetButton = $(document.createElement('input'));
		$resetButton.attr('type','button').attr('value',$resetLink.text()).attr('title',$resetLink.attr('title')).click(function(){window.location='?';});
		$resetLink.replaceWith($resetButton);
	}
});