/*!
 * jQuery Tools v1.2.5 - The missing UI library for the Web
 * 
 * toolbox/toolbox.expose.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(r){r.tools=r.tools||{version:"v1.2.5"};var q;q=r.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};function p(){if(r.browser.msie){var a=r(document).height(),d=r(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-d<20?d:a]}return[r(document).width(),r(document).height()]}function o(a){if(a){return a.call(r.mask)}}var n,m,l,k,j;r.mask={load:function(c,b){if(l){return this}typeof c=="string"&&(c={color:c}),c=c||k,k=c=r.extend(r.extend({},q.conf),c),n=r("#"+c.maskId),n.length||(n=r("<div/>").attr("id",c.maskId),r("body").append(n));var a=p();n.css({position:"absolute",top:0,left:0,width:a[0],height:a[1],display:"none",opacity:c.startOpacity,zIndex:c.zIndex}),c.color&&n.css("backgroundColor",c.color);if(o(c.onBeforeLoad)===!1){return this}c.closeOnEsc&&r(document).bind("keydown.mask",function(d){d.keyCode==27&&r.mask.close(d)}),c.closeOnClick&&n.bind("click.mask",function(d){r.mask.close(d)}),r(window).bind("resize.mask",function(){r.mask.fit()}),b&&b.length&&(j=b.eq(0).css("zIndex"),r.each(b,function(){var d=r(this);/relative|absolute|fixed/i.test(d.css("position"))||d.css("position","relative")}),m=b.css({zIndex:Math.max(c.zIndex+1,j=="auto"?0:j)})),n.css({display:"block"}).fadeTo(c.loadSpeed,c.opacity,function(){r.mask.fit(),o(c.onLoad),l="full"}),l=!0;return this},close:function(){if(l){if(o(k.onBeforeClose)===!1){return this}n.fadeOut(k.closeSpeed,function(){o(k.onClose),m&&m.css({zIndex:j}),l=!1}),r(document).unbind("keydown.mask"),n.unbind("click.mask"),r(window).unbind("resize.mask")}return this},fit:function(){if(l){var b=p();n.css({width:b[0],height:b[1]})}},getMask:function(){return n},isLoaded:function(b){return b?l=="full":l},getConf:function(){return k},getExposed:function(){return m}},r.fn.mask=function(a){r.mask.load(a);return this},r.fn.expose=function(a){r.mask.load(a,this);return this}})(jQuery);
