function nactiGraf(ad, obj) {
		//var url = pageUrl()+'ajax/pridat_jazyk.php';
		//url += 'ajax/anketa.php';
		var url = './ajax/graf.php?url='+escape(ad);
		$.ajax({
			url: url,
			cache: false,
			success: function(html){
				if (html) {
					$(obj).parent().children('.IndexIn').children('.GrafContent').attr('id', html);
					var so = new SWFObject("http://grafy.creos.cz/amline.swf", "amline1", "185", "185", "8", "#FFFFFF");
					so.addVariable("path", "http://grafy.creos.cz/");
					so.addParam("wmode", "transparent"); 
					so.addVariable("settings_file", encodeURIComponent('http://grafy.creos.cz/data/'+html+'.xml'));
					so.addVariable("data_file", encodeURIComponent('http://grafy.creos.cz/data/'+html+'.txt'));
					so.write(html);  // this id must match the div id above
				}
			}
		});	
}

$(document).ready(function() {

	$(".Indexes strong").hover(function () {
		var odkaz = $(this).attr('title');
		$(this).attr('title', '');
		$(this).attr('alt', odkaz);
		odkaz.replace('&amp;', '&');
		$(this).parent().children('strong').removeClass('Active');
		$(this).addClass('Active');
		nactiGraf(odkaz, this);
		}, function() {
		var odkaz = $(this).attr('alt');
		$(this).attr('alt', '');
		$(this).attr('title', odkaz);
	});

	$(".Indexes").each(function () {
		$(this).children("strong:first").each(function () {
			var odkaz = $(this).attr('title');
			$(this).parent().children('strong').removeClass('Active');
			$(this).addClass('Active');
			nactiGraf(odkaz, this);
		});
	});

});

