// JavaScript Document
$(document).ready(function(){
$('#logotypy-klienci').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

$('div.rmenu> span.off').hide(); 
  $('div.rmenu> div.acco').click(function() {
	$(this).next('span').slideToggle('fast')
    .siblings('span:visible').slideUp('fast');
	$('div.rmenu div.active').removeClass('active');
	if ($(this).children('span:visible')) $(this).addClass('active');
	clearInterval(play);
	ustawReset();
  });

ustawReset = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			//$active = $('#CLP').val();
			//if ( $active.length === 0) { //If paging reaches the end...
				$('div.rmenu> span.off').hide();
				$('div.rmenu> span.on').show();
				$('div.rmenu> div.active').removeClass('active');
				clearInterval(play);
			//}
			//rotate(); //Trigger the paging and slider function
		}, 7000); //Timer speed in milliseconds (3 seconds)
	};
	
	ustawReset();
$('div#realizacje> div.off').hide(); 
$('div#realizacje> div.tytulR').click(function() {
	$('div#realizacje a.on').removeClass('on');
	$(this).next('div.copis').slideToggle('fast')
    .siblings('div.copis:visible').slideUp('fast');

	if ($(this).next('div.copis:visible')) $(this).children('a').addClass('on');
	
	});	
$('div#news> div.off').hide(); 
$('div#news> div.tytulR').click(function() {
	$('div#news a.on').removeClass('on');
	$(this).next('div.copis').slideToggle('fast')
    .siblings('div.copis:visible').slideUp('fast');

	if ($(this).next('div.copis:visible')) $(this).children('a').addClass('on');
	
	});										

$('a.info-baner').toggle(function(){
			$(this).next('div').show();
			
			},
			function() {
			$(this).next('div').hide();
				}
				);
$('.galeria img').mouseover(function() {
			var bobr = $(this).attr('src');
			$(this).attr('src',$(this).attr('title'));
			$(this).attr('title',bobr);
			
									 });
$('.galeria img').mouseout(function() {
			var bobr = $(this).attr('src');
			$(this).attr('src',$(this).attr('title'));
			$(this).attr('title',bobr);
									 });

});

$(function() {
        $('.galeria a').lightBox();
    });

$(function() {
     $('#mala_galeria a').lightBox();
});

