<!--
$(document).ready(function(){
	$('#tekst').hide();
	$('#tekst').css('overflow', 'hidden');
	$('#tekst').css('overflow-x', 'hidden');
	$('#tekst').slideDown(500);
	$('#tekst2').hide();
	
	//ladowanie tresci, co - nazwa podstrony, gdzie - element docelowy, w ktorym pojawi sie tresc, prawa: wartosc 1, jezeli z prawej strony ma pojawic sie boks z dalsza czescia
	function wczytaj_tresc(co, gdzie, prawa) {
		$.ajax({
			url: 'tresc/'+co+'.txt',
			success: function(data){
				$('#tekst').fadeOut(600);	
				//$('#tekst2').fadeOut(1500);	
				$(gdzie).delay(500, function(){
						$(gdzie).html('');
						$(gdzie).html(data);
						$('#tekst').fadeIn(500).fadeTo(500, 1); 
						if(prawa == '1') {$('#tekst2').fadeIn(600);  }						
					}	
				);			
			},
			error: function(){
				$(gdzie).html('');
			}
		});
	}
	
	 $('a').click( function() {
		 $('#tekst2').fadeOut(500);
		 $('#tekst').css('overflow', 'hidden');
		 $('#tekst').css('overflow-x', 'hidden');
		if( 
			($(this).attr('id') == 'jakpowstalswiat') || 
			($(this).attr('id') == 'bogowie') || 
			($(this).attr('id') == 'drzewo') || 
			($(this).attr('id') == 'duchy') || 
			($(this).attr('id') == 'demony') || 
			($(this).attr('id') == 'zespol') || 
			($(this).attr('id') == 'ryskulturowy') || 
			($(this).attr('id') == 'stworzenieczlowieka') || 
			($(this).attr('id') == 'dotrzecdonawii') || 
			($(this).attr('id') == 'przeznaczenie') || 
			($(this).attr('id') == 'obchody') )  {
				
		    if( ($(this).attr('id') == 'obchody') || ($(this).attr('id') == 'jakpowstalswiat')  )  { 
				$('#tekst2').css('overflow', 'hidden');
			} else { 
				$('#tekst2').css('overflow', 'scroll');
				$('#tekst2').css('overflow-x', 'hidden');
			}
			
			 if( $(this).attr('id') == 'zespol')  {
				$('#tekst').css('overflow', 'hidden');
				$('#tekst2').css('overflow', 'hidden');
			}
			
			wczytaj_tresc($(this).attr('id'), ".tresc");
			wczytaj_tresc($(this).attr('id')+2, ".tresc2",1);
 
		} else {
			$('#tekst2').fadeOut(1500);
		}
		
		 //wczytaj_tresc($(this).attr('id'), ".tresc");
	 });
});
-->
