$(document).ready(function(){

	
	$("#sponsor_icons ul li a img").mouseover(function() { 
            var src = $(this).attr("src").match(/[^\.]+/) + "over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("over", "");
            $(this).attr("src", src);
        });

	$("div.menu ul li").hover(function() { 
			var klasa=$(this).attr("class");
			/*$("div#"+klasa).slideDown('fast').show(); //On hover over, add class "subhover"*/
			$("div#"+klasa).show(); //On hover over, add class "subhover"
			$("div.menu ul li."+klasa+" a").css('background', '#c11509 url(\'../img/menu-hover-background.jpg\') repeat-x top center');
		}, function(){	//On Hover Out
			var klasa=$(this).attr("class");
			$("div#"+klasa).hover(function() { 
				$("div#"+klasa).css('display', 'block'); //On hover over, add class "subhover"
				$("div.menu ul li."+klasa+" a").css('background', '#c11509 url(\'../img/menu-hover-background.jpg\') repeat-x top center');
			}, function(){	//On Hover Out
				$("div#"+klasa).css('display', 'none'); //On hover out, remove class "subhover"
				$("div.menu ul li."+klasa+" a").css('background', 'none');
		});
		$("div#"+klasa).css('display', 'none'); //slideup('slow') //On hover out, remove class "subhover"
		$("div.menu ul li."+klasa+" a").css('background', 'none');
	});
	
	
	$("img.wislawsieci").hover(function() { 
			var src = $(this).attr("src").match(/[^\.]+/) + "-on.png";
			$(this).attr("src", src);
			$("div.rozwinwsieci").show(); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$("div.rozwinwsieci").hover(function() { 
				$("img.wislawsieci").attr("src", "img/head_bar_wislawsieci-on.png");
				$("div.rozwinwsieci").css('display', 'block'); //On hover over, add class "subhover"
			}, function(){	//On Hover Out
				$("div.rozwinwsieci").css('display', 'none'); //On hover out, remove class "subhover"
				$("img.wislawsieci").attr("src", "img/head_bar_wislawsieci.png");
		});
		$("div.rozwinwsieci").css('display', 'none'); //slideup('slow') //On hover out, remove class "subhover"
		$("img.wislawsieci").attr("src", "img/head_bar_wislawsieci.png");
	});
	
	
	
});



