$(document).ready(function(){

	
	var biezaceNajczesciej = $("#beizace_najczesciej > div");
	biezaceNajczesciej.hide().filter(":first").show();
			
	$("#beizace_najczesciej ul a").click(function () {
		biezaceNajczesciej.hide();
		biezaceNajczesciej.filter(this.hash).show();
		$("#beizace_najczesciej ul a").removeClass("selected");
		$(this).addClass("selected");
		return false;
	}).filter(":first").click();
	
	
//addClass na ostatni elemnt
	$(".ramka > :last, #wiadomosci > :last, #opinie > :last").addClass("last");
	
// Font size
	$(".menu_naglowek li.first a").click(function() {
		switch ($(this).attr("class")) {
			case 'ar1' : setFontSize(12); break;
			case 'ar2' : setFontSize(14); break;
			case 'ar3' : setFontSize(16); break;
		}
		return false;
	});
	 
	function setFontSize(size) {
		$("#tresc").animate({fontSize: size+"px"}, 500).fadeIn("slow");
	}
	
	$('a.colorbox').colorbox({width:"85%", height:"85%"});

	$('.link_seo_js').each(function(){
			var anchor = $(this).html();
			var href = $(this).attr('rel');
			var sTitle = $(this).attr('title');
			$(this).removeClass('link_seo_js');
			var classes = $(this).attr('class');

			var sNewLink = '<a href="'+href+'"';
			if (classes) sNewLink += ' class="'+classes+'"';
			if (sTitle) sNewLink += ' title="'+sTitle+'"';
			sNewLink += '>'+anchor+'</a>'

			$(this).replaceWith(sNewLink);
	});
	
	$(".js_register_form").click(function() {
		$(".js_register_form").css('background', 'url("/html/images/br/reg/button.png") no-repeat');
		$(this).css('background', 'url("/html/images/br/reg/button2.png") no-repeat');
	});
});




