function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}		
$.preloadImages("/css/images/menu_o_mnie_over.jpg", "/css/images/menu_oferta_over.jpg","/css/images/menu_zdjecia_over.jpg",
  "/css/images/menu_kontakt_over.jpg");
$(
	function()
	{
	  	$("img#active").removeClass('rollover');
		// set up rollover
		$("img.rollover").hover(
			function()
			{
				this.src = this.src.replace(/\.jpg$/,"_over.jpg");
			},		
			function()
			{
				this.src = this.src.replace(/_over\.jpg$/,".jpg");
			}
		);
		if($("#active").attr("src")){
		  $("#active").attr("src", $("#active").attr("src").replace(/.jpg$/,"_active.jpg"));
		}

	}
)


