	var iCounter = 0;

function przelacz ( sId )
{
	var sDiv = 'div#'+ sId;
	jQuery( 'div#FinalContentTekst div' ).each(function()
	{
		jQuery( this ).hide();
	
	});
	
	if( opcja == 1 )
	{
		sId = sId + 'Title';
		jQuery( '#FinalContentSeparator h1' ).attr( 'id', sId );
	}
	jQuery( sDiv ).fadeIn( 'normal' );
	
	return false;
}

function przelaczP ( sId )
{
	

	var sDiv = 'div#'+ sId;
	jQuery( 'div#FinalContentTekst div.portfolioItem' ).each(function()
	{
		jQuery( this ).hide();
	
	});
	jQuery( sDiv ).fadeIn( 'normal' );
	slider( sDiv + ' div.blogSlider' );
	
	return false;
}


jQuery( document ).ready( function()
{

	var iLicznik = 0;

	
	jQuery( 'input#SearchInput' ).click( function()
	{
		if( iLicznik == 0 )
		{
			jQuery( this ).val('');
		}
	} );
	
	jQuery( 'li.SubSeparator div' ).click( function()
	{
		var tekst = jQuery( this ).children().children().text();
		jQuery( 'li.SubSeparator div' ).each( function() 
		{
			if( jQuery( 'li.SubSeparator div' ).hasClass( 'ActiveSub' ) )
			{
				jQuery( this ).removeClass( 'ActiveSub' );
			}			
		} );
		
		
		jQuery( this ).addClass('ActiveSub');
		
		//nawigator
		var jakGleboko = 0;
		
		jQuery( 'div#NavigationArea ul li.dane' ).each( function(i)
		{
			jakGleboko = i;		
		} );
		
		var nowy = jQuery( this ).children().children().attr( 'href' );
		var obecny = jQuery( 'div#NavigationArea ul li.dane a' ).eq( jakGleboko ).attr( 'href' );
		if( obecny != nowy )
		{
			
			if( nowy.indexOf( obecny ) >= 0 || iCounter == 0 )
			{
				jQuery( 'div#NavigationArea ul' ).append( '<li>&raquo;</li><li class="dane"><a href="' + nowy + '">' + tekst.toLowerCase() +  '</a></li>' );
				iCounter++;
			}
			else
			{	
				jQuery( 'div#NavigationArea ul li.dane' ).eq( jakGleboko ).html( '<a href="' + nowy + '">' + tekst.toLowerCase() +  '</a>' );	
			}
		}
		
	
	} );


} );