/*
 * jquery.tools 1.1.1 - The missing UI library for the Web
 * 
 * [tools.overlay-1.1.1, tools.overlay.gallery-1.0.0, tools.expose-1.0.5]
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 * 
 * -----
 * 
 * File generated: Fri Sep 18 12:39:26 GMT+00:00 2009
 */
(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.1",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[];function a(h,m){var p=this,n=c(this),o=c(window),k,j,i,f=m.expose&&c.tools.expose.version;var g=m.target||h.attr("rel");j=g?c(g):null||h;if(h&&h.index(j)==-1){h.click(function(q){p.load();return q.preventDefault()})}c.each(m,function(e,q){if(c.isFunction(q)){n.bind(e,q)}});c.extend(p,{load:function(){if(p.isOpened()){return p}if(m.oneInstance){c.each(d,function(){this.close()})}var u=c.Event("onBeforeLoad");n.trigger(u);if(u.isDefaultPrevented()){return p}i=true;if(f){j.expose().load()}var t=m.top;var s=m.left;var q=j.outerWidth({margin:true});var r=j.outerHeight({margin:true});if(typeof t=="string"){t=t=="center"?Math.max((o.height()-r)/2,0):parseInt(t,10)/100*o.height()}if(s=="center"){s=Math.max((o.width()-q)/2,0)}if(!m.absolute){t+=o.scrollTop();s+=o.scrollLeft()}j.css({top:t,left:s,position:"absolute"});b[m.effect][0].call(p,function(){if(i){n.trigger("onLoad")}});if(m.closeOnClick){c(document).bind("click.overlay",function(e){if(!p.isOpened()){return}var v=c(e.target);if(v.parents(j).length>1){return}c.each(d,function(){this.close()})})}if(m.closeOnEsc){c(document).unbind("keydown.overlay").bind("keydown.overlay",function(e){if(e.keyCode==27){c.each(d,function(){this.close()})}})}return p},close:function(){if(!p.isOpened()){return p}var r=c.Event("onBeforeClose");n.trigger(r);if(r.isDefaultPrevented()){return}i=false;b[m.effect][1].call(p,function(){n.trigger("onClose")});var q=true;c.each(d,function(){if(this.isOpened()){q=false}});if(q){c(document).unbind("click.overlay").unbind("keydown.overlay")}return p},getContent:function(){return j},getOverlay:function(){return j},getTrigger:function(){return h},getClosers:function(){return k},isOpened:function(){return i},getConf:function(){return m},bind:function(e,q){n.bind(e,q);return p},onBeforeLoad:function(e){return this.bind("onBeforeLoad",e)},onLoad:function(e){return this.bind("onLoad",e)},onBeforeClose:function(e){return this.bind("onBeforeClose",e)},onClose:function(e){return this.bind("onClose",e)},unbind:function(e){n.unbind(e);return p}});if(f){if(typeof m.expose=="string"){m.expose={color:m.expose}}c.extend(m.expose,{api:true,closeOnClick:m.closeOnClick,closeOnEsc:false});var l=j.expose(m.expose);l.onBeforeClose(function(){p.close()});p.onClose(function(){l.close()})}k=j.find(m.close||".close");if(!k.length&&!m.close){k=c('<div class="close"></div>');j.prepend(k)}k.click(function(){p.close()})}c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f){return f}if(c.isFunction(e)){e={onBeforeLoad:e}}var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.overlay;a.plugins=a.plugins||{};a.plugins.gallery={version:"1.0.0",conf:{imgId:"img",next:".next",prev:".prev",info:".info",progress:".progress",disabledClass:"disabled",activeClass:"active",opacity:0.8,speed:"slow",template:"<strong>${title}</strong> <span>Image ${index} of ${total}</span>",autohide:true,preload:true,api:false}};b.fn.gallery=function(d){var o=b.extend({},a.plugins.gallery.conf),m;b.extend(o,d);m=this.overlay();var r=this,j=m.getOverlay(),k=j.find(o.next),g=j.find(o.prev),e=j.find(o.info),c=j.find(o.progress),h=g.add(k).add(e).css({opacity:o.opacity}),s=m.getClosers(),l;function p(u){c.fadeIn();h.hide();s.hide();var t=u.attr("href");var v=new Image();v.onload=function(){c.fadeOut();var y=b("#"+o.imgId,j);if(!y.length){y=b("<img/>").attr("id",o.imgId).css("visibility","hidden");j.prepend(y)}y.attr("src",t).css("visibility","hidden");var z=v.width;var A=(b(window).width()-z)/2;l=r.index(r.filter("[href="+t+"]"));r.removeClass(o.activeClass).eq(l).addClass(o.activeClass);var w=o.disabledClass;h.removeClass(w);if(l===0){g.addClass(w)}if(l==r.length-1){k.addClass(w)}var B=o.template.replace("${title}",u.attr("title")||u.data("title")).replace("${index}",l+1).replace("${total}",r.length);var x=parseInt(e.css("paddingLeft"),10)+parseInt(e.css("paddingRight"),10);e.html(B).css({width:z-x});j.animate({width:z,height:v.height,left:A},o.speed,function(){y.hide().css("visibility","visible").fadeIn(function(){if(!o.autohide){h.fadeIn();s.show()}})})};v.onerror=function(){j.fadeIn().html("Cannot find image "+t)};v.src=t;if(o.preload){r.filter(":eq("+(l-1)+"), :eq("+(l+1)+")").each(function(){var w=new Image();w.src=b(this).attr("href")})}}function f(t,u){t.click(function(){if(t.hasClass(o.disabledClass)){return}var v=r.eq(i=l+(u?1:-1));if(v.length){p(v)}})}f(k,true);f(g);b(document).keydown(function(t){if(!j.is(":visible")||t.altKey||t.ctrlKey){return}if(t.keyCode==37||t.keyCode==39){var u=t.keyCode==37?g:k;u.click();return t.preventDefault()}return true});function q(){if(!j.is(":animated")){h.show();s.show()}}if(o.autohide){j.hover(q,function(){h.fadeOut();s.hide()}).mousemove(q)}var n;this.each(function(){var v=b(this),u=b(this).overlay(),t=u;u.onBeforeLoad(function(){p(v)});u.onClose(function(){r.removeClass(o.activeClass)})});return o.api?n:this}})(jQuery);
(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]}return[b(window).width(),b(document).height()]}function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l)){j.bind(k,l)}});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(){if(f){return e}i=h.eq(0).css("zIndex");if(g.maskId){d=b("#"+g.maskId)}if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId){d.attr("id",g.maskId)}b("body").append(d);var k=d.css("backgroundColor");if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)"){d.css("backgroundColor",g.color)}if(g.closeOnEsc){b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27){e.close()}})}if(g.closeOnClick){d.bind("click.unexpose",function(){e.close()})}}var n=b.Event("onBeforeLoad");j.trigger(n);if(n.isDefaultPrevented()){return e}b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position"))){o.css("position","relative")}});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded()){d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m){d.css("height",m)}j.trigger("onLoad")})}f=true;return e},close:function(){if(!f){return e}var k=b.Event("onBeforeClose");j.trigger(k);if(k.isDefaultPrevented()){return e}d.fadeOut(g.closeSpeed,function(){j.trigger("onClose");h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},onBeforeLoad:function(k){return this.bind("onBeforeLoad",k)},onLoad:function(k){return this.bind("onLoad",k)},onBeforeClose:function(k){return this.bind("onBeforeClose",k)},onClose:function(k){return this.bind("onClose",k)},unbind:function(k){j.unbind(k);return e}})}b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e){return e}if(typeof d=="string"){d={color:d}}var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery);

