function simple_tooltip(target_items, name){
 $(target_items).each(function(i){
	if($(this).find('span') != undefined ){
		//alert($(this).find('span').html())
		$("body").append("<div class='"+name+"' id='"+name+"_"+i+"'><p>"+$(this).find('span').html()+"</p></div>");
		var my_tooltip = $("#"+name+"_"+i);

		//if($(this).attr("title") != ""){ // checks if there is a title

		$(this).removeAttr("title").mouseover(function(){
			//alert(my_tooltip.innerWidth()/2));
				my_tooltip.css({opacity:1, display:"none"}).fadeIn(50);
		}).mousemove(function(kmouse){
				my_tooltip.css({left:kmouse.pageX-(Math.round(my_tooltip.width()/2)), top:kmouse.pageY+25});
		}).mouseout(function(){
				my_tooltip.fadeOut(50);
		});

		//}
	}});
}
function loadBokVystavy(){
	$.get('/cache/vystavy-seznam.html', function(data) {
	  $('#loadedDataVystavy').html(data);
	  try {
		$("a[rel='letak1']").colorbox({current:"{current} / {total}",maxHeight:'90%',maxWidth:'90%'});
	  } catch(err) {alert(err)};
	});
}
function loadBokAkce(){
	$.get('/cache/akce-seznam.html', function(data) {
	  $('#loadedData').html(data);
	  try {
		$("a[rel='letak1']").colorbox({current:"{current} / {total}",maxHeight:'90%',maxWidth:'90%'});
	  } catch(err) {};
	});
}
$(document).ready(function(){
	 simple_tooltip("a.fotky","tooltip2");
	 simple_tooltip("a.letak","tooltip");
	 try {
		$("a[rel='letak2']").colorbox({current:"{current} / {total}",maxHeight:'90%',maxWidth:'90%'});
	  } catch(err) {};

});


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4269021-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


