/*
* @file
* @brief    sigplus Image Gallery Plus image captions overlay engine with MooTools
* @author   Levente Hunyadi
* @version  1.1
* @remarks  Copyright (C) 2009-2010 Levente Hunyadi
* @remarks  Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
* @see      http://hunyadi.info.hu/projects/sigplus
*/
Elements.prototype.getMaxItemSize=function(){var a=0;var b=0;this.each(function(d){var c=d.getSize().size;a=Math.max(a,c.x-d.getStyle("padding-left").toInt()-d.getStyle("padding-right").toInt()-d.getStyle("border-left-width").toInt()-d.getStyle("border-right-width").toInt());b=Math.max(b,c.y-d.getStyle("padding-top").toInt()-d.getStyle("padding-bottom").toInt()-d.getStyle("border-top-width").toInt()-d.getStyle("border-bottom-width").toInt())});return{width:a,height:b}};function imageCaptions(b){var c=b.getElement("ul");var a=c.getElements("li img");a.each(function(j){var g=j.getProperty("alt");if(!g){return}var f=j.getSize().size;var i=$$(j).getMaxItemSize();var d=new Element("div",{styles:{display:"none",position:"absolute",width:i.width,height:i.height,marginLeft:j.getStyle("margin-left").toInt()+j.getStyle("border-left-width").toInt(),marginRight:j.getStyle("margin-right").toInt()+j.getStyle("border-right-width").toInt(),marginTop:j.getStyle("margin-top").toInt()+j.getStyle("border-top-width").toInt(),marginBottom:j.getStyle("margin-bottom").toInt()+j.getStyle("border-bottom-width").toInt(),padding:0}});d.addClass("imageSliderCaptionContainer");var e=new Element("div",{styles:{position:"relative",margin:j.getStyle("padding")}});e.addClass("imageSliderCaption");e.setText(g);e.injectInside(d);d.injectBefore(j);var h=j.getParent();h.addEvent("mouseenter",function(m){var l=m.target;while(l.getTag()=="img"||l.hasClass("imageSliderCaption")||l.hasClass("imageSliderCaptionContainer")){l=l.getParent()}var k=l.getElement("div.imageSliderCaptionContainer");k.setStyle("display","block")});h.addEvent("mouseleave",function(m){var l=m.target;while(l.getTag()=="img"||l.hasClass("imageSliderCaption")||l.hasClass("imageSliderCaptionContainer")){l=l.getParent()}var k=l.getElement("div.imageSliderCaptionContainer");k.setStyle("display","none")})})};
