/*!
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 * 
 * overlay/overlay.js
 * overlay/overlay.apple.js
 * tabs/tabs.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(f){f.tools=f.tools||{version:"v1.2.6"},f.tools.overlay={addEffect:function(i,c,j){h[i]=[c,j]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!f.browser.msie||f.browser.version>6,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var e=[],h={};f.tools.overlay.addEffect("default",function(a,k){var j=this.getConf(),i=f(window);j.fixed||(a.top+=i.scrollTop(),a.left+=i.scrollLeft()),a.position=j.fixed?"fixed":"absolute",this.getOverlay().css(a).fadeIn(j.speed,k)},function(b){this.getOverlay().fadeOut(this.getConf().closeSpeed,b)});function g(v,u){var t=this,s=v.add(t),r=f(window),q,p,o,c=f.tools.expose&&(u.mask||u.expose),b=Math.random().toString().slice(10);c&&(typeof c=="string"&&(c={color:c}),c.closeOnClick=c.closeOnEsc=!1);var a=u.target||v.attr("rel");p=a?f(a):null||v;if(!p.length){throw"Could not find Overlay: "+a}v&&v.index(p)==-1&&v.click(function(d){t.load(d);return d.preventDefault()}),f.extend(t,{load:function(w){if(t.isOpened()){return t}var j=h[u.effect];if(!j){throw'Overlay: cannot find effect : "'+u.effect+'"'}u.oneInstance&&f.each(e,function(){this.close(w)}),w=w||f.Event(),w.type="onBeforeLoad",s.trigger(w);if(w.isDefaultPrevented()){return t}o=!0,c&&f(p).expose(c);var x=u.top,m=u.left,l=p.outerWidth({margin:!0}),k=p.outerHeight({margin:!0});typeof x=="string"&&(x=x=="center"?Math.max((r.height()-k)/2,0):parseInt(x,10)/100*r.height()),m=="center"&&(m=Math.max((r.width()-l)/2,0)),j[0].call(t,{top:x,left:m},function(){o&&(w.type="onLoad",s.trigger(w))}),c&&u.closeOnClick&&f.mask.getMask().one("click",t.close),u.closeOnClick&&f(document).bind("click."+b,function(d){f(d.target).parents(p).length||t.close(d)}),u.closeOnEsc&&f(document).bind("keydown."+b,function(d){d.keyCode==27&&t.close(d)});return t},close:function(d){if(!t.isOpened()){return t}d=d||f.Event(),d.type="onBeforeClose",s.trigger(d);if(!d.isDefaultPrevented()){o=!1,h[u.effect][1].call(t,function(){d.type="onClose",s.trigger(d)}),f(document).unbind("click."+b).unbind("keydown."+b),c&&f.mask.close();return t}},getOverlay:function(){return p},getTrigger:function(){return v},getClosers:function(){return q},isOpened:function(){return o},getConf:function(){return u}}),f.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(d,i){f.isFunction(u[i])&&f(t).bind(i,u[i]),t[i]=function(j){j&&f(t).bind(i,j);return t}}),q=p.find(u.close||".close"),!q.length&&!u.close&&(q=f('<a class="close"></a>'),p.prepend(q)),q.click(function(d){t.close(d)}),u.load&&t.load()}f.fn.overlay=function(b){var a=this.data("overlay");if(a){return a}f.isFunction(b)&&(b={onBeforeLoad:b}),b=f.extend(!0,{},f.tools.overlay.conf,b),this.each(function(){a=new g(f(this),b),e.push(a),f(this).data("overlay",a)});return b.api?a:this}})(jQuery);(function(h){var g=h.tools.overlay,l=h(window);h.extend(g.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function k(d){var c=d.offset();return{top:c.top+d.height()/2,left:c.left+d.width()/2}}var j=function(z,y){var x=this.getOverlay(),w=this.getConf(),v=this.getTrigger(),u=this,t=x.outerWidth({margin:!0}),s=x.data("img"),r=w.fixed?"fixed":"absolute";if(!s){var q=x.css("backgroundImage");if(!q){throw"background-image CSS property not set for overlay"}q=q.slice(q.indexOf("(")+1,q.indexOf(")")).replace(/\"/g,""),x.css("backgroundImage","none"),s=h('<img src="'+q+'"/>'),s.css({border:0,display:"none"}).width(t),h("body").append(s),x.data("img",s)}var d=w.start.top||Math.round(l.height()/2),c=w.start.left||Math.round(l.width()/2);if(v){var a=k(v);d=a.top,c=a.left}w.fixed?(d-=l.scrollTop(),c-=l.scrollLeft()):(z.top+=l.scrollTop(),z.left+=l.scrollLeft()),s.css({position:"absolute",top:d,left:c,width:0,zIndex:w.zIndex}).show(),z.position=r,x.css(z),s.animate({top:x.css("top"),left:x.css("left"),width:t},w.speed,function(){x.css("zIndex",w.zIndex+1).fadeIn(w.fadeInSpeed,function(){u.isOpened()&&!h(this).index(x)?y.call():x.hide()})}).css("position",r)},i=function(a){var o=this.getOverlay().hide(),n=this.getConf(),m=this.getTrigger(),d=o.data("img"),c={top:n.start.top,left:n.start.left,width:0};m&&h.extend(c,k(m)),n.fixed&&d.css({position:"absolute"}).animate({top:"+="+l.scrollTop(),left:"+="+l.scrollLeft()},0),d.animate(c,n.closeSpeed,a)};g.addEffect("apple",j,i)})(jQuery);(function(g){g.tools=g.tools||{version:"v1.2.6"},g.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:!1,slideUpSpeed:400,slideDownSpeed:400,history:!1},addEffect:function(b,d){f[b]=d}};var f={"default":function(d,c){this.getPanes().hide().eq(d).show(),c.call()},fade:function(l,k){var o=this.getConf(),n=o.fadeOutSpeed,m=this.getPanes();n?m.fadeOut(n):m.hide(),m.eq(l).fadeIn(o.fadeInSpeed,k)},slide:function(e,d){var k=this.getConf();this.getPanes().slideUp(k.slideUpSpeed),this.getPanes().eq(e).slideDown(k.slideDownSpeed,d)},ajax:function(d,c){this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"),c)}},j,i;g.tools.tabs.addEffect("horizontal",function(a,k){if(!j){var d=this.getPanes().eq(a),c=this.getCurrentPane();i||(i=this.getPanes().eq(0).width()),j=!0,d.show(),c.animate({width:0},{step:function(b){d.css("width",i-b)},complete:function(){g(this).hide(),k.call(),j=!1}}),c.length||(k.call(),j=!1)}});function h(p,o,n){var m=this,l=p.add(this),k=p.find(n.tabs),b=o.jquery?o:p.children(o),a;k.length||(k=p.children()),b.length||(b=p.parent().find(o)),b.length||(b=g(o)),g.extend(this,{click:function(s,r){var q=k.eq(s);typeof s=="string"&&s.replace("#","")&&(q=k.filter("[href*="+s.replace("#","")+"]"),s=Math.max(k.index(q),0));if(n.rotate){var e=k.length-1;if(s<0){return m.click(e,r)}if(s>e){return m.click(0,r)}}if(!q.length){if(a>=0){return m}s=n.initialIndex,q=k.eq(s)}if(s===a){return m}r=r||g.Event(),r.type="onBeforeClick",l.trigger(r,[s]);if(!r.isDefaultPrevented()){f[n.effect].call(m,s,function(){a=s,r.type="onClick",l.trigger(r,[s])}),k.removeClass(n.current),q.addClass(n.current);return m}},getConf:function(){return n},getTabs:function(){return k},getPanes:function(){return b},getCurrentPane:function(){return b.eq(a)},getCurrentTab:function(){return k.eq(a)},getIndex:function(){return a},next:function(){return m.click(a+1)},prev:function(){return m.click(a-1)},destroy:function(){k.unbind(n.event).removeClass(n.current),b.find("a[href^=#]").unbind("click.T");return m}}),g.each("onBeforeClick,onClick".split(","),function(d,e){g.isFunction(n[e])&&g(m).bind(e,n[e]),m[e]=function(c){c&&g(m).bind(e,c);return m}}),n.history&&g.fn.history&&(g.tools.history.init(k),n.event="history"),k.each(function(c){g(this).bind(n.event,function(d){m.click(c,d);return d.preventDefault()})}),b.find("a[href^=#]").bind("click.T",function(c){m.click(g(this).attr("href"),c)}),location.hash&&n.tabs=="a"&&p.find("[href="+location.hash+"]").length?m.click(location.hash):(n.initialIndex===0||n.initialIndex>0)&&m.click(n.initialIndex)}g.fn.tabs=function(a,k){var e=this.data("tabs");e&&(e.destroy(),this.removeData("tabs")),g.isFunction(k)&&(k={onBeforeClick:k}),k=g.extend({},g.tools.tabs.conf,k),this.each(function(){e=new h(g(this),a,k),g(this).data("tabs",e)});return k.api?e:this}})(jQuery);
