$().ready(function(){

	// BEGIN obsluga menu jezykow	
	$("#lang_menu a").fadeTo(0, 0.5).hover(
		function(){
			$(this).fadeTo(0, 1).parent().css("background-image", "url(templates/hotel_antonio/images/active_flag.gif)");
		},
		function(){
			$(this).fadeTo(0, 0.5).parent().css("background-image", "none");
		}
	);
	// END obsluga menu jezykow
			
	
	// BEGIN zautomatyzowana obsluga glownego menu		
	$("#menu a").each(
		function(){
			// preload obrazkow hoverowanych :)
			var menu_image = new Image();
			menu_image.src = "templates/hotel_antonio/images/menu/"+lang+"/h"+$(this).attr('id')+".gif";
			
			if ($(this).hasClass('active')){
				$(this).replaceWith('<img src="templates/hotel_antonio/images/menu/'+lang+'/h'+$(this).attr('id')+'.gif" id="'+$(this).attr('id')+'" />');
			} else {
				$(this).replaceWith('<a href="'+$(this).attr('href')+'" accesskey="'+$(this).attr('accesskey')+'" title="'+$(this).text()+' ['+$(this).attr('accesskey')+']"><img src="templates/hotel_antonio/images/menu/'+lang+'/'+$(this).attr('id')+'.gif" id="'+$(this).attr('id')+'" /></a>');
			}	
		}
	);
			

	$("#menu a img").hover(
		function(){
			$(this).attr('src', 'templates/hotel_antonio/images/menu/'+lang+'/h'+$(this).attr('id')+'.gif');			
		},
		function(){
			$(this).attr('src', 'templates/hotel_antonio/images/menu/'+lang+'/'+$(this).attr('id')+'.gif');
		}
	);
	// END zautomatyzowana obsluga glownego menu
	
	// BEGIN menu w stopce
	$("#footer_menu a:not(:last)").after("|");
	// END menu w stopce
	
	// BEGIN clearfix w newsach
	$("#contents .news p").append('<div style="clear: both;"></div>');
	// END clearfix w newsach

	// BEGIN ozodbna ramka
	$(".nice_frame").each(function(){
		// alert($(this).text());
		
		$(this).removeClass('.nice_frame');
		$(this).before('<div class="frame_shadow"><div class="frame_top"><div class="frame_bottom"><div class="frame_border">').after('</div></div></div>');

	});
	// END ozdobna ramka
	
	$("#contents .left_column h4:not(:first)").css('margin-top', '50px');
	
}); 
