function makeDictDescription(cls, data) {
if ($$(cls + ' .h_word').length > 0) {
var actual = $('article').down('h2').innerHTML.stripTags().toLowerCase();
$$(cls + ' .h_word').each(function(el, i){
el = $(el);
var dataKey = el.innerHTML.stripTags().toLowerCase().replace(/[\r\n]/g, ' ').replace(/[\n|\r]/g, ' ').unescapeHTML();
if (dataKey == actual || el.up('a') != null) {
el.removeClassName('h_word');
} else {
var info = data[dataKey];
el.update(el.innerHTML+ '<span class="dict_description" id="dict_description'+ i +'" style="display: none;"><strong>'+ el.innerHTML +'</strong><br />'+ info[0] +'<span class="cleaner"></span><a href="' +info[1] +'">více</a></span>');
var title = info[0].unescapeHTML().replace('&nbsp;', ' ');
el.title = title;
el.observe('click', function(){
el.title = '';
$('dict_description'+i).show();
if (typeof _gaq != 'undefined') {
_gaq.push(['_trackEvent', 'glossary', dataKey, window.location.href]);
}
el.up('div#all').observe('mouseover', function(ev) {
if ($(Event.element(ev)).descendantOf && !$(Event.element(ev)).descendantOf('dict_description'+i) && Event.element(ev).id !== 'dict_description'+i) {
$('dict_description'+i).hide();
el.title = title;
}
});
});
}
});
}
}
