$(document).ready(function() {
		
		$('#ikony a[href*="#"]').click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
 
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
			
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		var trgt2 = this.name;
		var trgt3 = this.title;
 
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
 
		//goto that anchor by setting the body scroll top to anchor top
		function do_gory() {$('html, body').animate({scrollTop:target_top}, 1000);}
		
		function zwin () { $('.zwin_rzad').animate({height: 0},1000, function(){$('.zwin_rzad').html(''); podmien();}); }
		
		function rozwin() {$('#'+trgt2).animate({height: 660},1000); }
				
		function podmien() {$.post("wyszukiwanie.php", {szukaj_po: trgt3, nazwa_strony:location.pathname}, function(data) {$('#'+trgt2).html(data);});}
	    
		do_gory();
		zwin();
		
		rozwin();
		
		
		
	});
		
		
		$('#navbar a.rozwin').click(function() {
					name = $(this).attr("name");
					$('.rozwin_hidden').hide();
					$('#'+name).show();
					$('#navbar').animate({height:'300'}, 400);
			});
			
			
			

	var buttons = { previous:$('#lofslidecontent45 .lof-previous') ,  next:$('#lofslidecontent45 .lof-next') };
						
		$obj = $('#lofslidecontent45').lofJSidernews( { interval : 4000,
												direction		: 'opacity',	
											 	easing			: 'easeInOutQuad',
												duration		: 2000,
												auto		 	: true,
												mainWidth:1000,
												buttons			: buttons} );	
	
			
			
			$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    $('img.image1').data('ad-title', 'Title through $.data');
    $('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
    $('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var galleries = $('.ad-gallery').adGallery();
    $('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $(this).val();
        return false;
      }
    );
    $('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
    $('#toggle-description').click(
      function() {
        if(!galleries[0].settings.description_wrapper) {
          galleries[0].settings.description_wrapper = $('#descriptions');
        } else {
          galleries[0].settings.description_wrapper = false;
        }
        return false;
      }
    );

  
			
/*			
			$('#navbar a.rozwin ').mouseover(function() {
				name = $(this).attr("name");
				$('.rozwin_hidden').hide();
				$('#'+name).show();
				$('#navbar').animate({height:'80'}, 400);
			});
			$('#navbar a.zwin ').mouseover(function() {
				$('.rozwin_hidden').hide();
				$('#navbar').animate({height:'35'}, 200);
			});
			$('#navbar').mouseleave(function() {
			$('.rozwin_hidden').hide();
			$('#navbar').animate({height:'35'}, 200);
			});
*/

});

	



