$(document).ready(function(){

	$('a[rel=external]').click(function(){
		window.open(this.href);
		
		return false;
	});
	
	Cufon.replace('.cw1 h2, .cw1 h3, .cw1 h4, .cw1 h5, .cw1 h6, .cw2 h2, .cw1 .alphabet a, #footer .c3 a span', {hover: true});
	
	$('.cw1 hr').wrap('<div class="hr"></div>');
	
	$('.cw1 .imgmask').append('<span class="over"></span>');
	
	
	$('.ch1 .t').hide();
	$('.ch1 .t:first').show();
	
	$('.ch1 .lang a').click(function(){
	
		$('.ch1 .lang a').parent().removeClass('selected');
		$(this).parent().addClass('selected');
	
		var url = $(this).attr('href');
		
		$('.ch1 .t:visible').hide();
		$('.ch1 .t' + url).show();
		
		return false;
		
	});

	
	$('.cw1 *:first').css('margin-top','10px');
	$('.cw1 .cols:first-child').css('margin-top', '-30px');
	$('.cw1 .rs').css('margin-top', '-20px');
	
	
	
	
	$('.cw1 .a').hide();
	
	$('.cw1 .q').toggle(function(){
		$(this).next('.a').slideDown('slow');
	}, function(){
		$(this).next('.a').slideUp('slow');
	});
	
	
	
	
	
	$('.cw1 .p').each(function(){
		var letter1 = $('h3', this).text();
	
		$('h3', this).addClass(letter1);
	});	
	
	
	$('.cw1 .alphabet a').click(function(){
		var letter2 = $(this).text();
		
		$('.cw1 .p').hide();
		
		
		$('.cw1 h3.' + letter2).parents('.p').show();
		
		return false;
	});
	
	$('.cw1 .alphabet a.all').click(function(){
		$('.cw1 .p').show();
	});
	

	var suma = 0;

	$('.menu1 li').each(function(){
		var szer = $(this).width();
		
		suma = suma+szer;	

	});

	
	$('.menu1 ul').css({'width':suma, 'float':'none'});
	
	
	Shadowbox.init({
		language: 'pl'
	});
	
});	







