window.onload = function(){
	/*var so = new SWFObject("site/graphics/baner.swf", "baner", "710px", "440px", "8", "#fff", "transparent");
	so.write("baner");
	document.getElementById('left').style.height = document.getElementById('a1').offsetHeight+'px';
	document.getElementById('right').style.height = document.getElementById('a1').offsetHeight+'px';*/
}

function ajax( url, content, form ){
	if ( $('#'+form) ){
		var jsonForm = $('#'+form).serializeArray();
	}
	$.ajax({
		url: url,
		type: 'POST',
		data: jsonForm,
		cache: false,
		success: function(html){
			$('#'+content).html(html);
		}
	});
}

function przelicz(){
	var arr = new Array() 
	$('input.intQuantity').each(function(i){
		arr.push($(this).val()); 
	});
	$('#values').attr( 'value',arr );
}



var a = 1;
var id = 1;

$(document).ready(function() {
	
			$(function(){
                $('#facebook').hover(function(){
                    if ($('#facebook').css('right') == '-292px') {
                        $('#facebook').animate({
                            right: '+=292'
                        }, 500, function(){
                        });
                    }
                }, function(){
                    if ($('#facebook').css('right') == '0px') {
                        $('#facebook').animate({
                            right: '-=292'
                        }, 500, function(){
                        });
                    }
                });
                if (parseInt(jQuery.browser.version) == 6 && jQuery.browser.msie) {
                    $('#facebook').css('display', 'none');
                }
                else {
                    $('#facebook').css('visibility', 'visible');
                }
            });

	//event-content tab
	window.n = $('#news-intro .setNews').length;
	$('#news-intro .setNews').each(function(e){
		$(this).click(function() {
			var a = $(this).html();
			$('.news-intro').hide();
			$('#news-intro .setNews').removeClass('active');
			$(this).addClass('active');
			//$('#news-intro'+a).show();
			$('#news-intro'+a).fadeIn();
			clearInterval(window.id);
		});
	});
	$('#news-intro .setNewsNext').each(function(e){
		$(this).click(function() {
			if(window.a<window.n){
				window.a++;
			}else{
				window.a=1;
			}
			$('.news-intro').hide();
			$('#news-intro .setNews').removeClass('active');
			$('#set-news'+window.a).addClass('active');
			//$('#news-intro'+window.a).show();
			$('#news-intro'+window.a).fadeIn();
			clearInterval(window.id);
		});
	});
	$('#news-intro .setNewsPrev').each(function(e){
		$(this).click(function() {
			if(window.a==1){
				window.a=window.n;
			}else{
				window.a--;
			}
			$('.news-intro').hide();
			$('#news-intro .setNews').removeClass('active');
			$('#set-news'+window.a).addClass('active');
			//$('#news-intro'+window.a).show();
			$('#news-intro'+window.a).fadeIn();
			clearInterval(window.id);
		});
	});
	if($('#news-intro').html()) {
		window.id = setInterval("nextNews();", 3000);
	}
});

function nextNews(){
	if(window.a<window.n){
		window.a++;
	}else{
		window.a=1;
	}
	$('.news-intro').hide();
	$('#news-intro .setNews').removeClass('active');
	$('#set-news'+window.a).addClass('active');
	//$('#news-intro'+window.a).show();
	$('#news-intro'+window.a).fadeIn();
}
