jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
$.preloadImages("load/images/firma1.jpg", "load/images/firma2.jpg",
			"load/images/salon1.jpg", "load/images/salon2.jpg",
			"load/images/motocykle1.jpg", "load/images/motocykle2.jpg",
			"load/images/serwis1.jpg", "load/images/serwis2.jpg",
			"load/images/wypozyczalnia1.jpg", "load/images/wypozyczalnia2.jpg");
$(document).ready(
function()
{
	var config = {    
		over: addOpacity,
		timeout: 200,   
		out: removeOpacity 
	};
	$("ul#menu li img.menu-button").hoverIntent(config);
	function addOpacity()
	{
		if($(this).parent().next(".menu-bottom").css("opacity")=="1")
			return;

		
		$("img.menu-bottom").css("opacity", "0.4");
		$(this).parent().next(".menu-bottom").animate({opacity: '1'}, "fast");
		var toLoad = "load/" + $(this).parent().parent().attr("id") + "-load.html";
		$("#content").load(toLoad);
	}
	function removeOpacity()
	{
		//$(this).parent().next(".menu-bottom").animate({opacity: '0.4'}, "fast");
	}

});


