
// slightly inspired by http://sundaymorning.jaysalvat.com/#
// Paja


		    $(function() {
		        tooltipize($(".tooltipize"));
		    });

var bubble = false;
var bubble_static = false;

function tooltipize($$){

	$$.click(function(evt) {
		bubble_static = !bubble_static;
	});
	
	
	$$.hover(function(evt) {
			if(getCookie("tt")=="no")//nezobrazime tooltipy
				return ;
			if(bubble)
				bubble.remove();
			bubble_static = false; //začneme se hýbat

			var id = parseInt( $(this).attr('id').substr(3) );
			
			bubble = $('<div id="mytooltip">'+ tooltips[id] +'</div>'); 
			bubble.css({ 
				position:'absolute',  
				left: evt.pageX+10,
				top:  evt.pageY+10 
			})
			.hide()
			.appendTo('body');
			
			bubble.show(); //($.browser.msie) ? bubble.show() : bubble.fadeIn('fast');
			evt.preventDefault();
			evt.stopPropagation();
		}, //:onmouseover <-> onmouseout:
		function (evt){
			if(!bubble_static){
				bubble.remove();
			}
	});
	
	$$.mousemove(function(e){
		if(!bubble_static){
			$("#mytooltip")
			.css("top",(e.pageY +10) + "px")
			.css("left",(e.pageX +10) + "px");
		}
	});			

}
