$(document).ready(function(){
	$('#zalogowany li:last').addClass('last');
	$('td:eq(1)', '.tabela tr').addClass('red');
	$('td:eq(4)', '.tabela2 tr').addClass('str');
	$('li', '#menu').hover(function(){
		$(this).addClass('menuHover');
		$('ul', this).slideDown('slow');
	});
	$('li', '#menu').mouseleave(function(){		
		$(this).removeClass('menuHover');
		$('ul', this).slideUp('slow');
	});
	$('#login, #haslo').click(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == 'login') $(this).attr('value', '');
	});
	$('#login, #haslo').blur(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == '') $(this).attr('value', 'login');
	});
	$('li', '#jezyki').hover(function(){
		$(this).addClass('jezHover');
	});
	$('li', '#jezyki').mouseleave(function(){		
		$(this).removeClass('jezHover');
	});
	$('.news p').hover(function(){
		$(this).addClass('red');
	});
	$('.news p').mouseleave(function(){		
		$(this).removeClass('red');
	});
	
	$('span', '.header-scroll').click(function(){
		var title = $(this).attr('title');
		var rodzic = $(this).parents('.box');
		var zwin = $('#pa').text();
		var rozwin = $('#pb').text();
		if(title == 0){
			$('.tresc', rodzic).slideUp();
			$(this).attr('title', 1);
			$(this).addClass('roz');
			$(this).text(rozwin);
			
		}
		if(title == 1){
			$('.tresc', rodzic).slideDown();
			$(this).attr('title', 0);
			$(this).removeClass('roz');
			$(this).text(zwin);
		}
	});
	$('tr', '.tabela').hover(function(){
		$(this).addClass('ontr');					   
	});		
	$('tr', '.tabela').mouseleave(function(){
		$(this).removeClass('ontr');					   
	});
	
	$('tr', '.oop').hover(function(){
		$(this).addClass('otr');					   
	});		
	$('tr', '.oop').mouseleave(function(){
		$(this).removeClass('otr');					   
	});
	
	$('#reklamy img').hover(function(){
		var img = $(this);
		var newimg = img.attr('title');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('title', oldimg);
		img.attr('src', newimg);
		}
	});
	$('#reklamy img').mouseout(function(){							  
		var img = $(this);
		var newimg = img.attr('title');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('title', oldimg);
		img.attr('src', newimg);
		}
	});

	$("#leftbox").sortable();
	$("#leftbox").disableSelection();
	$("#rightbox").sortable();
	$("#rightbox").disableSelection();
	
});
			   
