$(document).ready(function(){
	$.smoothAnchors("fast", "swing", false);
	$("a").focus(function(){
		$(this).blur();
	});
	$("#menu").stickyfloat({duration: 200, lockBottom: false});
	$("img").pngfix();
	$("#menu").pngfix();
	$("h1").pngfix();
//	resizePage();
//	$(window).resize(resizePage);
	$("img[rel]").overlay({effect: 'apple'});
	hideGaleries();
	$("a.show").live('click', showGallery);
	$("a.hide").live('click', hideGallery);
	$("a.close").click(hidePopup);
});

function resizePage() {
	$("div.page").css('minHeight', $(window).height()-20);
	$("div.last").css('minHeight', $(window).height()-260);
}

function hideGaleries() {
	$("ul.gallery").each(function(){
		if ($(this).attr('id') != 'gal1')
			$(this).hide();
	});
}

function showGallery() {
	var id = $(this).attr('id').substring(4);
	$('#gal' + id).slideDown('slow');
	$(this).attr('class', 'hide').html('zwiń');
	return false;
}

function hideGallery() {
	var id = $(this).attr('id').substring(4);
	$('#gal' + id).slideUp('slow');
	$(this).attr('class', 'show').html('rozwiń');
	return false;
}

function hidePopup() {
	$("#konkurs").fadeOut('slow', function(){$(this).remove()});
	return false;
}
