
/* - ++resource++collective.imagetags/view-tags.js - */
// http://www.bafoeg.de/portal_javascripts/++resource++collective.imagetags/view-tags.js?original=1
ImageTags=window['ImageTags']||{};ImageTags['linksOverOut']=function(){jQuery('.tag-link-plain').mouseout(function(){var other_id=this.id.replace('tag-link-plain','tag');jQuery('#'+other_id).removeClass('tag-show')}).mouseover(function(){var other_id=this.id.replace('tag-link-plain','tag');jQuery('#'+other_id).addClass('tag-show')})};ImageTags['replaceImageWithTags']=function(rule){var imgs=jQuery(rule);imgs.each(function(idx,img){img=jQuery(img);var classes=img.attr('class');var title=img.attr('title');var src=img.attr('src');var parts=src.split('/')
var scale_name=parts.pop();var url=parts.join('/')+'/@@imagetags-img?name='+scale_name;var loader=jQuery('<div></div>').load(url, function(){ImageTags.showHideHints(loader);img.parent().replaceWith(loader.children());ImageTags.linksOverOut();var new_img=jQuery('img[src='+src+']');if(new_img){new_img.attr('class',classes);new_img.attr('title',title)}})})};ImageTags['showHideHints']=function(el){var selector='.tag-image-wrapper'
var wrapper=el?jQuery(el).find(selector):jQuery(selector);wrapper.hover(function(){$this=jQuery(this);if($this.hasClass('tag-tagging')){return}
$this.find('a.tag-link').hide().addClass('tag-hint').fadeIn(500)}, function(){$this=jQuery(this);if($this.hasClass('tag-tagging')){return}
$this.find('a.tag-link').fadeOut(500, function(){jQuery(this).removeClass('tag-hint').show()})})};jQuery(document).ready(function(){ImageTags.linksOverOut();ImageTags.showHideHints();jQuery('a.tag-no-link').live('click', function(){return false})});

