(function(g){g.tools=g.tools||{};g.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(b,a){h[b]=a}};var h={"default":function(a,b){this.getPanes().hide().eq(a).show();b.call()},fade:function(c,k){var d=this.getConf(),a=d.fadeOutSpeed,b=this.getPanes();if(a){b.fadeOut(a)}else{b.hide()}b.eq(c).fadeIn(d.fadeInSpeed,k)},slide:function(a,b){this.getPanes().slideUp(200);this.getPanes().eq(a).slideDown(400,b)},ajax:function(a,b){this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"),b)}};var e;g.tools.tabs.addEffect("horizontal",function(a,b){if(!e){e=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){g(this).hide()});this.getPanes().eq(a).animate({width:e},function(){g(this).show();b.call()})});function f(d,c,k){var l=this,a=g(this),b;g.each(k,function(m,j){if(g.isFunction(j)){a.bind(m,j)}});g.extend(this,{click:function(q,s){var r=l.getCurrentPane();var p=d.eq(q);if(typeof q=="string"&&q.replace("#","")){p=d.filter("[href*="+q.replace("#","")+"]");q=Math.max(d.index(p),0)}if(k.rotate){var j=d.length-1;if(q<0){return l.click(j,s)}if(q>j){return l.click(0,s)}}if(!p.length){if(b>=0){return l}q=k.initialIndex;p=d.eq(q)}if(q===b){return l}s=s||g.Event();s.type="onBeforeClick";a.trigger(s,[q]);if(s.isDefaultPrevented()){return}h[k.effect].call(l,q,function(){s.type="onClick";a.trigger(s,[q])});s.type="onStart";a.trigger(s,[q]);if(s.isDefaultPrevented()){return}b=q;d.removeClass(k.current);p.addClass(k.current);return l},getConf:function(){return k},getTabs:function(){return d},getPanes:function(){return c},getCurrentPane:function(){return c.eq(b)},getCurrentTab:function(){return d.eq(b)},getIndex:function(){return b},next:function(){return l.click(b+1)},prev:function(){return l.click(b-1)},bind:function(m,j){a.bind(m,j);return l},onBeforeClick:function(j){return this.bind("onBeforeClick",j)},onClick:function(j){return this.bind("onClick",j)},unbind:function(j){a.unbind(j);return l}});d.each(function(j){g(this).bind(k.event,function(m){l.click(j,m);return false})});if(location.hash){l.click(location.hash)}else{if(k.initialIndex===0||k.initialIndex>0){l.click(k.initialIndex)}}c.find("a[href^=#]").click(function(j){l.click(g(this).attr("href"),j)})}g.fn.tabs=function(a,d){var c=this.eq(typeof d=="number"?d:0).data("tabs");if(c){return c}if(g.isFunction(d)){d={onBeforeClick:d}}var b=g.extend({},g.tools.tabs.conf),j=this.length;d=g.extend(b,d);this.each(function(o){var q=g(this);var p=q.find(d.tabs);if(!p.length){p=q.children()}var n=a.jquery?a:q.children(a);if(!n.length){n=j==1?g(a):q.parent().find(a)}c=new f(p,n,d);q.data("tabs",c)});return d.api?c:this}})(jQuery);(function(c){var d=c.tools.tabs;d.plugins=d.plugins||{};d.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:true,autopause:true,interval:3000,clickable:false,api:false}};c.prototype.slideshow=function(b){var a=c.extend({},d.plugins.slideshow.conf),h=this.length,g;b=c.extend(a,b);this.each(function(){var t=c(this),w=t.tabs(),A=c(w),u=w;c.each(b,function(k,j){if(c.isFunction(j)){w.bind(k,j)}});function v(j){return h==1?c(j):t.parent().find(j)}var D=v(b.next).click(function(){w.next()});var f=v(b.prev).click(function(){w.prev()});var B,z,x,C=false;c.extend(w,{play:function(){if(B){return}var j=c.Event("onBeforePlay");A.trigger(j);if(j.isDefaultPrevented()){return w}C=false;B=setInterval(w.next,b.interval);A.trigger("onPlay");w.next()},pause:function(){if(!B){return w}var j=c.Event("onBeforePause");A.trigger(j);if(j.isDefaultPrevented()){return w}B=clearInterval(B);x=clearInterval(x);A.trigger("onPause")},stop:function(){w.pause();C=true},onBeforePlay:function(j){return w.bind("onBeforePlay",j)},onPlay:function(j){return w.bind("onPlay",j)},onBeforePause:function(j){return w.bind("onBeforePause",j)},onPause:function(j){return w.bind("onPause",j)}});if(b.autopause){var y=w.getTabs().add(D).add(f).add(w.getPanes());y.hover(function(){w.pause();z=clearInterval(z)},function(){if(!C){z=setTimeout(w.play,b.interval)}})}if(b.autoplay){x=setTimeout(w.play,b.interval)}else{w.stop()}if(b.clickable){w.getPanes().click(function(){w.next()})}if(!w.getConf().rotate){var e=b.disabledClass;if(!w.getIndex()){f.addClass(e)}w.onBeforeClick(function(j,k){if(!k){f.addClass(e)}else{f.removeClass(e);if(k==w.getTabs().length-1){D.addClass(e)}else{D.removeClass(e)}}})}});return b.api?g:this}})(jQuery);(function(b){function c(g,f,o){var m=o.relative?g.position().top:g.offset().top,n=o.relative?g.position().left:g.offset().left,l=o.position[0];m-=f.outerHeight()-o.offset[0];n+=g.outerWidth()+o.offset[1];var k=f.outerHeight()+g.outerHeight();if(l=="center"){m+=k/2}if(l=="bottom"){m+=k}l=o.position[1];g=f.outerWidth()+g.outerWidth();if(l=="center"){n-=g/2}if(l=="left"){n-=g}return{top:m,left:n}}function a(B,A){var z=this,x=B.add(z),y,w=0,u=0,n=B.attr("title"),g=B.attr("data-tooltip"),f=d[A.effect],o,E=B.is(":input"),C=E&&B.is(":checkbox, :radio, select, :button, :submit"),D=B.attr("type"),p=A.events[D]||A.events[E?C?"widget":"input":"def"];if(!f){throw'Nonexistent effect "'+A.effect+'"'}p=p.split(/,\s*/);if(p.length!=2){throw"Tooltip: bad events configuration for "+D}B.bind(p[0],function(e){clearTimeout(w);if(A.predelay){u=setTimeout(function(){z.show(e)},A.predelay)}else{z.show(e)}}).bind(p[1],function(e){clearTimeout(u);if(A.delay){w=setTimeout(function(){z.hide(e)},A.delay)}else{z.hide(e)}});if(n&&A.cancelDefault){B.removeAttr("title");B.data("title",n)}b.extend(z,{show:function(h){if(!y){if(g){y=b(g)}else{if(n){y=b(A.layout).addClass(A.tipClass).appendTo(document.body).hide().append(n)}else{if(A.tip){y=b(A.tip).eq(0)}else{y=B.next();y.length||(y=B.parent().next())}}}if(!y.length){throw"Cannot find tooltip for "+B}}if(z.isShown()){return z}y.stop(true,true);var e=c(B,y,A);h=h||b.Event();h.type="onBeforeShow";x.trigger(h,[e]);if(h.isDefaultPrevented()){return z}e=c(B,y,A);y.css({position:"absolute",top:e.top,left:e.left});o=true;f[0].call(z,function(){h.type="onShow";o="full";x.trigger(h)});e=A.events.tooltip.split(/,\s*/);y.bind(e[0],function(){clearTimeout(w);clearTimeout(u)});e[1]&&!B.is("input:not(:checkbox, :radio), textarea")&&y.bind(e[1],function(j){j.relatedTarget!=B[0]&&B.trigger(p[1].split(" ")[0])});return z},hide:function(e){if(!y||!z.isShown()){return z}e=e||b.Event();e.type="onBeforeHide";x.trigger(e);if(!e.isDefaultPrevented()){o=false;d[A.effect][1].call(z,function(){e.type="onHide";x.trigger(e)});return z}},isShown:function(e){return e?o=="full":o},getConf:function(){return A},getTip:function(){return y},getTrigger:function(){return B}});b.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(h,e){b.isFunction(A[e])&&b(z).bind(e,A[e]);z[e]=function(j){b(z).bind(e,j);return z}})}b.tools=b.tools||{version:"1.2.4"};b.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(f,e,g){d[f]=[e,g]}};var d={toggle:[function(f){var e=this.getConf(),g=this.getTip();e=e.opacity;e<1&&g.css({opacity:e});g.show();f.call()},function(e){this.getTip().hide();e.call()}],fade:[function(f){var e=this.getConf();this.getTip().fadeTo(e.fadeInSpeed,e.opacity,f)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};b.fn.tooltip=function(f){var e=this.data("tooltip");if(e){return e}f=b.extend(true,{},b.tools.tooltip.conf,f);if(typeof f.position=="string"){f.position=f.position.split(/,?\s/)}this.each(function(){e=new a(b(this),f);b(this).data("tooltip",e)});return f.api?e:this}})(jQuery);(function(d){d.tools=d.tools||{};d.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var f;function e(s,u){var a=this,c=d(this),D=!u.vertical,C=s.children(),w=0,y;if(!f){f=a}d.each(u,function(h,g){if(d.isFunction(g)){c.bind(h,g)}});if(C.length>1){C=d(u.items,s)}function v(g){var h=d(g);return u.globalNav?h:s.parent().find(g)}s.data("finder",v);var B=v(u.prev),z=v(u.next),A=v(u.prevPage),t=v(u.nextPage);d.extend(a,{getIndex:function(){return w},getClickIndex:function(){var g=a.getItems();return g.index(g.filter("."+u.activeClass))},getConf:function(){return u},getSize:function(){return a.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/u.size)},getPageIndex:function(){return Math.ceil(w/u.size)},getNaviButtons:function(){return B.add(z).add(A).add(t)},getRoot:function(){return s},getItemWrap:function(){return C},getItems:function(){return C.children(u.item)},getVisibleItems:function(){return a.getItems().slice(w,w+u.size)},seekTo:function(m,h,l){if(m<0){m=0}if(w===m){return a}if(d.isFunction(h)){l=h}if(m>a.getSize()-u.size){return u.loop?a.begin():this.end()}var k=a.getItems().eq(m);if(!k.length){return a}var j=d.Event("onBeforeSeek");c.trigger(j,[m]);if(j.isDefaultPrevented()){return a}if(h===undefined||d.isFunction(h)){h=u.speed}function g(){if(l){l.call(a,m)}c.trigger("onSeek",[m])}if(D){C.animate({left:-k.position().left},h,u.easing,g)}else{C.animate({top:-k.position().top},h,u.easing,g)}f=a;w=m;j=d.Event("onStart");c.trigger(j,[m]);if(j.isDefaultPrevented()){return a}B.add(A).toggleClass(u.disabledClass,m===0);z.add(t).toggleClass(u.disabledClass,m>=a.getSize()-u.size);return a},move:function(g,h,j){y=g>0;return this.seekTo(w+g,h,j)},next:function(g,h){return this.move(1,g,h)},prev:function(g,h){return this.move(-1,g,h)},movePage:function(g,h,j){y=g>0;var l=u.size*g;var k=w%u.size;if(k>0){l+=(g>0?-k:u.size-k)}return this.move(l,h,j)},prevPage:function(g,h){return this.movePage(-1,g,h)},nextPage:function(g,h){return this.movePage(1,g,h)},setPage:function(h,g,j){return this.seekTo(h*u.size,g,j)},begin:function(g,h){y=false;return this.seekTo(0,g,h)},end:function(h,j){y=true;var g=this.getSize()-u.size;return g>0?this.seekTo(g,h,j):a},reload:function(){c.trigger("onReload");return a},focus:function(){f=a;return a},click:function(k){var j=a.getItems().eq(k),m=u.activeClass,l=u.size;if(k<0||k>=a.getSize()){return a}if(l==1){if(u.loop){return a.next()}if(k===0||k==a.getSize()-1){y=(y===undefined)?true:!y}return y===false?a.prev():a.next()}if(l==2){if(k==w){k--}a.getItems().removeClass(m);j.addClass(m);return a.seekTo(k,time,fn)}if(!j.hasClass(m)){a.getItems().removeClass(m);j.addClass(m);var g=Math.floor(l/2);var h=k-g;if(h>a.getSize()-l){h=a.getSize()-l}if(h!==k){return a.seekTo(h)}}return a},bind:function(h,g){c.bind(h,g);return a},unbind:function(g){c.unbind(g);return a}});d.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(h,g){a[g]=function(j){return a.bind(g,j)}});B.addClass(u.disabledClass).click(function(){a.prev()});z.click(function(){a.next()});t.click(function(){a.nextPage()});if(a.getSize()<u.size){z.add(t).addClass(u.disabledClass)}A.addClass(u.disabledClass).click(function(){a.prevPage()});var x=u.hoverClass,b="keydown."+Math.random().toString().substring(10);a.onReload(function(){if(x){a.getItems().hover(function(){d(this).addClass(x)},function(){d(this).removeClass(x)})}if(u.clickable){a.getItems().each(function(g){d(this).unbind("click.scrollable").bind("click.scrollable",function(h){if(d(h.target).is("a")){return}return a.click(g)})})}if(u.keyboard){d(document).unbind(b).bind(b,function(h){if(h.altKey||h.ctrlKey){return}if(u.keyboard!="static"&&f!=a){return}var g=u.keyboardSteps;if(D&&(h.keyCode==37||h.keyCode==39)){a.move(h.keyCode==37?-g:g);return h.preventDefault()}if(!D&&(h.keyCode==38||h.keyCode==40)){a.move(h.keyCode==38?-g:g);return h.preventDefault()}return true})}else{d(document).unbind(b)}});a.reload()}d.fn.scrollable=function(c){var b=this.eq(typeof c=="number"?c:0).data("scrollable");if(b){return b}var a=d.extend({},d.tools.scrollable.conf);c=d.extend(a,c);c.keyboardSteps=c.keyboardSteps||c.size;this.each(function(){b=new e(d(this),c);d(this).data("scrollable",b)});return c.api?b:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};c.fn.circular=function(a){var b=c.extend({},d.plugins.circular.conf),f;c.extend(b,a);this.each(function(){var s=c(this).scrollable(),e=s.getItems(),q=s.getConf(),v=s.getItemWrap(),r=0;if(s){f=s}if(e.length<q.size){return false}e.slice(0,q.size).each(function(g){c(this).clone().appendTo(v).click(function(){s.click(e.length+g)}).addClass(b.clonedClass)});var p=c.makeArray(e.slice(-q.size)).reverse();c(p).each(function(g){c(this).clone().prependTo(v).click(function(){s.click(-g-1)}).addClass(b.clonedClass)});var o=v.children(q.item);var t=q.hoverClass;if(t){o.hover(function(){c(this).addClass(t)},function(){c(this).removeClass(t)})}function u(h){var g=o.eq(h);if(q.vertical){v.css({top:-g.position().top})}else{v.css({left:-g.position().left})}}u(q.size);c.extend(s,{move:function(j,k,m,l){var g=r+j+q.size;var h=g>s.getSize()-q.size;if(g<=0||h){var n=r+q.size+(h?-e.length:e.length);u(n);g=n+j}if(l){o.removeClass(q.activeClass).eq(g+Math.floor(q.size/2)).addClass(q.activeClass)}if(g===r+q.size){return self}return s.seekTo(g,k,m)},begin:function(g,h){return this.seekTo(q.size,g,h)},end:function(g,h){return this.seekTo(e.length,g,h)},click:function(k,h,j){if(!q.clickable){return self}if(q.size==1){return this.next()}var g=k-r,l=q.activeClass;g-=Math.floor(q.size/2);return this.move(g,h,j,true)},getIndex:function(){return r},setPage:function(h,g,j){return this.seekTo(h*q.size+q.size,g,j)},getPageAmount:function(){return Math.ceil(e.length/q.size)},getPageIndex:function(){if(r<0){return this.getPageAmount()-1}if(r>=e.length){return 0}var g=(r+q.size)/q.size-1;return g},getVisibleItems:function(){var g=r+q.size;return o.slice(g,g+q.size)}});s.onStart(function(g,h){r=h-q.size;return false});s.getNaviButtons().removeClass(q.disabledClass)});return b.api?f:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};c.fn.autoscroll=function(b){if(typeof b=="number"){b={interval:b}}var a=c.extend({},d.plugins.autoscroll.conf),f;c.extend(a,b);this.each(function(){var k=c(this).scrollable();if(k){f=k}var e,l,j=true;k.play=function(){if(e){return}j=false;e=setInterval(function(){k.move(a.steps)},a.interval);k.move(a.steps)};k.pause=function(){e=clearInterval(e)};k.stop=function(){k.pause();j=true};if(a.autopause){k.getRoot().add(k.getNaviButtons()).hover(function(){k.pause();clearInterval(l)},function(){if(!j){l=setTimeout(k.play,a.interval)}})}if(a.autoplay){setTimeout(k.play,a.interval)}});return a.api?f:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};c.fn.navigator=function(b){var a=c.extend({},d.plugins.navigator.conf),f;if(typeof b=="string"){b={navi:b}}b=c.extend(a,b);this.each(function(){var o=c(this).scrollable(),r=o.getRoot(),e=r.data("finder").call(null,b.navi),q=null,m=o.getNaviButtons();if(o){f=o}o.getNaviButtons=function(){return m.add(e)};function n(){if(!e.children().length||e.data("navi")==o){e.empty();e.data("navi",o);for(var g=0;g<o.getPageAmount();g++){e.append(c("<"+(b.naviItem||"a")+"/>"))}q=e.children().each(function(j){var h=c(this);h.click(function(k){o.setPage(j);return k.preventDefault()});if(b.indexed){h.text(j)}if(b.idPrefix){h.attr("id",b.idPrefix+j)}})}else{q=b.naviItem?e.find(b.naviItem):e.children();q.each(function(j){var h=c(this);h.click(function(k){o.setPage(j);return k.preventDefault()})})}q.eq(0).addClass(b.activeClass)}o.onStart(function(h,j){var g=b.activeClass;q.removeClass(g).eq(o.getPageIndex()).addClass(g)});o.onReload(function(){n()});n();var p=q.filter("[href="+location.hash+"]");if(p.length){o.move(q.index(p))}});return b.api?f:this}})(jQuery);(function(h){h.tools=h.tools||{};h.tools.overlay={version:"1.1.2",addEffect:function(c,b,a){e[c]=[b,a]},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 e={};h.tools.overlay.addEffect("default",function(a){this.getOverlay().fadeIn(this.getConf().speed,a)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});var g=[];function f(t,p){var a=this,c=h(this),b=h(window),q,r,s,v=p.expose&&h.tools.expose.version;var u=p.target||t.attr("rel");r=u?h(u):null||t;if(!r.length){throw"Could not find Overlay: "+u}if(t&&t.index(r)==-1){t.click(function(j){a.load(j);return j.preventDefault()})}h.each(p,function(k,j){if(h.isFunction(j)){c.bind(k,j)}});h.extend(a,{load:function(j){if(a.isOpened()){return a}var m=e[p.effect];if(!m){throw'Overlay: cannot find effect : "'+p.effect+'"'}if(p.oneInstance){h.each(g,function(){this.close(j)})}j=j||h.Event();j.type="onBeforeLoad";c.trigger(j);if(j.isDefaultPrevented()){return a}s=true;if(v){r.expose().load(j)}var k=p.top;var l=p.left;var o=r.outerWidth({margin:true});var n=r.outerHeight({margin:true});if(typeof k=="string"){k=k=="center"?Math.max((b.height()-n)/2,0):parseInt(k,10)/100*b.height()}if(l=="center"){l=Math.max((b.width()-o)/2,0)}if(!p.absolute){k+=b.scrollTop();l+=b.scrollLeft()}r.css({top:k,left:l,position:"absolute"});j.type="onStart";c.trigger(j);m[0].call(a,function(){if(s){j.type="onLoad";c.trigger(j)}});if(p.closeOnClick){h(document).bind("click.overlay",function(x){if(!a.isOpened()){return}var y=h(x.target);if(y.parents(r).length>1){return}h.each(g,function(){this.close(x)})})}if(p.closeOnEsc){h(document).unbind("keydown.overlay").bind("keydown.overlay",function(w){if(w.keyCode==27){h.each(g,function(){this.close(w)})}})}return a},close:function(j){if(!a.isOpened()){return a}j=j||h.Event();j.type="onBeforeClose";c.trigger(j);if(j.isDefaultPrevented()){return}s=false;e[p.effect][1].call(a,function(){j.type="onClose";c.trigger(j)});var k=true;h.each(g,function(){if(this.isOpened()){k=false}});if(k){h(document).unbind("click.overlay").unbind("keydown.overlay")}return a},getContent:function(){return r},getOverlay:function(){return r},getTrigger:function(){return t},getClosers:function(){return q},isOpened:function(){return s},getConf:function(){return p},bind:function(k,j){c.bind(k,j);return a},unbind:function(j){c.unbind(j);return a}});h.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(k,j){a[j]=function(l){return a.bind(j,l)}});if(v){if(typeof p.expose=="string"){p.expose={color:p.expose}}h.extend(p.expose,{api:true,closeOnClick:p.closeOnClick,closeOnEsc:false});var d=r.expose(p.expose);d.onBeforeClose(function(j){a.close(j)});a.onClose(function(j){d.close(j)})}q=r.find(p.close||".close");if(!q.length&&!p.close){q=h('<div class="close"></div>');r.prepend(q)}q.click(function(j){a.close(j)})}h.fn.overlay=function(c){var b=this.eq(typeof c=="number"?c:0).data("overlay");if(b){return b}if(h.isFunction(c)){c={onBeforeLoad:c}}var a=h.extend({},h.tools.overlay.conf);c=h.extend(true,a,c);this.each(function(){b=new f(h(this),c);g.push(b);h(this).data("overlay",b)});return c.api?b:this}})(jQuery);(function(c){var d=c.tools.overlay;d.plugins=d.plugins||{};d.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}};c.fn.gallery=function(E){var u=c.extend({},d.plugins.gallery.conf),w;c.extend(u,E);w=this.overlay();var a=this,z=w.getOverlay(),y=z.find(u.next),B=z.find(u.prev),D=z.find(u.info),F=z.find(u.progress),A=B.add(y).add(D).css({opacity:u.opacity}),G=w.getClosers(),x;function t(f){F.fadeIn();A.hide();G.hide();var g=f.attr("href");var e=new Image();e.onload=function(){F.fadeOut();var n=c("#"+u.imgId,z);if(!n.length){n=c("<img/>").attr("id",u.imgId).css("visibility","hidden");z.prepend(n)}n.attr("src",g).css("visibility","hidden");var l=e.width;var j=(c(window).width()-l)/2;x=a.index(a.filter("[href="+g+"]"));a.removeClass(u.activeClass).eq(x).addClass(u.activeClass);var k=u.disabledClass;A.removeClass(k);if(x===0){B.addClass(k)}if(x==a.length-1){y.addClass(k)}var m=u.template.replace("${title}",f.attr("title")||f.data("title")).replace("${index}",x+1).replace("${total}",a.length);var h=parseInt(D.css("paddingLeft"),10)+parseInt(D.css("paddingRight"),10);D.html(m).css({width:l-h});z.animate({width:l,height:e.height,left:j},u.speed,function(){n.hide().css("visibility","visible").fadeIn(function(){if(!u.autohide){A.fadeIn();G.show()}})})};e.onerror=function(){z.fadeIn().html("Cannot find image "+g)};e.src=g;if(u.preload){a.filter(":eq("+(x-1)+"), :eq("+(x+1)+")").each(function(){var h=new Image();h.src=c(this).attr("href")})}}function C(f,e){f.click(function(){if(f.hasClass(u.disabledClass)){return}var g=a.eq(i=x+(e?1:-1));if(g.length){t(g)}})}C(y,true);C(B);c(document).keydown(function(f){if(!z.is(":visible")||f.altKey||f.ctrlKey){return}if(f.keyCode==37||f.keyCode==39){var e=f.keyCode==37?B:y;e.click();return f.preventDefault()}return true});function b(){if(!z.is(":animated")){A.show();G.show()}}if(u.autohide){z.hover(b,function(){A.fadeOut();G.hide()}).mousemove(b)}var v;this.each(function(){var e=c(this),f=c(this).overlay(),g=f;f.onBeforeLoad(function(){t(e)});f.onClose(function(){a.removeClass(u.activeClass)})});return u.api?v:this}})(jQuery);(function(j){var f=j.tools.overlay;f.effects=f.effects||{};f.effects.apple={version:"1.0.1"};j.extend(f.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function k(b){var a=b.offset();return[a.top+b.height()/2,a.left+b.width()/2]}var h=function(d){var s=this.getOverlay(),x=this.getConf(),u=this.getTrigger(),b=this,a=s.outerWidth({margin:true}),e=s.data("img");if(!e){var p=s.css("backgroundImage");if(!p){throw"background-image CSS property not set for overlay"}p=p.substring(p.indexOf("(")+1,p.indexOf(")")).replace(/\"/g,"");s.css("backgroundImage","none");e=j('<img src="'+p+'"/>');e.css({border:0,position:"absolute",display:"none"}).width(a);j("body").append(e);s.data("img",e)}var c=j(window),t=x.start.top||Math.round(c.height()/2),v=x.start.left||Math.round(c.width()/2);if(u){var w=k(u);t=w[0];v=w[1]}if(!x.start.absolute){t+=c.scrollTop();v+=c.scrollLeft()}e.css({top:t,left:v,width:0,zIndex:x.zIndex}).show();e.animate({top:s.css("top"),left:s.css("left"),width:a},x.speed,function(){s.css("zIndex",x.zIndex+1).fadeIn(x.fadeInSpeed,function(){if(b.isOpened()&&!j(this).index(s)){d.call()}else{s.hide()}})})};var g=function(n){var e=this.getOverlay(),d=this.getConf(),m=this.getTrigger(),a=d.start.top,b=d.start.left;e.hide();if(m){var c=k(m);a=c[0];b=c[1]}e.data("img").animate({top:a,left:b,width:0},d.closeSpeed,n)};f.addEffect("apple",h,g)})(jQuery);(function(d){d.tools=d.tools||{};d.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 e(){if(d.browser.msie){var a=d(document).height(),b=d(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-b<20?b:a]}return[d(window).width(),d(document).height()]}function f(c,k){var m=this,a=d(this),n=null,l=false,b=0;d.each(k,function(h,g){if(d.isFunction(g)){a.bind(h,g)}});d(window).resize(function(){m.fit()});d.extend(this,{getMask:function(){return n},getExposed:function(){return c},getConf:function(){return k},isLoaded:function(){return l},load:function(o){if(l){return m}b=c.eq(0).css("zIndex");if(k.maskId){n=d("#"+k.maskId)}if(!n||!n.length){var h=e();n=d("<div/>").css({position:"absolute",top:0,left:0,width:h[0],height:h[1],display:"none",opacity:0,zIndex:k.zIndex});if(k.maskId){n.attr("id",k.maskId)}d("body").append(n);var j=n.css("backgroundColor");if(!j||j=="transparent"||j=="rgba(0, 0, 0, 0)"){n.css("backgroundColor",k.color)}if(k.closeOnEsc){d(document).bind("keydown.unexpose",function(p){if(p.keyCode==27){m.close()}})}if(k.closeOnClick){n.bind("click.unexpose",function(p){m.close(p)})}}o=o||d.Event();o.type="onBeforeLoad";a.trigger(o);if(o.isDefaultPrevented()){return m}d.each(c,function(){var p=d(this);if(!/relative|absolute|fixed/i.test(p.css("position"))){p.css("position","relative")}});c.css({zIndex:Math.max(k.zIndex+1,b=="auto"?0:b)});var g=n.height();if(!this.isLoaded()){n.css({opacity:0,display:"block"}).fadeTo(k.loadSpeed,k.opacity,function(){if(n.height()!=g){n.css("height",g)}o.type="onLoad";a.trigger(o)})}l=true;return m},close:function(g){if(!l){return m}g=g||d.Event();g.type="onBeforeClose";a.trigger(g);if(g.isDefaultPrevented()){return m}n.fadeOut(k.closeSpeed,function(){g.type="onClose";a.trigger(g);c.css({zIndex:d.browser.msie?b:null})});l=false;return m},fit:function(){if(n){var g=e();n.css({width:g[0],height:g[1]})}},bind:function(h,g){a.bind(h,g);return m},unbind:function(g){a.unbind(g);return m}});d.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(h,g){m[g]=function(j){return m.bind(g,j)}})}d.fn.expose=function(c){var b=this.eq(typeof c=="number"?c:0).data("expose");if(b){return b}if(typeof c=="string"){c={color:c}}var a=d.extend({},d.tools.expose.conf);c=d.extend(a,c);this.each(function(){b=new f(d(this),c);d(this).data("expose",b)});return c.api?b:this}})(jQuery);jQuery.fn.labelOver=function(a){return this.each(function(){var c=jQuery(this);var d=c.attr("for");if(d){var b=jQuery("#"+d);this.hide=function(){c.css({display:"none"})};this.show=function(){if(b.val()==""){c.css({display:"block"})}};b.focus(this.hide);b.blur(this.show);c.addClass(a).click(function(){b.focus()});if(b.val()!=""){this.hide()}}})};jQuery.fn.toggleText=function(d,c){return this.html(this.html().replace(new RegExp("("+d+"|"+c+")"),function(a){return(a==d)?c:d}))};jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function(a){a.fn.popupWindow=function(b){return this.each(function(){a(this).click(function(){a.fn.popupWindow.defaultSettings={centerBrowser:0,centerScreen:0,height:500,left:0,location:0,menubar:0,resizable:0,scrollbars:0,status:0,width:500,windowName:null,windowURL:null,top:0,toolbar:0};settings=a.extend({},a.fn.popupWindow.defaultSettings,b||{});var c="height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+settings.resizable+",location="+settings.location+",menuBar="+settings.menubar;settings.windowName=this.name||settings.windowName;settings.windowURL=this.href||settings.windowURL;var d,e;if(settings.centerBrowser){if(a.browser.msie){d=(window.screenTop-120)+((((document.documentElement.clientHeight+120)/2)-(settings.height/2)));e=window.screenLeft+((((document.body.offsetWidth+20)/2)-(settings.width/2)))}else{d=window.screenY+(((window.outerHeight/2)-(settings.height/2)));e=window.screenX+(((window.outerWidth/2)-(settings.width/2)))}window.open(settings.windowURL,settings.windowName,c+",left="+e+",top="+d).focus()}else{if(settings.centerScreen){d=(screen.height-settings.height)/2;e=(screen.width-settings.width)/2;window.open(settings.windowURL,settings.windowName,c+",left="+e+",top="+d).focus()}else{window.open(settings.windowURL,settings.windowName,c+",left="+settings.left+",top="+settings.top).focus()}}return false})})}})(jQuery);(function(a){a.fn.lazyload=function(b){var c={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(b){a.extend(c,b)}var d=this;if("scroll"==c.event){a(c.container).bind("scroll",function(g){var e=0;d.each(function(){if(a.abovethetop(this,c)||a.leftofbegin(this,c)){}else{if(!a.belowthefold(this,c)&&!a.rightoffold(this,c)){a(this).trigger("appear")}else{if(e++>c.failurelimit){return false}}}});var f=a.grep(d,function(h){return !h.loaded});d=a(f)})}this.each(function(){var e=this;if(undefined==a(e).attr("original")){a(e).attr("original",a(e).attr("src"))}if("scroll"!=c.event||undefined==a(e).attr("src")||c.placeholder==a(e).attr("src")||(a.abovethetop(e,c)||a.leftofbegin(e,c)||a.belowthefold(e,c)||a.rightoffold(e,c))){if(c.placeholder){a(e).attr("src",c.placeholder)}else{a(e).removeAttr("src")}e.loaded=false}else{e.loaded=true}a(e).one("appear",function(){if(!this.loaded){a("<img />").bind("load",function(){a(e).hide().attr("src",a(e).attr("original"))[c.effect](c.effectspeed);e.loaded=true}).attr("src",a(e).attr("original"))}});if("scroll"!=c.event){a(e).bind(c.event,function(f){if(!e.loaded){a(e).trigger("appear")}})}});a(c.container).trigger(c.event);return this};a.belowthefold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).height()+a(window).scrollTop()}else{var b=a(d.container).offset().top+a(d.container).height()}return b<=a(c).offset().top-d.threshold};a.rightoffold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).width()+a(window).scrollLeft()}else{var b=a(d.container).offset().left+a(d.container).width()}return b<=a(c).offset().left-d.threshold};a.abovethetop=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollTop()}else{var b=a(d.container).offset().top}return b>=a(c).offset().top+d.threshold+a(c).height()};a.leftofbegin=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollLeft()}else{var b=a(d.container).offset().left}return b>=a(c).offset().left+d.threshold+a(c).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);(function(a){a.fn.getTwitter=function(b){var e=a.extend({},a.fn.getTwitter.defaults,b);a(this).hide();a(this).append('<ul id="twitter_update_list"><li></li></ul>');a("ul#twitter_update_list").hide();var c=a('<p id="'+e.preloaderId+'">'+e.loaderText+"</p>");a(this).append(c);var d=window.location.protocol+"//";if(e.showProfileLink){a(this).append('<a id="profileLink" href="'+d+"twitter.com/"+e.userName+'" target="_blank">'+d+"twitter.com/"+e.userName+"</a>")}a(this).show();a.getScript(d+"twitter.com/javascripts/blogger.js");a.getScript(d+"twitter.com/statuses/user_timeline/"+e.userName+".json?callback=twitterCallback2&count="+e.numTweets,function(){a(c).remove();if(e.slideIn){a("ul#twitter_update_list").slideDown(1000)}else{a("ul#twitter_update_list").show()}a("ul#twitter_update_list li:first").addClass("brdrounded firstTweet");a("ul#twitter_update_list li:first").append("<b></b>");a("ul#twitter_update_list li:last").addClass("brdrounded lastTweet");a("ul#twitter_update_list li:last").append("<b></b>")})};a.fn.getTwitter.defaults={userName:null,numTweets:5,preloaderId:"preloader",loaderText:"Loading tweets...",slideIn:false,showHeading:true,headingText:"Latest Tweets",showProfileLink:true}})(jQuery);new function(e){var d=e.separator||"&";var c=e.spaces===false?false:true;var a=e.suffix===false?"":"[]";var f=e.prefix===false?false:true;var b=f?e.hash===true?"#":"?":"";jQuery.query=new function(){var g=function(m,l){return m!=undefined&&m!==null&&(!!l?m.constructor==l:true)};var h=function(r){var l,q=/\[([^[]*)\]/g,n=/^(\S+?)(\[\S*\])?$/.exec(r),o=n[1],p=[];while(l=q.exec(n[2])){p.push(l[1])}return[o,p]};var k=function(s,r,q){var t,p=r.shift();if(typeof s!="object"){s=null}if(p===""){if(!s){s=[]}if(g(s,Array)){s.push(r.length==0?q:k(null,r.slice(0),q))}else{if(g(s,Object)){var n=0;while(s[n++]!=null){}s[--n]=r.length==0?q:k(s[n],r.slice(0),q)}else{s=[];s.push(r.length==0?q:k(null,r.slice(0),q))}}}else{if(p&&p.match(/^\s*[0-9]+\s*$/)){var m=parseInt(p,10);if(!s){s=[]}s[m]=r.length==0?q:k(s[m],r.slice(0),q)}else{if(p){var m=p.replace(/^\s*|\s*$/g,"");if(!s){s={}}if(g(s,Array)){var l={};for(var n=0;n<s.length;++n){l[n]=s[n]}s=l}s[m]=r.length==0?q:k(s[m],r.slice(0),q)}else{return q}}}return s};var j=function(l){var m=this;m.keys={};if(l.queryObject){jQuery.each(l.get(),function(n,o){m.SET(n,o)})}else{jQuery.each(arguments,function(){var n=""+this;n=n.replace(/^[?#]/,"");n=n.replace(/[;&]$/,"");if(c){n=n.replace(/[+]/g," ")}jQuery.each(n.split(/[&;]/),function(){var o=this.split("=")[0];var p=this.split("=")[1];if(!o){return}if(/^[+-]?[0-9]+\.[0-9]*$/.test(p)){p=parseFloat(p)}else{if(/^[+-]?[0-9]+$/.test(p)){p=parseInt(p,10)}}p=(!p&&p!==0)?true:p;if(p!==false&&p!==true&&typeof p!="number"){p=decodeURIComponent(p)}m.SET(o,p)})})}return m};j.prototype={queryObject:true,has:function(l,m){var n=this.get(l);return g(n,m)},GET:function(m){if(!g(m)){return this.keys}var l=h(m),n=l[0],p=l[1];var o=this.keys[n];while(o!=null&&p.length!=0){o=o[p.shift()]}return o||""},get:function(l){var m=this.GET(l);if(g(m,Object)){return jQuery.extend(true,{},m)}else{if(g(m,Array)){return m.slice(0)}}return m},SET:function(m,r){var o=!g(r)?null:r;var l=h(m),n=l[0],q=l[1];var p=this.keys[n];this.keys[n]=k(p,q.slice(0),o);return this},set:function(l,m){return this.copy().SET(l,m)},REMOVE:function(l){return this.SET(l,null).COMPACT()},remove:function(l){return this.copy().REMOVE(l)},EMPTY:function(){var l=this;jQuery.each(l.keys,function(m,n){delete l.keys[m]});return l},empty:function(){return this.copy().EMPTY()},copy:function(){return new j(this)},COMPACT:function(){function l(o){var n=typeof o=="object"?g(o,Array)?[]:{}:o;if(typeof o=="object"){function m(r,p,q){if(g(r,Array)){r.push(q)}else{r[p]=q}}jQuery.each(o,function(p,q){if(!g(q)){return true}m(n,p,l(q))})}return n}this.keys=l(this.keys);return this},compact:function(){return this.copy().COMPACT()},toString:function(){var n=0,q=[],p=[],m=this;var l=function(r,s,t){if(!g(t)||t===false){return}var u=[s];if(t!==true){u.push("=");u.push(encodeURIComponent(t))}r.push(u.join(""))};var o=function(s,r){var t=function(u){return !r||r==""?[u].join(""):[r,"[",u,"]"].join("")};jQuery.each(s,function(u,v){if(typeof v=="object"){o(v,t(u))}else{l(p,t(u),v)}})};o(this.keys);if(p.length>0){q.push(b)}q.push(p.join(d));return q.join("")}};return new j(location.search,location.hash)}}(jQuery.query||{});(function(d){function b(e){var j=d(window),g=j.width()+j.scrollLeft(),f=j.height()+j.scrollTop();return[e.offset().top<=j.scrollTop(),g<=e.offset().left+e.width(),f<=e.offset().top+e.height(),j.scrollLeft()>=e.offset().left]}function a(e){for(var f=e.length;f--;){if(e[f]){return false}}return true}var c=d.tools.tooltip;c.dynamic={conf:{classNames:"top right bottom left"}};d.fn.dynamic=function(e){if(typeof e=="number"){e={speed:e}}e=d.extend({},c.dynamic.conf,e);var g=e.classNames.split(/\s/),f;this.each(function(){var j=d(this).tooltip().onBeforeShow(function(l,k){l=this.getTip();var h=this.getConf();f||(f=[h.position[0],h.position[1],h.offset[0],h.offset[1],d.extend({},h)]);d.extend(h,f[4]);h.position=[f[0],f[1]];h.offset=[f[2],f[3]];l.css({visibility:"hidden",position:"absolute",top:k.top,left:k.left}).show();k=b(l);if(!a(k)){if(k[2]){d.extend(h,e.top);h.position[0]="top";l.addClass(g[0])}if(k[3]){d.extend(h,e.right);h.position[1]="right";l.addClass(g[1])}if(k[0]){d.extend(h,e.bottom);h.position[0]="bottom";l.addClass(g[2])}if(k[1]){d.extend(h,e.left);h.position[1]="left";l.addClass(g[3])}if(k[0]||k[2]){h.offset[0]*=-1}if(k[1]||k[3]){h.offset[1]*=-1}}l.css({visibility:"visible"}).hide()});j.onBeforeShow(function(){var h=this.getConf();this.getTip();setTimeout(function(){h.position=[f[0],f[1]];h.offset=[f[2],f[3]]},0)});j.onHide(function(){var h=this.getTip();h.removeClass(e.classNames)});ret=j});return e.api?ret:this}})(jQuery);
