

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23135032-1']);
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script');ga.type = 'text/javascript';ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga, s);
  })();



$(document).ready(function(){
 // =========================== Przesuwanie obrazków na stronie głównej ========================= /
 $('.block_warp').hover(function(){$(".img_slide", this).stop().animate({top:'-40px'},{queue:false,duration:160});},
    function() {$(".img_slide", this).stop().animate({top:'0px'},{queue:false,duration:160});
 });

$("#back-top").hide();

	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 800) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 1000);
			return false;
		});
	});

// ============================ FancyBox ==================================/
//Galeria

$("a[rel=lightbox]").fancybox({
    'overlayShow'	:true,
    'overlayOpacity'    :'0.6',
    'transitionIn'	:'elastic',
    'hideOnContentClick':'true',
    'transitionOut'	:'elastic',
    'titlePosition'     :'over',
    'centerOnScroll'    :'true'

});
//Pojedyńczy obrazek
$("a#big").fancybox({
    'overlayShow'	:true,
    'overlayOpacity'    :'0.6',
    'transitionIn'	:'elastic',
    'hideOnContentClick':'true',
    'transitionOut'	:'elastic',
    
    'centerOnScroll'    :'true'
});
//Film z YouTube
   $("#yt_link").click(function() {
	$.fancybox({
			'padding'		: 5,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

//====================== Zakładki w dziale download ============================== 
$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide('normal'); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).slideDown('normal'); //Fade in the active ID content
		return false;
	});



});

function changeSize(){
    var id= document.getElementById('sizes').selectedIndex;
    var szt=document.getElementById('szt').value.replace(",",".");
    var prise=productSizePrise[id];
    szt=parseFloat(szt);
    
    var final_prise=szt*prise;
    
    document.getElementById('prise').innerHTML=final_prise+" zł";
    document.getElementById('product_prise').value=prise;
}

function categoryName(category){
document.getElementById("category_id").value=$(category).children(':selected').text();

}
