/**
 * @license 
 * jQuery Tools 1.2.3 / Overlay Apple effect. 
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/overlay/apple.html
 *
 * Since: July 2009
 * Date:    Mon Jun 7 13:43:53 2010 +0000 
 */

/*
 
 jQuery Tools 1.2.3 / Overlay Apple effect. 

 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.

 http://flowplayer.org/tools/overlay/apple.html

 Since: July 2009
 Date:    Mon Jun 7 13:43:53 2010 +0000 
*/
(function(i){function k(b){var d=b.offset();return{top:d.top+b.height()/2,left:d.left+b.width()/2}}var j=i.tools.overlay,f=i(window);i.extend(j.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});j.addEffect("apple",function(b,d){var a=this.getOverlay(),c=this.getConf(),g=this.getTrigger(),j=this,l=a.outerWidth({margin:!0}),h=a.data("img");if(!h){var e=a.css("backgroundImage");if(!e)throw"background-image CSS property not set for overlay";e=e.slice(e.indexOf("(")+1,e.indexOf(")")).replace(/\"/g,
"");a.css("backgroundImage","none");h=i('<img src="'+e+'"/>');h.css({border:0,display:"none"}).width(l);i("body").append(h);a.data("img",h)}var e=c.start.top||Math.round(f.height()/2),m=c.start.left||Math.round(f.width()/2);if(g)g=k(g),e=g.top,m=g.left;h.css({position:"absolute",top:e,left:m,width:0,zIndex:c.zIndex}).show();b.top+=f.scrollTop();b.left+=f.scrollLeft();b.position="absolute";a.css(b);h.animate({top:a.css("top"),left:a.css("left"),width:l},c.speed,function(){if(c.fixed)b.top-=f.scrollTop(),
b.left-=f.scrollLeft(),b.position="fixed",h.add(a).css(b);a.css("zIndex",c.zIndex+1).fadeIn(c.fadeInSpeed,function(){j.isOpened()&&!i(this).index(a)?d.call():a.hide()})})},function(b){var d=this.getOverlay().hide(),a=this.getConf(),c=this.getTrigger(),d=d.data("img"),g={top:a.start.top,left:a.start.left,width:0};c&&i.extend(g,k(c));a.fixed&&d.css({position:"absolute"}).animate({top:"+="+f.scrollTop(),left:"+="+f.scrollLeft()},0);d.animate(g,a.closeSpeed,b)})})(jQuery);
