$(document).ready(function()
{
	
	/*
	*  Galeria w newsach
	*/

	$('.imgGallery').wrapInner('<div class="allImg" />');
	$('.imgGallery .allImg').hide();
	
		$('.imgGallery').prepend('<p class="imgGalleryHead"><a href=""><img src="_gfx/plus.png" />Pokaż / Ukryj zdjęcia <strong>&raquo;</strong></a></p>');
		
		$('.allImg a').attr({'rel' : 'shadowbox[mini]', 'target' : ''});
		
		$('.imgGalleryHead a').toggle(function(){
			$(this).parent().next().slideDown('slow');
			return false;	
		},function(){
			$(this).parent().next().slideDown('slow');
			$('.allImg').slideUp('slow');
			return false;
		});



	/*
	*  Zmienianie wielkości czcionki 
	*/

	  $("#SmallText").click(function(){
		    $(".txtContent").find("li, p").css('font-size','9px');
		  }
		);
		$("#MediumText").click(function(){
			$(".txtContent").find("li, p").css('font-size','11px');
		  }
		);
		$("#LargeText").click(function(){
			$(".txtContent").find("li, p").css('font-size','13px');
		  }
		);


	/*
	*  Dialog dla IE6
	*/


	 var ostrzezenieTxt = "<span>Uwaga!!!</span><br />Używasz starej, niewspieranej i niebezpiecznej przeglądarki. Zaktualizuj swoją przeglądarke do nowszej wersji klikając tu: <a href=\"http://www.browserchoice.eu\" target=\"_blank\"><strong>KLIKNIJ</strong></a>";
	 var ostrzezenie = "<div class=\"ost\"><p>"+ostrzezenieTxt+"</p></div>";
	 var przegladarka = navigator.userAgent;
		 if(przegladarka.indexOf("MSIE 6.0") != -1){ 
			 $('body').prepend(ostrzezenie);
			 $('.ost').fadeIn('slow');
			  
			 $('.ost').hover(		 
				 function(){
				  $(this).css('background', 'white');
				 },
				 function(){	 
				  $(this).css('background', '#f0ff00');	 
				}
			 );
		 
		 }



	/*
	*  Filtr even w tabeli
	*/

	$("#manageTable tr:even").css("background-color", "#383838");
	$("#manageTable tr:first-child").css("background-color", "#1e1e1e");


	/*
	*  box slider
	*/

	$("#buyBox .mb:eq(1)").hide();

	$("#next").click(function(){
		
	  if($("#buyBox .mb:first").is(':visible')){	
		$("#buyBox .mb:eq(0)").slideUp('slow');	
		$(this).parents().eq(1).children().eq(1).slideDown('slow');
		$(this).html('&laquo; Kup Mount & Blade');
	  }
	  else{
		$("#buyBox .mb:eq(0)").slideDown('slow');	
		$(this).parents().eq(1).children().eq(1).slideUp('slow');
		$(this).html('Kup Warband &raquo;');
	  }
		return false;
	});
		

	/*
	*  confirm usun
	*/

	$(".usun").click(function(){
	
		if(confirm("Czy na pewno chcesz usunąć  te wiadomość ?")){
			window.location = $(this).attr('href');
		}
		else{
			return false;
		}
		
	  return false;
	});
	
	
});
