$(function(){
	$(".confirm").click(function(){
		return confirm("Proszę potwierdzić operację");
	});
	
	var nav = $("#nav");
	if (nav.length) {
		var x_ = nav.offset().top;
		$("body,html").animate({scrollTop: x_},'slow');	
	}
	
	$("div.tooltip").css({"position":"absolute", "padding": "10px", "width": "500px", "background": "#eee", "z-index": 1000,"border":"1px solid #000"}).fadeTo("fast",0,function(){$(this).hide()});
	$("span.hint").hover(
	    function(){
	    var rel = $(this).attr("rel");
	    var div = "";
	    $("div.tooltip").each(function(index) {
            if($(this).attr("rel") == rel){
                div = $(this);
            }
          });
		var left = $(this).position().left + 20;
		div.css("left",left+"px");
		var top = $(this).position().top;
		div.css("top",top+"px");
		div.fadeTo("slow",1,function(){$(this).show()});
	}, function(){
		$("div.tooltip").fadeTo("fast",0,function(){$(this).hide()});
	});
});

