var loading = false;

$(document).ready(function() {
	$('table.tabela>tr,table.tabela>tbody>tr').not('.op').addClass('op').hover(
			function(){ 
				$(this).addClass('hov');
			},
			function(){
				$('*').removeClass('hov'); 
			}
		);
	
	
	$('a[rel=ajax]').click(function() {
		if (loading) return;
		
		// ładowane okno
		hr = $(this).attr('href');
		hr = hr.replace('http://efekt', '');
		hr = hr.replace('/', '/ajax_');
		
	
		// klasy
		$('#t_menu_top>a').removeClass('sel');
		$(this).addClass('sel');
		
		
		// id
		if (typ = $(this).attr('lang'))
		{
			if (typ != typ_a)
			{
				typ_a = typ;
				
				if (typ == 1)
				{
					$('#t_baner1').hide();
					$('#t_baner2').show();
					
					$('#t_baner').animate({
					    height: 300
					}, 100);
				}
				else
				{
					$('#t_baner1').show();
					$('#t_baner2').hide();
					
					$('#t_baner').animate({
					    height: 210
					}, 100);
				}
			}
		}
		
		
		// zamienia obrazki
		//if(id!='')
		//$('#t_img').css('backgroundImage', 'url(/img/img'+id+'.jpg)');
		
		
		loading = true;
		$('#t_cont').css('height', $('#t_okno').innerHeight())
		$('#t_okno').fadeOut(200, function() {
			$('#t_okno').load(hr, {}, function() {
				$('#t_cont').css('height', 0)
				$('#t_okno').fadeIn(200);
				loading = false;
			});
		});
		
		return false;
	});
	
});
