/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2009 M. Alsup
 * Version: 2.56 (03-MAR-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.3 or later
 *
 * Originally based on the work of:
 *      1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/)
 *      2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
 *      3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
(function(g){var j="2.56";if(g.support==undefined){g.support={opacity:!(g.browser.msie)}}function d(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}g.fn.cycle=function(q,n){if(this.length==0&&q!="stop"){if(!g.isReady&&this.selector){d("DOM not ready, queuing slideshow");var r={s:this.selector,c:this.context};g(function(){g(r.s,r.c).cycle(q,n)});return this}d("terminating; zero elements found by selector"+(g.isReady?"":" (DOM not ready)"));return this}return this.each(function(){q=k(this,q,n);if(q===false){return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var t=g(this);var u=q.slideExpr?g(q.slideExpr,this):t.children();var o=u.get();if(o.length<2){d("terminating; too few slides: "+o.length);return}var s=i(t,u,o,q);if(s===false){return}if(s.timeout||s.continuous){this.cycleTimeout=setTimeout(function(){c(o,s,0,!s.rev)},s.continuous?10:s.timeout+(s.delay||0))}})};function k(n,r,o){if(n.cycleStop==undefined){n.cycleStop=0}if(r===undefined||r===null){r={}}if(r.constructor==String){switch(r){case"stop":n.cycleStop++;if(n.cycleTimeout){clearTimeout(n.cycleTimeout)}n.cycleTimeout=0;g(n).removeData("cycle.opts");return false;case"pause":n.cyclePause=1;return false;case"resume":n.cyclePause=0;if(o===true){r=g(n).data("cycle.opts");if(!r){d("options not found, can not resume");return}if(n.cycleTimeout){clearTimeout(n.cycleTimeout);n.cycleTimeout=0}c(r.elements,r,1,1)}return false;default:r={fx:r}}}else{if(r.constructor==Number){var q=r;r=g(n).data("cycle.opts");if(!r){d("options not found, can not advance slide");return false}if(q<0||q>=r.elements.length){d("invalid slide index: "+q);return false}r.nextSlide=q;if(n.cycleTimeout){clearTimeout(this.cycleTimeout);n.cycleTimeout=0}if(typeof o=="string"){r.oneTimeFx=o}c(r.elements,r,1,q>=r.currSlide);return false}}return r}function i(C,y,r,E){var n=g.extend({},g.fn.cycle.defaults,E||{},g.metadata?C.metadata():g.meta?C.data():{});if(n.autostop){n.countdown=n.autostopCount||r.length}var F=C[0];C.data("cycle.opts",n);n.$cont=C;n.stopCount=F.cycleStop;n.elements=r;n.before=n.before?[n.before]:[];n.after=n.after?[n.after]:[];n.after.unshift(function(){n.busy=0});if(!g.support.opacity&&n.cleartype){n.after.push(function(){this.style.removeAttribute("filter")})}if(n.continuous){n.after.push(function(){c(r,n,0,!n.rev)})}l(n);if(!g.support.opacity&&n.cleartype&&!n.cleartypeNoBg){e(y)}if(C.css("position")=="static"){C.css("position","relative")}if(n.width){C.width(n.width)}if(n.height&&n.height!="auto"){C.height(n.height)}if(n.startingSlide){n.startingSlide=parseInt(n.startingSlide)}if(n.random){n.randomMap=[];for(var t=0;t<r.length;t++){n.randomMap.push(t)}n.randomMap.sort(function(G,w){return Math.random()-0.5});n.randomIndex=0;n.startingSlide=n.randomMap[0]}else{if(n.startingSlide>=r.length){n.startingSlide=0}}n.currSlide=n.startingSlide=n.startingSlide||0;var v=n.startingSlide;y.css({position:"absolute",top:0,left:0}).hide().each(function(w){var G=v?w>=v?r.length-(w-v):v-w:r.length-w;g(this).css("z-index",G)});g(r[v]).css("opacity",1).show();if(!g.support.opacity&&n.cleartype){r[v].style.removeAttribute("filter")}if(n.fit&&n.width){y.width(n.width)}if(n.fit&&n.height&&n.height!="auto"){y.height(n.height)}var s=n.containerResize&&!C.innerHeight();if(s){var z=0,q=0;for(var t=0;t<r.length;t++){var o=g(r[t]),x=o[0],B=o.outerWidth(),u=o.outerHeight();if(!B){B=x.offsetWidth}if(!u){u=x.offsetHeight}z=B>z?B:z;q=u>q?u:q}if(z>0&&q>0){C.css({width:z+"px",height:q+"px"})}}if(n.pause){C.hover(function(){this.cyclePause++},function(){this.cyclePause--})}a(n);if(!n.multiFx){var D=g.fn.cycle.transitions[n.fx];if(g.isFunction(D)){D(C,y,n)}else{if(n.fx!="custom"&&!n.multiFx){d("unknown transition: "+n.fx,"; slideshow terminating");return false}}}y.each(function(){var w=g(this);this.cycleH=(n.fit&&n.height)?n.height:w.height();this.cycleW=(n.fit&&n.width)?n.width:w.width()});n.cssBefore=n.cssBefore||{};n.animIn=n.animIn||{};n.animOut=n.animOut||{};y.not(":eq("+v+")").css(n.cssBefore);if(n.cssFirst){g(y[v]).css(n.cssFirst)}if(n.timeout){n.timeout=parseInt(n.timeout);if(n.speed.constructor==String){n.speed=g.fx.speeds[n.speed]||parseInt(n.speed)}if(!n.sync){n.speed=n.speed/2}while((n.timeout-n.speed)<250){n.timeout+=n.speed}}if(n.easing){n.easeIn=n.easeOut=n.easing}if(!n.speedIn){n.speedIn=n.speed}if(!n.speedOut){n.speedOut=n.speed}n.slideCount=r.length;n.currSlide=n.lastSlide=v;if(n.random){n.nextSlide=n.currSlide;if(++n.randomIndex==r.length){n.randomIndex=0}n.nextSlide=n.randomMap[n.randomIndex]}else{n.nextSlide=n.startingSlide>=(r.length-1)?0:n.startingSlide+1}var A=y[v];if(n.before.length){n.before[0].apply(A,[A,A,n,true])}if(n.after.length>1){n.after[1].apply(A,[A,A,n,true])}if(n.next){g(n.next).click(function(){return m(n,n.rev?-1:1)})}if(n.prev){g(n.prev).click(function(){return m(n,n.rev?1:-1)})}if(n.pager){b(r,n)}h(n,r);return n}function l(n){n.original={before:[],after:[]};n.original.cssBefore=g.extend({},n.cssBefore);n.original.cssAfter=g.extend({},n.cssAfter);n.original.animIn=g.extend({},n.animIn);n.original.animOut=g.extend({},n.animOut);g.each(n.before,function(){n.original.before.push(this)});g.each(n.after,function(){n.original.after.push(this)})}function a(u){var q=g.fn.cycle.transitions;if(u.fx.indexOf(",")>0){u.multiFx=true;u.fxs=u.fx.replace(/\s*/g,"").split(",");for(var s=0;s<u.fxs.length;s++){var t=u.fxs[s];var o=q[t];if(!o||!q.hasOwnProperty(t)||!g.isFunction(o)){d("discarding unknowtn transition: ",t);u.fxs.splice(s,1);s--}}if(!u.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else{if(u.fx=="all"){u.multiFx=true;u.fxs=[];for(p in q){var o=q[p];if(q.hasOwnProperty(p)&&g.isFunction(o)){u.fxs.push(p)}}}}if(u.multiFx&&u.randomizeEffects){var r=Math.floor(Math.random()*20)+30;for(var s=0;s<r;s++){var n=Math.floor(Math.random()*u.fxs.length);u.fxs.push(u.fxs.splice(n,1)[0])}d("randomized fx sequence: ",u.fxs)}}function h(o,n){o.addSlide=function(r,t){var q=g(r),u=q[0];if(!o.autostopCount){o.countdown++}n[t?"unshift":"push"](u);if(o.els){o.els[t?"unshift":"push"](u)}o.slideCount=n.length;q.css("position","absolute");q[t?"prependTo":"appendTo"](o.$cont);if(t){o.currSlide++;o.nextSlide++}if(!g.support.opacity&&o.cleartype&&!o.cleartypeNoBg){e(q)}if(o.fit&&o.width){q.width(o.width)}if(o.fit&&o.height&&o.height!="auto"){$slides.height(o.height)}u.cycleH=(o.fit&&o.height)?o.height:q.height();u.cycleW=(o.fit&&o.width)?o.width:q.width();q.css(o.cssBefore);if(o.pager){g.fn.cycle.createPagerAnchor(n.length-1,u,g(o.pager),n,o)}if(g.isFunction(o.onAddSlide)){o.onAddSlide(q)}else{q.hide()}}}g.fn.cycle.resetState=function(o,n){var n=n||o.fx;o.before=[];o.after=[];o.cssBefore=g.extend({},o.original.cssBefore);o.cssAfter=g.extend({},o.original.cssAfter);o.animIn=g.extend({},o.original.animIn);o.animOut=g.extend({},o.original.animOut);o.fxFn=null;g.each(o.original.before,function(){o.before.push(this)});g.each(o.original.after,function(){o.after.push(this)});var q=g.fn.cycle.transitions[n];if(g.isFunction(q)){q(o.$cont,g(o.elements),o)}};function c(v,n,u,w){if(u&&n.busy){g(v).stop(true,true);n.busy=false}if(n.busy){return}var s=n.$cont[0],y=v[n.currSlide],x=v[n.nextSlide];if(s.cycleStop!=n.stopCount||s.cycleTimeout===0&&!u){return}if(!u&&!s.cyclePause&&((n.autostop&&(--n.countdown<=0))||(n.nowrap&&!n.random&&n.nextSlide<n.currSlide))){if(n.end){n.end(n)}return}if(u||!s.cyclePause){var t=n.fx;y.cycleH=y.cycleH||y.offsetHeight;y.cycleW=y.cycleW||y.offsetWidth;x.cycleH=x.cycleH||x.offsetHeight;x.cycleW=x.cycleW||x.offsetWidth;if(n.multiFx){if(n.lastFx==undefined||++n.lastFx>=n.fxs.length){n.lastFx=0}t=n.fxs[n.lastFx];n.currFx=t}if(n.oneTimeFx){t=n.oneTimeFx;n.oneTimeFx=null}g.fn.cycle.resetState(n,t);if(n.before.length){g.each(n.before,function(z,A){if(s.cycleStop!=n.stopCount){return}A.apply(x,[y,x,n,w])})}var q=function(){g.each(n.after,function(z,A){if(s.cycleStop!=n.stopCount){return}A.apply(x,[y,x,n,w])})};if(n.nextSlide!=n.currSlide){n.busy=1;if(n.fxFn){n.fxFn(y,x,n,q,w)}else{if(g.isFunction(g.fn.cycle[n.fx])){g.fn.cycle[n.fx](y,x,n,q)}else{g.fn.cycle.custom(y,x,n,q,u&&n.fastOnEvent)}}}n.lastSlide=n.currSlide;if(n.random){n.currSlide=n.nextSlide;if(++n.randomIndex==v.length){n.randomIndex=0}n.nextSlide=n.randomMap[n.randomIndex]}else{var r=(n.nextSlide+1)==v.length;n.nextSlide=r?0:n.nextSlide+1;n.currSlide=r?v.length-1:n.nextSlide-1}if(n.pager){g.fn.cycle.updateActivePagerLink(n.pager,n.currSlide)}}var o=0;if(n.timeout&&!n.continuous){o=f(y,x,n,w)}else{if(n.continuous&&s.cyclePause){o=10}}if(o>0){s.cycleTimeout=setTimeout(function(){c(v,n,0,!n.rev)},o)}}g.fn.cycle.updateActivePagerLink=function(n,o){g(n).find("a").removeClass("activeSlide").filter("a:eq("+o+")").addClass("activeSlide")};function f(s,q,r,o){if(r.timeoutFn){var n=r.timeoutFn(s,q,r,o);if(n!==false){return n}}return r.timeout}g.fn.cycle.next=function(n){m(n,n.rev?-1:1)};g.fn.cycle.prev=function(n){m(n,n.rev?1:-1)};function m(o,s){var n=o.elements;var r=o.$cont[0],q=r.cycleTimeout;if(q){clearTimeout(q);r.cycleTimeout=0}if(o.random&&s<0){o.randomIndex--;if(--o.randomIndex==-2){o.randomIndex=n.length-2}else{if(o.randomIndex==-1){o.randomIndex=n.length-1}}o.nextSlide=o.randomMap[o.randomIndex]}else{if(o.random){if(++o.randomIndex==n.length){o.randomIndex=0}o.nextSlide=o.randomMap[o.randomIndex]}else{o.nextSlide=o.currSlide+s;if(o.nextSlide<0){if(o.nowrap){return false}o.nextSlide=n.length-1}else{if(o.nextSlide>=n.length){if(o.nowrap){return false}o.nextSlide=0}}}}if(g.isFunction(o.prevNextClick)){o.prevNextClick(s>0,o.nextSlide,n[o.nextSlide])}c(n,o,1,s>=0);return false}function b(o,q){var n=g(q.pager);g.each(o,function(r,s){g.fn.cycle.createPagerAnchor(r,s,n,o,q)});g.fn.cycle.updateActivePagerLink(q.pager,q.startingSlide)}g.fn.cycle.createPagerAnchor=function(r,s,o,q,t){var n=(g.isFunction(t.pagerAnchorBuilder))?t.pagerAnchorBuilder(r,s):'<a href="#">'+(r+1)+"</a>";if(!n){return}var u=g(n);if(u.parents("body").length==0){u.appendTo(o)}u.bind(t.pagerEvent,function(){t.nextSlide=r;var w=t.$cont[0],v=w.cycleTimeout;if(v){clearTimeout(v);w.cycleTimeout=0}if(g.isFunction(t.pagerClick)){t.pagerClick(t.nextSlide,q[t.nextSlide])}c(q,t,1,t.currSlide<r);return false});if(t.pauseOnPagerHover){u.hover(function(){t.$cont[0].cyclePause++},function(){t.$cont[0].cyclePause--})}};g.fn.cycle.hopsFromLast=function(r,q){var o,n=r.lastSlide,s=r.currSlide;if(q){o=s>n?s-n:r.slideCount-n}else{o=s<n?n-s:n+r.slideCount-s}return o};function e(q){function o(r){var r=parseInt(r).toString(16);return r.length<2?"0"+r:r}function n(t){for(;t&&t.nodeName.toLowerCase()!="html";t=t.parentNode){var r=g.css(t,"background-color");if(r.indexOf("rgb")>=0){var s=r.match(/\d+/g);return"#"+o(s[0])+o(s[1])+o(s[2])}if(r&&r!="transparent"){return r}}return"#ffffff"}q.each(function(){g(this).css("background-color",n(this))})}g.fn.cycle.commonReset=function(t,r,s,o,q,n){g(s.elements).not(t).hide();s.cssBefore.opacity=1;s.cssBefore.display="block";if(o!==false&&r.cycleW>0){s.cssBefore.width=r.cycleW}if(q!==false&&r.cycleH>0){s.cssBefore.height=r.cycleH}s.cssAfter=s.cssAfter||{};s.cssAfter.display="none";g(t).css("zIndex",s.slideCount+(n===true?1:0));g(r).css("zIndex",s.slideCount+(n===true?0:1))};g.fn.cycle.custom=function(z,t,n,q,o){var y=g(z),u=g(t);var r=n.speedIn,x=n.speedOut,s=n.easeIn,w=n.easeOut;u.css(n.cssBefore);if(o){if(typeof o=="number"){r=x=o}else{r=x=1}s=w=null}var v=function(){u.animate(n.animIn,r,s,q)};y.animate(n.animOut,x,w,function(){if(n.cssAfter){y.css(n.cssAfter)}if(!n.sync){v()}});if(n.sync){v()}};g.fn.cycle.transitions={fade:function(o,q,n){q.not(":eq("+n.currSlide+")").css("opacity",0);n.before.push(function(t,r,s){g.fn.cycle.commonReset(t,r,s);s.cssBefore.opacity=0});n.animIn={opacity:1};n.animOut={opacity:0};n.cssBefore={top:0,left:0}}};g.fn.cycle.ver=function(){return j};g.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!g.support.opacity,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0}})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version:      2.52
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.scrollUp=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssBefore={top:b,left:0};c.cssFirst={top:0};c.animIn={top:0};c.animOut={top:-b}};a.fn.cycle.transitions.scrollDown=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssFirst={top:0};c.cssBefore={top:-b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.scrollLeft=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:0-b}};a.fn.cycle.transitions.scrollRight=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:-b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.scrollHorz=function(c,d,b){c.css("overflow","hidden").width();b.before.push(function(h,f,g,e){a.fn.cycle.commonReset(h,f,g);g.cssBefore.left=e?(f.cycleW-1):(1-f.cycleW);g.animOut.left=e?-h.cycleW:h.cycleW});b.cssFirst={left:0};b.cssBefore={top:0};b.animIn={left:0};b.animOut={top:0}};a.fn.cycle.transitions.scrollVert=function(c,d,b){c.css("overflow","hidden");b.before.push(function(h,f,g,e){a.fn.cycle.commonReset(h,f,g);g.cssBefore.top=e?(1-f.cycleH):(f.cycleH-1);g.animOut.top=e?h.cycleH:-h.cycleH});b.cssFirst={top:0};b.cssBefore={left:0};b.animIn={top:0};b.animOut={left:0}};a.fn.cycle.transitions.slideX=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW});b.cssBefore={left:0,top:0,width:0};b.animIn={width:"show"};b.animOut={width:0}};a.fn.cycle.transitions.slideY=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH});b.cssBefore={left:0,top:0,height:0};b.animIn={height:"show"};b.animOut={height:0}};a.fn.cycle.transitions.shuffle=function(e,f,d){var b=e.css("overflow","visible").width();f.css({left:0,top:0});d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true)});d.speed=d.speed/2;d.random=0;d.shuffle=d.shuffle||{left:-b,top:15};d.els=[];for(var c=0;c<f.length;c++){d.els.push(f[c])}for(var c=0;c<d.currSlide;c++){d.els.push(d.els.shift())}d.fxFn=function(m,j,l,g,i){var h=i?a(m):a(j);a(j).css(l.cssBefore);var k=l.slideCount;h.animate(l.shuffle,l.speedIn,l.easeIn,function(){var o=a.fn.cycle.hopsFromLast(l,i);for(var q=0;q<o;q++){i?l.els.push(l.els.shift()):l.els.unshift(l.els.pop())}if(i){for(var r=0,n=l.els.length;r<n;r++){a(l.els[r]).css("z-index",n-r+k)}}else{var s=a(m).css("z-index");h.css("z-index",parseInt(s)+1+k)}h.animate({left:0,top:0},l.speedOut,l.easeOut,function(){a(i?this:m).hide();if(g){g()}})})};d.cssBefore={display:"block",opacity:1,top:0,left:0}};a.fn.cycle.transitions.turnUp=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=e.cycleH;f.animIn.height=e.cycleH});b.cssFirst={top:0};b.cssBefore={left:0,height:0};b.animIn={top:0};b.animOut={height:0}};a.fn.cycle.transitions.turnDown=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH;f.animOut.top=g.cycleH});b.cssFirst={top:0};b.cssBefore={left:0,top:0,height:0};b.animOut={height:0}};a.fn.cycle.transitions.turnLeft=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=e.cycleW;f.animIn.width=e.cycleW});b.cssBefore={top:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.turnRight=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW;f.animOut.left=g.cycleW});b.cssBefore={top:0,left:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.zoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false,true);f.cssBefore.top=e.cycleH/2;f.cssBefore.left=e.cycleW/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH};f.animOut={width:0,height:0,top:g.cycleH/2,left:g.cycleW/2}});b.cssFirst={top:0,left:0};b.cssBefore={width:0,height:0}};a.fn.cycle.transitions.fadeZoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false);f.cssBefore.left=e.cycleW/2;f.cssBefore.top=e.cycleH/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH}});b.cssBefore={width:0,height:0};b.animOut={opacity:0}};a.fn.cycle.transitions.blindX=function(d,e,c){var b=d.css("overflow","hidden").width();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.width=f.cycleW;g.animOut.left=h.cycleW});c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.blindY=function(d,e,c){var b=d.css("overflow","hidden").height();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.height=f.cycleH;g.animOut.top=h.cycleH});c.cssBefore={top:b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.blindZ=function(e,f,d){var c=e.css("overflow","hidden").height();var b=e.width();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h);h.animIn.height=g.cycleH;h.animOut.top=i.cycleH});d.cssBefore={top:c,left:b};d.animIn={top:0,left:0};d.animOut={top:c,left:b}};a.fn.cycle.transitions.growX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=this.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:0}});b.cssBefore={width:0,top:0}};a.fn.cycle.transitions.growY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=this.cycleH/2;f.animIn={top:0,height:this.cycleH};f.animOut={top:0}});b.cssBefore={height:0,left:0}};a.fn.cycle.transitions.curtainX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true,true);f.cssBefore.left=e.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:g.cycleW/2,width:0}});b.cssBefore={top:0,width:0}};a.fn.cycle.transitions.curtainY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false,true);f.cssBefore.top=e.cycleH/2;f.animIn={top:0,height:e.cycleH};f.animOut={top:g.cycleH/2,height:0}});b.cssBefore={left:0,height:0}};a.fn.cycle.transitions.cover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h);if(i=="right"){h.cssBefore.left=-b}else{if(i=="up"){h.cssBefore.top=c}else{if(i=="down"){h.cssBefore.top=-c}else{h.cssBefore.left=b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.uncover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h,true,true,true);if(i=="right"){h.animOut.left=b}else{if(i=="up"){h.animOut.top=-c}else{if(i=="down"){h.animOut.top=c}else{h.animOut.left=-b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.toss=function(e,f,d){var b=e.css("overflow","visible").width();var c=e.height();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true);if(!h.animOut.left&&!h.animOut.top){h.animOut={left:b*2,top:-c/2,opacity:0}}else{h.animOut.opacity=0}});d.cssBefore={left:0,top:0};d.animIn={left:0}};a.fn.cycle.transitions.wipe=function(o,k,e){var n=o.css("overflow","hidden").width();var i=o.height();e.cssBefore=e.cssBefore||{};var f;if(e.clip){if(/l2r/.test(e.clip)){f="rect(0px 0px "+i+"px 0px)"}else{if(/r2l/.test(e.clip)){f="rect(0px "+n+"px "+i+"px "+n+"px)"}else{if(/t2b/.test(e.clip)){f="rect(0px "+n+"px 0px 0px)"}else{if(/b2t/.test(e.clip)){f="rect("+i+"px "+n+"px "+i+"px 0px)"}else{if(/zoom/.test(e.clip)){var q=parseInt(i/2);var g=parseInt(n/2);f="rect("+q+"px "+g+"px "+q+"px "+g+"px)"}}}}}}e.cssBefore.clip=e.cssBefore.clip||f||"rect(0px 0px 0px 0px)";var j=e.cssBefore.clip.match(/(\d+)/g);var q=parseInt(j[0]),c=parseInt(j[1]),m=parseInt(j[2]),g=parseInt(j[3]);e.before.push(function(u,h,s){if(u==h){return}var d=a(u),b=a(h);a.fn.cycle.commonReset(u,h,s,true,true,false);s.cssAfter.display="block";var r=1,l=parseInt((s.speedIn/13))-1;(function t(){var w=q?q-parseInt(r*(q/l)):0;var x=g?g-parseInt(r*(g/l)):0;var y=m<i?m+parseInt(r*((i-m)/l||1)):i;var v=c<n?c+parseInt(r*((n-c)/l||1)):n;b.css({clip:"rect("+w+"px "+v+"px "+y+"px "+x+"px)"});(r++<=l)?setTimeout(t,13):d.css("display","none")})()});e.cssBefore={display:"block",opacity:1,top:0,left:0};e.animIn={left:0};e.animOut={left:0}}})(jQuery);var stepcarousel={ajaxloadingmsg:'<div style="margin: 1em; font-weight: bold"><img alt="" src="ajaxloadr.gif" style="vertical-align: middle" /> Fetching Content. Please wait...</div>',defaultbuttonsfade:0.4,configholder:{},getCSSValue:function(a){return(a=="auto")?0:parseInt(a)},getremotepanels:function(b,a){a.$belt.html(this.ajaxloadingmsg);b.ajax({url:a.contenttype[1],async:true,error:function(c){a.$belt.html("Error fetching content.<br />Server Response: "+c.responseText)},success:function(c){a.$belt.html(c);a.$panels=a.$gallery.find("."+a.panelclass);stepcarousel.alignpanels(b,a)}})},getoffset:function(b,a){return(b.offsetParent)?b[a]+this.getoffset(b.offsetParent,a):b[a]},getCookie:function(a){var b=new RegExp(a+"=[^;]+","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return null},setCookie:function(a,b){document.cookie=a+"="+b},fadebuttons:function(a,b){a.$leftnavbutton.fadeTo("fast",b==0?this.defaultbuttonsfade:1);a.$rightnavbutton.fadeTo("fast",b==a.lastvisiblepanel?this.defaultbuttonsfade:1)},addnavbuttons:function(a,b){a.$leftnavbutton=$('<img alt="" src="'+a.defaultbuttons.leftnav[0]+'">').css({zIndex:50,position:"absolute",left:a.offsets.left+a.defaultbuttons.leftnav[1]+"px",top:a.offsets.top+a.defaultbuttons.leftnav[2]+"px",cursor:"hand",cursor:"pointer"}).attr({title:"Back "+a.defaultbuttons.moveby+" panels"}).appendTo("body");a.$rightnavbutton=$('<img alt="" src="'+a.defaultbuttons.rightnav[0]+'">').css({zIndex:50,position:"absolute",left:a.offsets.left+a.$gallery.get(0).offsetWidth+a.defaultbuttons.rightnav[1]+"px",top:a.offsets.top+a.defaultbuttons.rightnav[2]+"px",cursor:"hand",cursor:"pointer"}).attr({title:"Forward "+a.defaultbuttons.moveby+" panels"}).appendTo("body");a.$leftnavbutton.bind("click",function(){stepcarousel.stepBy(a.galleryid,-a.defaultbuttons.moveby)});a.$rightnavbutton.bind("click",function(){stepcarousel.stepBy(a.galleryid,a.defaultbuttons.moveby)});if(a.panelbehavior.wraparound==false){this.fadebuttons(a,b)}return a.$leftnavbutton.add(a.$rightnavbutton)},stopautostep:function(a){clearTimeout(a.steptimer);clearTimeout(a.resumeautostep)},alignpanels:function(c,a){var g=0;a.paneloffsets=[g];a.panelwidths=[];a.$panels.each(function(i){var k=c(this);k.css({"float":"none",position:"absolute",left:g+"px"});k.bind("click",function(l){return a.onpanelclick(l.target)});g+=stepcarousel.getCSSValue(k.css("marginRight"))+parseInt(k.get(0).offsetWidth||k.css("width"));a.paneloffsets.push(g);a.panelwidths.push(g-a.paneloffsets[a.paneloffsets.length-2])});a.paneloffsets.pop();var e=0;var h=a.$panels.length-1;a.lastvisiblepanel=h;for(var d=a.$panels.length-1;d>=0;d--){e+=(d==h?a.panelwidths[h]:a.paneloffsets[d+1]-a.paneloffsets[d]);if(a.gallerywidth>e){a.lastvisiblepanel=d}}a.$belt.css({width:g+"px"});a.currentpanel=(a.panelbehavior.persist)?parseInt(this.getCookie(window[a.galleryid+"persist"])):0;a.currentpanel=(typeof a.currentpanel=="number"&&a.currentpanel<a.$panels.length)?a.currentpanel:0;if(a.currentpanel!=0){var j=a.paneloffsets[a.currentpanel]+(a.currentpanel==0?0:a.beltoffset);a.$belt.css({left:-j+"px"})}if(a.defaultbuttons.enable==true){var b=this.addnavbuttons(a,a.currentpanel);c(window).bind("load resize",function(){a.offsets={left:stepcarousel.getoffset(a.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(a.$gallery.get(0),"offsetTop")};a.$leftnavbutton.css({left:a.offsets.left+a.defaultbuttons.leftnav[1]+"px",top:a.offsets.top+a.defaultbuttons.leftnav[2]+"px"});a.$rightnavbutton.css({left:a.offsets.left+a.$gallery.get(0).offsetWidth+a.defaultbuttons.rightnav[1]+"px",top:a.offsets.top+a.defaultbuttons.rightnav[2]+"px"})})}if(a.autostep&&a.autostep.enable){var f=a.$gallery.add(typeof b!="undefined"?b:null);f.bind("click",function(){stepcarousel.stopautostep(a);a.autostep.status="stopped"});f.hover(function(){stepcarousel.stopautostep(a);a.autostep.hoverstate="over"},function(){if(a.steptimer&&a.autostep.hoverstate=="over"&&a.autostep.status!="stopped"){a.resumeautostep=setTimeout(function(){stepcarousel.autorotate(a.galleryid);a.autostep.hoverstate="out"},500)}});a.steptimer=setTimeout(function(){stepcarousel.autorotate(a.galleryid)},a.autostep.pause)}this.statusreport(a.galleryid);a.oninit();a.onslideaction(this)},stepTo:function(c,b){var a=stepcarousel.configholder[c];if(typeof a=="undefined"){alert("There's an error with your set up of Carousel Viewer \""+c+'"!');return}stepcarousel.stopautostep(a);var b=Math.min(b-1,a.paneloffsets.length-1);var d=a.paneloffsets[b]+(b==0?0:a.beltoffset);if(a.panelbehavior.wraparound==false&&a.defaultbuttons.enable==true){this.fadebuttons(a,b)}a.$belt.animate({left:-d+"px"},a.panelbehavior.speed,function(){a.onslideaction(this)});a.currentpanel=b;this.statusreport(c)},stepBy:function(d,a){var c=stepcarousel.configholder[d];if(typeof c=="undefined"){alert("There's an error with your set up of Carousel Viewer \""+d+'"!');return}stepcarousel.stopautostep(c);var e=(a>0)?"forward":"back";var b=c.currentpanel+a;if(c.panelbehavior.wraparound==false){b=(e=="back"&&b<=0)?0:(e=="forward")?Math.min(b,c.lastvisiblepanel):b;if(c.defaultbuttons.enable==true){stepcarousel.fadebuttons(c,b)}}else{if(b>c.lastvisiblepanel&&e=="forward"){b=(c.currentpanel<c.lastvisiblepanel)?c.lastvisiblepanel:0}else{if(b<0&&e=="back"){b=(c.currentpanel>0)?0:c.lastvisiblepanel}}}var f=c.paneloffsets[b]+(b==0?0:c.beltoffset);if(b==0&&e=="forward"||c.currentpanel==0&&e=="back"&&c.panelbehavior.wraparound==true){c.$belt.animate({left:-c.paneloffsets[c.currentpanel]-(e=="forward"?100:-30)+"px"},"normal",function(){c.$belt.animate({left:-f+"px"},c.panelbehavior.speed,function(){c.onslideaction(this)})})}else{c.$belt.animate({left:-f+"px"},c.panelbehavior.speed,function(){c.onslideaction(this)})}c.currentpanel=b;this.statusreport(d)},autorotate:function(b){var a=stepcarousel.configholder[b];if(a.$gallery.attr("_ismouseover")!="yes"){this.stepBy(b,a.autostep.moveby)}a.steptimer=setTimeout(function(){stepcarousel.autorotate(b)},a.autostep.pause)},statusreport:function(d){var b=stepcarousel.configholder[d];var a=b.currentpanel;var e=0;for(var f=a;f<b.paneloffsets.length;f++){e+=b.panelwidths[f];if(e>b.gallerywidth){break}}a+=1;f=(f+1==a)?a:f;var g=[a,f,b.panelwidths.length];for(var c=0;c<b.statusvars.length;c++){window[b.statusvars[c]]=g[c];b.$statusobjs[c].text(g[c]+" ")}},setup:function(a){document.write('<style type="text/css">\n#'+a.galleryid+"{overflow: hidden;}\n</style>");jQuery(document).ready(function(b){a.$gallery=b("#"+a.galleryid);a.gallerywidth=a.$gallery.width();a.offsets={left:stepcarousel.getoffset(a.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(a.$gallery.get(0),"offsetTop")};a.$belt=a.$gallery.find("."+a.beltclass);a.$panels=a.$gallery.find("."+a.panelclass);a.panelbehavior.wraparound=(a.autostep&&a.autostep.enable)?true:a.panelbehavior.wraparound;a.onpanelclick=(typeof a.onpanelclick=="undefined")?function(c){}:a.onpanelclick;a.onslideaction=(typeof a.onslide=="undefined")?function(){}:function(c){b(c).stop();a.onslide()};a.oninit=(typeof a.oninit=="undefined")?function(){}:a.oninit;a.beltoffset=stepcarousel.getCSSValue(a.$belt.css("marginLeft"));a.statusvars=a.statusvars||[];a.$statusobjs=[b("#"+a.statusvars[0]),b("#"+a.statusvars[1]),b("#"+a.statusvars[2])];a.currentpanel=0;stepcarousel.configholder[a.galleryid]=a;if(a.contenttype[0]=="ajax"&&typeof a.contenttype[1]!="undefined"){stepcarousel.getremotepanels(b,a)}else{stepcarousel.alignpanels(b,a)}});jQuery(window).bind("unload",function(){if(a.panelbehavior.persist){stepcarousel.setCookie(window[a.galleryid+"persist"],a.currentpanel)}jQuery.each(a,function(b,c){c=null});a=null})}};jQuery.fn.boxy=function(a){a=a||{};return this.each(function(){var c=this.nodeName.toLowerCase(),b=this;if(c=="a"){jQuery(this).click(function(){var h=Boxy.linkedTo(this),e=this.getAttribute("href"),g=jQuery.extend({actuator:this,title:this.title},a);if(h){h.show()}else{if(e.indexOf("#")>=0){var f=jQuery(e.substr(e.indexOf("#"))),d=f.clone(true);f.remove();g.unloadOnHide=false;new Boxy(d,g)}else{if(!g.cache){g.unloadOnHide=true}Boxy.load(this.href,g)}}return false})}else{if(c=="form"){jQuery(this).bind("submit.boxy",function(){Boxy.confirm(a.message||"Please confirm:",function(){jQuery(b).unbind("submit.boxy").submit()});return false})}}})};function Boxy(b,a){this.boxy=jQuery(Boxy.WRAPPER);jQuery.data(this.boxy[0],"boxy",this);this.visible=false;this.options=jQuery.extend({},Boxy.DEFAULTS,a||{});if(this.options.modal){this.options=jQuery.extend(this.options,{center:true,draggable:false})}if(this.options.actuator){jQuery.data(this.options.actuator,"active.boxy",this)}this.setContent(b||"<div></div>");this._setupTitleBar();this.boxy.css("display","none").appendTo(document.body);this.toTop();if(this.options.fixed){if(jQuery.browser.msie&&jQuery.browser.version<7){this.options.fixed=false}else{this.boxy.addClass("fixed")}}if(this.options.center&&Boxy._u(this.options.x,this.options.y)){this.center()}else{this.moveTo(Boxy._u(this.options.x)?this.options.x:Boxy.DEFAULT_X,Boxy._u(this.options.y)?this.options.y:Boxy.DEFAULT_Y)}if(this.options.show){this.show()}}Boxy.EF=function(){};jQuery.extend(Boxy,{WRAPPER:"<table cellspacing='0' cellpadding='0' border='0' class='boxy-wrapper'><tr><td class='top-left'></td><td class='top'></td><td class='top-right'></td></tr><tr><td class='left'></td><td class='boxy-inner'></td><td class='right'></td></tr><tr><td class='bottom-left'></td><td class='bottom'></td><td class='bottom-right'></td></tr></table>",DEFAULTS:{title:null,closeable:true,draggable:true,clone:false,actuator:null,center:true,show:true,modal:false,fixed:true,closeText:"[close]",unloadOnHide:false,clickToFront:false,behaviours:Boxy.EF,afterDrop:Boxy.EF,afterShow:Boxy.EF,afterHide:Boxy.EF,beforeUnload:Boxy.EF},DEFAULT_X:50,DEFAULT_Y:50,zIndex:1337,dragConfigured:false,resizeConfigured:false,dragging:null,load:function(b,a){a=a||{};var c={url:b,type:"GET",dataType:"html",cache:false,success:function(d){d=jQuery(d);if(a.filter){d=jQuery(a.filter,d)}new Boxy(d,a)}};jQuery.each(["type","cache"],function(){if(this in a){c[this]=a[this];delete a[this]}});jQuery.ajax(c)},get:function(a){var b=jQuery(a).parents(".boxy-wrapper");return b.length?jQuery.data(b[0],"boxy"):null},linkedTo:function(a){return jQuery.data(a,"active.boxy")},alert:function(b,c,a){return Boxy.ask(b,["OK"],c,a)},confirm:function(b,c,a){return Boxy.ask(b,["OK","Cancel"],function(d){if(d=="OK"){c()}},a)},ask:function(c,f,j,l){l=jQuery.extend({modal:true,closeable:false},l||{},{show:true,unloadOnHide:true});var e=jQuery("<div></div>").append(jQuery('<div class="question"></div>').html(c));var a={},h=[];if(f instanceof Array){for(var d=0;d<f.length;d++){a[f[d]]=f[d];h.push(f[d])}}else{for(var b in f){a[f[b]]=b;h.push(f[b])}}var g=jQuery('<form class="answers"></form>');g.html(jQuery.map(h,function(i){return"<input type='button' value='"+i+"' />"}).join(" "));jQuery("input[type=button]",g).click(function(){var i=this;Boxy.get(this).hide(function(){if(j){j(a[i.value])}})});e.append(g);new Boxy(e,l)},isModalVisible:function(){return jQuery(".boxy-modal-blackout").length>0},_u:function(){for(var a=0;a<arguments.length;a++){if(typeof arguments[a]!="undefined"){return false}}return true},_handleResize:function(a){var b=jQuery(document);jQuery(".boxy-modal-blackout").css("display","none").css({width:b.width(),height:b.height()}).css("display","block")},_handleDrag:function(a){var b;if(b=Boxy.dragging){b[0].boxy.css({left:a.pageX-b[1],top:a.pageY-b[2]})}},_nextZ:function(){return Boxy.zIndex++},_viewport:function(){var e=document.documentElement,a=document.body,c=window;return jQuery.extend(jQuery.browser.msie?{left:a.scrollLeft||e.scrollLeft,top:a.scrollTop||e.scrollTop}:{left:c.pageXOffset,top:c.pageYOffset},!Boxy._u(c.innerWidth)?{width:c.innerWidth,height:c.innerHeight}:(!Boxy._u(e)&&!Boxy._u(e.clientWidth)&&e.clientWidth!=0?{width:e.clientWidth,height:e.clientHeight}:{width:a.clientWidth,height:a.clientHeight}))}});Boxy.prototype={estimateSize:function(){this.boxy.css({visibility:"hidden",display:"block"});var a=this.getSize();this.boxy.css("display","none").css("visibility","visible");return a},getSize:function(){return[this.boxy.width(),this.boxy.height()]},getContentSize:function(){var a=this.getContent();return[a.width(),a.height()]},getPosition:function(){var a=this.boxy[0];return[a.offsetLeft,a.offsetTop]},getCenter:function(){var b=this.getPosition();var a=this.getSize();return[Math.floor(b[0]+a[0]/2),Math.floor(b[1]+a[1]/2)]},getInner:function(){return jQuery(".boxy-inner",this.boxy)},getContent:function(){return jQuery(".boxy-content",this.boxy)},setContent:function(a){a=jQuery(a).css({display:"block"}).addClass("boxy-content");if(this.options.clone){a=a.clone(true)}this.getContent().remove();this.getInner().append(a);this._setupDefaultBehaviours(a);this.options.behaviours.call(this,a);return this},moveTo:function(a,b){this.moveToX(a).moveToY(b);return this},moveToX:function(a){if(typeof a=="number"){this.boxy.css({left:a})}else{this.centerX()}return this},moveToY:function(a){if(typeof a=="number"){this.boxy.css({top:a})}else{this.centerY()}return this},centerAt:function(a,c){var b=this[this.visible?"getSize":"estimateSize"]();if(typeof a=="number"){this.moveToX(a-b[0]/2)}if(typeof c=="number"){this.moveToY(c-b[1]/2)}return this},centerAtX:function(a){return this.centerAt(a,null)},centerAtY:function(a){return this.centerAt(null,a)},center:function(b){var a=Boxy._viewport();var c=this.options.fixed?[0,0]:[a.left,a.top];if(!b||b=="x"){this.centerAt(c[0]+a.width/2,null)}if(!b||b=="y"){this.centerAt(null,c[1]+a.height/2)}return this},centerX:function(){return this.center("x")},centerY:function(){return this.center("y")},resize:function(b,a,d){if(!this.visible){return}var c=this._getBoundsForResize(b,a);this.boxy.css({left:c[0],top:c[1]});this.getContent().css({width:c[2],height:c[3]});if(d){d(this)}return this},tween:function(c,a,e){if(!this.visible){return}var d=this._getBoundsForResize(c,a);var b=this;this.boxy.stop().animate({left:d[0],top:d[1]});this.getContent().stop().animate({width:d[2],height:d[3]},function(){if(e){e(b)}});return this},isVisible:function(){return this.visible},show:function(){if(this.visible){return}if(this.options.modal){var a=this;if(!Boxy.resizeConfigured){Boxy.resizeConfigured=true;jQuery(window).resize(function(){Boxy._handleResize()})}this.modalBlackout=jQuery('<div class="boxy-modal-blackout"></div>').css({zIndex:Boxy._nextZ(),opacity:0.7,width:jQuery(document).width(),height:jQuery(document).height()}).appendTo(document.body);this.toTop();if(this.options.closeable){jQuery(document.body).bind("keypress.boxy",function(b){var c=b.which||b.keyCode;if(c==27){a.hide();jQuery(document.body).unbind("keypress.boxy")}})}}this.boxy.stop().css({opacity:1}).show();this.visible=true;this._fire("afterShow");return this},hide:function(b){if(!this.visible){return}var a=this;if(this.options.modal){jQuery(document.body).unbind("keypress.boxy");this.modalBlackout.animate({opacity:0},function(){jQuery(this).remove()})}this.boxy.stop().animate({opacity:0},300,function(){a.boxy.css({display:"none"});a.visible=false;a._fire("afterHide");if(b){b(a)}if(a.options.unloadOnHide){a.unload()}});return this},toggle:function(){this[this.visible?"hide":"show"]();return this},hideAndUnload:function(a){this.options.unloadOnHide=true;this.hide(a);return this},unload:function(){this._fire("beforeUnload");this.boxy.remove();if(this.options.actuator){jQuery.data(this.options.actuator,"active.boxy",false)}},toTop:function(){this.boxy.css({zIndex:Boxy._nextZ()});return this},getTitle:function(){return jQuery("> .title-bar h2",this.getInner()).html()},setTitle:function(a){jQuery("> .title-bar h2",this.getInner()).html(a);return this},_getBoundsForResize:function(c,a){var b=this.getContentSize();var e=[c-b[0],a-b[1]];var d=this.getPosition();return[Math.max(d[0]-e[0]/2,0),Math.max(d[1]-e[1]/2,0),c,a]},_setupTitleBar:function(){if(this.options.title){var b=this;var a=jQuery("<div class='title-bar'></div>").html("<h2>"+this.options.title+"</h2>");if(this.options.closeable){a.append(jQuery("<a href='#' class='close'></a>").html(this.options.closeText))}if(this.options.draggable){a[0].onselectstart=function(){return false};a[0].unselectable="on";a[0].style.MozUserSelect="none";if(!Boxy.dragConfigured){jQuery(document).mousemove(Boxy._handleDrag);Boxy.dragConfigured=true}a.mousedown(function(c){b.toTop();Boxy.dragging=[b,c.pageX-b.boxy[0].offsetLeft,c.pageY-b.boxy[0].offsetTop];jQuery(this).addClass("dragging")}).mouseup(function(){jQuery(this).removeClass("dragging");Boxy.dragging=null;b._fire("afterDrop")})}this.getInner().prepend(a);this._setupDefaultBehaviours(a)}},_setupDefaultBehaviours:function(a){var b=this;if(this.options.clickToFront){a.click(function(){b.toTop()})}jQuery(".close",a).click(function(){b.hide();return false}).mousedown(function(c){c.stopPropagation()})},_fire:function(a){this.options[a].call(this)}};
