var Menu = Menu || {};


Menu.initialize = function(){
	
	// dla każdego obrazka, na mouseover przywracamy wszystkie obrazki
	// i dla tego jednek wlaczamy hover
	$('#topmenu .level-1 > img').hover( function() {
			Menu.clearHover();
		  $(this).attr("src", $(this).attr("src").split(".").join("-hover."));
	}, function(){
	});
	
	//na całe menu dajemy mouseout
	$('#topmenu').hover( function(){}, function(){
			Menu.clearHover();
		});
	
}//initialize


Menu.clearHover = function(){
	
	$('#topmenu .level-1 > img').each( function(){
			if( $(this).attr("src").match('hover') != null ){
				$(this).attr("src", $(this).attr("src").split("-hover.").join("."));
			}
	});
	
}


$(document).ready(Menu.initialize);
