$(document).ready(
    function() {

        $('h3.category').click(function(){
            $(this).next("ul").slideToggle("normal");
        });

        $('#left_menu').find("ul li.current").parent("ul").show();

		$('img.miniaturka').each(function() {
			var adres_zdjecia = $(this).attr("src");
			if(adres_zdjecia != null) {
				while (adres_zdjecia.search('13590') != -1)
				adres_zdjecia = adres_zdjecia.replace('croppedimage13590', 'SetHeight450');

				$(this).parents("a").attr("href", adres_zdjecia);
			}
		});

		$('img.main_img').each(function() {
			var adres_zdjecia = $(this).attr("src");
			if(adres_zdjecia != null) {
				while (adres_zdjecia.search('220150') != -1)
				adres_zdjecia = adres_zdjecia.replace('croppedimage220150', 'SetHeight450');

				$(this).parents("a").attr("href", adres_zdjecia);
			}
		});

		$('a.lightbox').lightBox();
		$('div.article:first').show();
		
		$("ul#tabs li:first").addClass("active");
		$("ul#tabs li a").click(function() {
			$("ul#tabs li").removeClass("active");
			$(this).parent("li").addClass("active");
			var klasa = $(this).attr("class");
			$(".article").hide();
			$("div#"+klasa).show();
			return false;
		});

        $('a.load-local').cluetip({
            local: true,
            cursor: 'pointer',
            arrows: true,
            showTitle: false
        });

        $('a.load-local').click(function(){
            window.location = $(this).attr('href');
        });
		
		$('div.gallery ul li').each(function() {
			var pos = $(this).attr('class');
			if(parseInt(pos) % 4 == 0) { $(this).addClass('nomr'); }
		});
		

    }

);
