function preloadImage(obrazki)
{
	var tabelaObrazki=obrazki.split(",");
	
	for (i=0; i<tabelaObrazki.length; i++){
		picture= new Image;
		picture.src = "/files/framework/"+tabelaObrazki[i];
	}
}

function addMenuJadlospis() {
		var S=jQuery("div.scrollable");
		
		S.scrollable({size:1, speed: 800, loop:true, navi: ".contentJadlospisNavLeft",activeClass: "activNav"});
		var imgwl=S.find(".itemmm");
		var ilosc=imgwl.size();
		imgwl.each(function(i){ jQuery(".itemmm"+i).click(function(){ S.scrollable().next(); }); });
		
		var last=0;
		jQuery("#prev").click(function(){
			if(S.scrollable().getIndex()==0 && last==0) S.scrollable().end();
			else S.scrollable().prev();
			last=S.scrollable().getIndex();
			
			jQuery("#currentPage").html(S.scrollable().getIndex()+1);
		});
		
		jQuery("#next").click(function(){
			S.scrollable().next();
			last=S.scrollable().getIndex();
			jQuery("#currentPage").html(S.scrollable().getIndex()+1);
		});
		
		jQuery(".contentJadlospisNavLeft a, .contentJadlospisNavLeft a, .scrollable .items .itemmm").click(function(){
			jQuery("#currentPage").html(S.scrollable().getIndex()+1);
		});
}
