/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/
jQuery.easing.jswing=jQuery.easing.swing; jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a+c;return-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){if((a/=d/2)<1)return b/ 2*a*a*a+c;return b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a+c;return-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a*a+c;return b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e, a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return a==0?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){if(a==0)return c;if(a==d)return c+b;if((a/=d/2)<1)return b/2*Math.pow(2,10*(a-1))+c;return b/2*(-Math.pow(2,-10*--a)+2)+c}, easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){if((a/=d/2)<1)return-b/2*(Math.sqrt(1-a*a)-1)+c;return b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e, a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d/2)==2)return c+b;f||(f=d*0.3*1.5);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);if(a<1)return-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c;return g*Math.pow(2,-10*(a-=1))*Math.sin((a* d-e)*2*Math.PI/f)*0.5+b+c},easeInBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;if((a/=d/2)<1)return b/2*a*a*(((f*=1.525)+1)*a-f)+c;return b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/= d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){if(a<d/2)return jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c;return jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c}});


/*!
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.86 (05-APR-2010)
 * 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.6 or later
 */
(function(d){function h(a){d.fn.cycle.debug&&n(a)}function n(){window.console&&window.console.log&&window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function e(a,b,f){function j(c,o,m){if(!c&&o===true){c=d(m).data("cycle.opts");if(!c){n("options not found, can not resume");return false}if(m.cycleTimeout){clearTimeout(m.cycleTimeout);m.cycleTimeout=0}v(c.elements,c,1,1)}}if(a.cycleStop==undefined)a.cycleStop=0;if(b===undefined||b===null)b={};if(b.constructor==String){switch(b){case "destroy":case "stop":f= d(a).data("cycle.opts");if(!f)return false;a.cycleStop++;a.cycleTimeout&&clearTimeout(a.cycleTimeout);a.cycleTimeout=0;d(a).removeData("cycle.opts");b=="destroy"&&i(f);return false;case "toggle":a.cyclePause=a.cyclePause===1?0:1;j(a.cyclePause,f,a);return false;case "pause":a.cyclePause=1;return false;case "resume":a.cyclePause=0;j(false,f,a);return false;case "prev":case "next":f=d(a).data("cycle.opts");if(!f){n('options not found, "prev/next" ignored');return false}d.fn.cycle[b](f);return false; default:b={fx:b}}return b}else if(b.constructor==Number){var l=b;b=d(a).data("cycle.opts");if(!b){n("options not found, can not advance slide");return false}if(l<0||l>=b.elements.length){n("invalid slide index: "+l);return false}b.nextSlide=l;if(a.cycleTimeout){clearTimeout(a.cycleTimeout);a.cycleTimeout=0}if(typeof f=="string")b.oneTimeFx=f;v(b.elements,b,1,l>=b.currSlide);return false}return b}function k(a,b){if(!d.support.opacity&&b.cleartype&&a.style.filter)try{a.style.removeAttribute("filter")}catch(f){}} function i(a){a.next&&d(a.next).unbind(a.prevNextEvent);a.prev&&d(a.prev).unbind(a.prevNextEvent);if(a.pager||a.pagerAnchorBuilder)d.each(a.pagerAnchors||[],function(){this.unbind().remove()});a.pagerAnchors=null;a.destroy&&a.destroy(a)}function g(a,b,f,j,l){var c=d.extend({},d.fn.cycle.defaults,j||{},d.metadata?a.metadata():d.meta?a.data():{});if(c.autostop)c.countdown=c.autostopCount||f.length;var o=a[0];a.data("cycle.opts",c);c.$cont=a;c.stopCount=o.cycleStop;c.elements=f;c.before=c.before?[c.before]: [];c.after=c.after?[c.after]:[];c.after.unshift(function(){c.busy=0});!d.support.opacity&&c.cleartype&&c.after.push(function(){k(this,c)});c.continuous&&c.after.push(function(){v(f,c,0,!c.rev)});q(c);!d.support.opacity&&c.cleartype&&!c.cleartypeNoBg&&B(b);a.css("position")=="static"&&a.css("position","relative");c.width&&a.width(c.width);c.height&&c.height!="auto"&&a.height(c.height);if(c.startingSlide)c.startingSlide=parseInt(c.startingSlide);if(c.random){c.randomMap=[];for(o=0;o<f.length;o++)c.randomMap.push(o); c.randomMap.sort(function(){return Math.random()-0.5});c.randomIndex=1;c.startingSlide=c.randomMap[1]}else if(c.startingSlide>=f.length)c.startingSlide=0;c.currSlide=c.startingSlide||0;var m=c.startingSlide;b.css({position:"absolute",top:0,left:0}).hide().each(function(w){w=m?w>=m?f.length-(w-m):m-w:f.length-w;d(this).css("z-index",w)});d(f[m]).css("opacity",1).show();k(f[m],c);c.fit&&c.width&&b.width(c.width);c.fit&&c.height&&c.height!="auto"&&b.height(c.height);if(c.containerResize&&!a.innerHeight()){for(var t= o=0,z=0;z<f.length;z++){var y=d(f[z]),C=y[0],D=y.outerWidth(),E=y.outerHeight();D||(D=C.offsetWidth||C.width||y.attr("width"));E||(E=C.offsetHeight||C.height||y.attr("height"));o=D>o?D:o;t=E>t?E:t}o>0&&t>0&&a.css({width:o+"px",height:t+"px"})}c.pause&&a.hover(function(){this.cyclePause++},function(){this.cyclePause--});if(r(c)===false)return false;var F=false;j.requeueAttempts=j.requeueAttempts||0;b.each(function(){var w=d(this);this.cycleH=c.fit&&c.height?c.height:w.height()||this.offsetHeight|| this.height||w.attr("height")||0;this.cycleW=c.fit&&c.width?c.width:w.width()||this.offsetWidth||this.width||w.attr("width")||0;if(w.is("img")){w=d.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var G=d.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,H=this.cycleH==0&&this.cycleW==0&&!this.complete;if(d.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete||w||G||H)if(l.s&&c.requeueOnImageNotLoaded&&++j.requeueAttempts< 100){n(j.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){d(l.s,l.c).cycle(j)},c.requeueTimeout);F=true;return false}else n("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return true});if(F)return false;c.cssBefore=c.cssBefore||{};c.animIn=c.animIn||{};c.animOut=c.animOut||{};b.not(":eq("+m+")").css(c.cssBefore);c.cssFirst&&d(b[m]).css(c.cssFirst);if(c.timeout){c.timeout=parseInt(c.timeout);if(c.speed.constructor== String)c.speed=d.fx.speeds[c.speed]||parseInt(c.speed);c.sync||(c.speed/=2);for(o=c.fx=="shuffle"?500:250;c.timeout-c.speed<o;)c.timeout+=c.speed}if(c.easing)c.easeIn=c.easeOut=c.easing;if(!c.speedIn)c.speedIn=c.speed;if(!c.speedOut)c.speedOut=c.speed;c.slideCount=f.length;c.currSlide=c.lastSlide=m;if(c.random){if(++c.randomIndex==f.length)c.randomIndex=0;c.nextSlide=c.randomMap[c.randomIndex]}else c.nextSlide=c.startingSlide>=f.length-1?0:c.startingSlide+1;if(!c.multiFx){o=d.fn.cycle.transitions[c.fx]; if(d.isFunction(o))o(a,b,c);else if(c.fx!="custom"&&!c.multiFx){n("unknown transition: "+c.fx,"; slideshow terminating");return false}}a=b[m];c.before.length&&c.before[0].apply(a,[a,a,c,true]);c.after.length>1&&c.after[1].apply(a,[a,a,c,true]);c.next&&d(c.next).bind(c.prevNextEvent,function(){return x(c,c.rev?-1:1)});c.prev&&d(c.prev).bind(c.prevNextEvent,function(){return x(c,c.rev?1:-1)});if(c.pager||c.pagerAnchorBuilder)A(f,c);s(c,f);return c}function q(a){a.original={before:[],after:[]};a.original.cssBefore= d.extend({},a.cssBefore);a.original.cssAfter=d.extend({},a.cssAfter);a.original.animIn=d.extend({},a.animIn);a.original.animOut=d.extend({},a.animOut);d.each(a.before,function(){a.original.before.push(this)});d.each(a.after,function(){a.original.after.push(this)})}function r(a){var b,f,j=d.fn.cycle.transitions;if(a.fx.indexOf(",")>0){a.multiFx=true;a.fxs=a.fx.replace(/\s*/g,"").split(",");for(b=0;b<a.fxs.length;b++){var l=a.fxs[b];f=j[l];if(!f||!j.hasOwnProperty(l)||!d.isFunction(f)){n("discarding unknown transition: ", l);a.fxs.splice(b,1);b--}}if(!a.fxs.length){n("No valid transitions named; slideshow terminating.");return false}}else if(a.fx=="all"){a.multiFx=true;a.fxs=[];for(p in j){f=j[p];j.hasOwnProperty(p)&&d.isFunction(f)&&a.fxs.push(p)}}if(a.multiFx&&a.randomizeEffects){f=Math.floor(Math.random()*20)+30;for(b=0;b<f;b++)a.fxs.push(a.fxs.splice(Math.floor(Math.random()*a.fxs.length),1)[0]);h("randomized fx sequence: ",a.fxs)}return true}function s(a,b){a.addSlide=function(f,j){var l=d(f),c=l[0];a.autostopCount|| a.countdown++;b[j?"unshift":"push"](c);if(a.els)a.els[j?"unshift":"push"](c);a.slideCount=b.length;l.css("position","absolute");l[j?"prependTo":"appendTo"](a.$cont);if(j){a.currSlide++;a.nextSlide++}!d.support.opacity&&a.cleartype&&!a.cleartypeNoBg&&B(l);a.fit&&a.width&&l.width(a.width);a.fit&&a.height&&a.height!="auto"&&$slides.height(a.height);c.cycleH=a.fit&&a.height?a.height:l.height();c.cycleW=a.fit&&a.width?a.width:l.width();l.css(a.cssBefore);if(a.pager||a.pagerAnchorBuilder)d.fn.cycle.createPagerAnchor(b.length- 1,c,d(a.pager),b,a);d.isFunction(a.onAddSlide)?a.onAddSlide(l):l.hide()}}function v(a,b,f,j){if(f&&b.busy&&b.manualTrump){h("manualTrump in go(), stopping active transition");d(a).stop(true,true);b.busy=false}if(b.busy)h("transition active, ignoring new tx request");else{var l=b.$cont[0],c=a[b.currSlide],o=a[b.nextSlide];if(!(l.cycleStop!=b.stopCount||l.cycleTimeout===0&&!f))if(!f&&!l.cyclePause&&(b.autostop&&--b.countdown<=0||b.nowrap&&!b.random&&b.nextSlide<b.currSlide))b.end&&b.end(b);else{var m= false;if((f||!l.cyclePause)&&b.nextSlide!=b.currSlide){m=true;var t=b.fx;c.cycleH=c.cycleH||d(c).height();c.cycleW=c.cycleW||d(c).width();o.cycleH=o.cycleH||d(o).height();o.cycleW=o.cycleW||d(o).width();if(b.multiFx){if(b.lastFx==undefined||++b.lastFx>=b.fxs.length)b.lastFx=0;t=b.fxs[b.lastFx];b.currFx=t}if(b.oneTimeFx){t=b.oneTimeFx;b.oneTimeFx=null}d.fn.cycle.resetState(b,t);b.before.length&&d.each(b.before,function(z,y){l.cycleStop==b.stopCount&&y.apply(o,[c,o,b,j])});t=function(){d.each(b.after, function(z,y){l.cycleStop==b.stopCount&&y.apply(o,[c,o,b,j])})};h("tx firing; currSlide: "+b.currSlide+"; nextSlide: "+b.nextSlide);b.busy=1;if(b.fxFn)b.fxFn(c,o,b,t,j,f&&b.fastOnEvent);else d.isFunction(d.fn.cycle[b.fx])?d.fn.cycle[b.fx](c,o,b,t,j,f&&b.fastOnEvent):d.fn.cycle.custom(c,o,b,t,j,f&&b.fastOnEvent)}if(m||b.nextSlide==b.currSlide){b.lastSlide=b.currSlide;if(b.random){b.currSlide=b.nextSlide;if(++b.randomIndex==a.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex];if(b.nextSlide== b.currSlide)b.nextSlide=b.currSlide==b.slideCount-1?0:b.currSlide+1}else{f=b.nextSlide+1==a.length;b.nextSlide=f?0:b.nextSlide+1;b.currSlide=f?a.length-1:b.nextSlide-1}}m&&b.pager&&b.updateActivePagerLink(b.pager,b.currSlide,b.activePagerClass);m=0;if(b.timeout&&!b.continuous)m=u(c,o,b,j);else if(b.continuous&&l.cyclePause)m=10;if(m>0)l.cycleTimeout=setTimeout(function(){v(a,b,0,!b.rev)},m)}}}function u(a,b,f,j){if(f.timeoutFn){for(a=f.timeoutFn(a,b,f,j);a-f.speed<250;)a+=f.speed;h("calculated timeout: "+ a+"; speed: "+f.speed);if(a!==false)return a}return f.timeout}function x(a,b){var f=a.elements,j=a.$cont[0],l=j.cycleTimeout;if(l){clearTimeout(l);j.cycleTimeout=0}if(a.random&&b<0){a.randomIndex--;if(--a.randomIndex==-2)a.randomIndex=f.length-2;else if(a.randomIndex==-1)a.randomIndex=f.length-1;a.nextSlide=a.randomMap[a.randomIndex]}else if(a.random)a.nextSlide=a.randomMap[a.randomIndex];else{a.nextSlide=a.currSlide+b;if(a.nextSlide<0){if(a.nowrap)return false;a.nextSlide=f.length-1}else if(a.nextSlide>= f.length){if(a.nowrap)return false;a.nextSlide=0}}j=a.onPrevNextEvent||a.prevNextClick;d.isFunction(j)&&j(b>0,a.nextSlide,f[a.nextSlide]);v(f,a,1,b>=0);return false}function A(a,b){var f=d(b.pager);d.each(a,function(j,l){d.fn.cycle.createPagerAnchor(j,l,f,a,b)});b.updateActivePagerLink(b.pager,b.startingSlide,b.activePagerClass)}function B(a){function b(j){j=parseInt(j).toString(16);return j.length<2?"0"+j:j}function f(j){for(;j&&j.nodeName.toLowerCase()!="html";j=j.parentNode){var l=d.css(j,"background-color"); if(l.indexOf("rgb")>=0){j=l.match(/\d+/g);return"#"+b(j[0])+b(j[1])+b(j[2])}if(l&&l!="transparent")return l}return"#ffffff"}h("applying clearType background-color hack");a.each(function(){d(this).css("background-color",f(this))})}if(d.support==undefined)d.support={opacity:!d.browser.msie};d.fn.cycle=function(a,b){var f={s:this.selector,c:this.context};if(this.length===0&&a!="stop"){if(!d.isReady&&f.s){n("DOM not ready, queuing slideshow");d(function(){d(f.s,f.c).cycle(a,b)});return this}n("terminating; zero elements found by selector"+ (d.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var j=e(this,a,b);if(j!==false){j.updateActivePagerLink=j.updateActivePagerLink||d.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var l=d(this),c=j.slideExpr?d(j.slideExpr,this):l.children(),o=c.get();if(o.length<2)n("terminating; too few slides: "+o.length);else{var m=g(l,c,o,j,f);if(m!==false)if(j=m.continuous?10:u(m.currSlide,m.nextSlide,m,!m.rev)){j+= m.delay||0;if(j<10)j=10;h("first timeout: "+j);this.cycleTimeout=setTimeout(function(){v(o,m,0,!m.rev)},j)}}}})};d.fn.cycle.resetState=function(a,b){b=b||a.fx;a.before=[];a.after=[];a.cssBefore=d.extend({},a.original.cssBefore);a.cssAfter=d.extend({},a.original.cssAfter);a.animIn=d.extend({},a.original.animIn);a.animOut=d.extend({},a.original.animOut);a.fxFn=null;d.each(a.original.before,function(){a.before.push(this)});d.each(a.original.after,function(){a.after.push(this)});var f=d.fn.cycle.transitions[b]; d.isFunction(f)&&f(a.$cont,d(a.elements),a)};d.fn.cycle.updateActivePagerLink=function(a,b,f){d(a).each(function(){d(this).children().removeClass(f).eq(b).addClass(f)})};d.fn.cycle.next=function(a){x(a,a.rev?-1:1)};d.fn.cycle.prev=function(a){x(a,a.rev?1:-1)};d.fn.cycle.createPagerAnchor=function(a,b,f,j,l){if(d.isFunction(l.pagerAnchorBuilder)){b=l.pagerAnchorBuilder(a,b);h("pagerAnchorBuilder("+a+", el) returned: "+b)}else b='<a href="#">'+(a+1)+"</a>";if(b){var c=d(b);if(c.parents("body").length=== 0){var o=[];if(f.length>1){f.each(function(){var m=c.clone(true);d(this).append(m);o.push(m[0])});c=d(o)}else c.appendTo(f)}l.pagerAnchors=l.pagerAnchors||[];l.pagerAnchors.push(c);c.bind(l.pagerEvent,function(m){m.preventDefault();l.nextSlide=a;m=l.$cont[0];var t=m.cycleTimeout;if(t){clearTimeout(t);m.cycleTimeout=0}m=l.onPagerEvent||l.pagerClick;d.isFunction(m)&&m(l.nextSlide,j[l.nextSlide]);v(j,l,1,l.currSlide<a)});!/^click/.test(l.pagerEvent)&&!l.allowPagerClickBubble&&c.bind("click.cycle",function(){return false}); l.pauseOnPagerHover&&c.hover(function(){l.$cont[0].cyclePause++},function(){l.$cont[0].cyclePause--})}};d.fn.cycle.hopsFromLast=function(a,b){var f=a.lastSlide,j=a.currSlide;return b?j>f?j-f:a.slideCount-f:j<f?f-j:f+a.slideCount-j};d.fn.cycle.commonReset=function(a,b,f,j,l,c){d(f.elements).not(a).hide();f.cssBefore.opacity=1;f.cssBefore.display="block";if(j!==false&&b.cycleW>0)f.cssBefore.width=b.cycleW;if(l!==false&&b.cycleH>0)f.cssBefore.height=b.cycleH;f.cssAfter=f.cssAfter||{};f.cssAfter.display= "none";d(a).css("zIndex",f.slideCount+(c===true?1:0));d(b).css("zIndex",f.slideCount+(c===true?0:1))};d.fn.cycle.custom=function(a,b,f,j,l,c){var o=d(a),m=d(b),t=f.speedIn;a=f.speedOut;var z=f.easeIn;b=f.easeOut;m.css(f.cssBefore);if(c){t=typeof c=="number"?(a=c):(a=1);z=b=null}var y=function(){m.animate(f.animIn,t,z,j)};o.animate(f.animOut,a,b,function(){f.cssAfter&&o.css(f.cssAfter);f.sync||y()});f.sync&&y()};d.fn.cycle.transitions={fade:function(a,b,f){b.not(":eq("+f.currSlide+")").css("opacity", 0);f.before.push(function(j,l,c){d.fn.cycle.commonReset(j,l,c);c.cssBefore.opacity=0});f.animIn={opacity:1};f.animOut={opacity:0};f.cssBefore={top:0,left:0}}};d.fn.cycle.ver=function(){return"2.86"};d.fn.cycle.defaults={fx:"fade",timeout:4E3,timeoutFn:null,continuous:0,speed:1E3,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,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:!d.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null}})(jQuery); (function(d){d.fn.cycle.transitions.none=function(h,n,e){e.fxFn=function(k,i,g,q){d(i).show();d(k).hide();q()}};d.fn.cycle.transitions.scrollUp=function(h,n,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.height();e.cssBefore={top:h,left:0};e.cssFirst={top:0};e.animIn={top:0};e.animOut={top:-h}};d.fn.cycle.transitions.scrollDown=function(h,n,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.height();e.cssFirst={top:0};e.cssBefore={top:-h,left:0};e.animIn= {top:0};e.animOut={top:h}};d.fn.cycle.transitions.scrollLeft=function(h,n,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.width();e.cssFirst={left:0};e.cssBefore={left:h,top:0};e.animIn={left:0};e.animOut={left:0-h}};d.fn.cycle.transitions.scrollRight=function(h,n,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.width();e.cssFirst={left:0};e.cssBefore={left:-h,top:0};e.animIn={left:0};e.animOut={left:h}};d.fn.cycle.transitions.scrollHorz=function(h,n, e){h.css("overflow","hidden").width();e.before.push(function(k,i,g,q){d.fn.cycle.commonReset(k,i,g);g.cssBefore.left=q?i.cycleW-1:1-i.cycleW;g.animOut.left=q?-k.cycleW:k.cycleW});e.cssFirst={left:0};e.cssBefore={top:0};e.animIn={left:0};e.animOut={top:0}};d.fn.cycle.transitions.scrollVert=function(h,n,e){h.css("overflow","hidden");e.before.push(function(k,i,g,q){d.fn.cycle.commonReset(k,i,g);g.cssBefore.top=q?1-i.cycleH:i.cycleH-1;g.animOut.top=q?k.cycleH:-k.cycleH});e.cssFirst={top:0};e.cssBefore= {left:0};e.animIn={top:0};e.animOut={left:0}};d.fn.cycle.transitions.slideX=function(h,n,e){e.before.push(function(k,i,g){d(g.elements).not(k).hide();d.fn.cycle.commonReset(k,i,g,false,true);g.animIn.width=i.cycleW});e.cssBefore={left:0,top:0,width:0};e.animIn={width:"show"};e.animOut={width:0}};d.fn.cycle.transitions.slideY=function(h,n,e){e.before.push(function(k,i,g){d(g.elements).not(k).hide();d.fn.cycle.commonReset(k,i,g,true,false);g.animIn.height=i.cycleH});e.cssBefore={left:0,top:0,height:0}; e.animIn={height:"show"};e.animOut={height:0}};d.fn.cycle.transitions.shuffle=function(h,n,e){h=h.css("overflow","visible").width();n.css({left:0,top:0});e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,true,true,true)});if(!e.speedAdjusted){e.speed/=2;e.speedAdjusted=true}e.random=0;e.shuffle=e.shuffle||{left:-h,top:15};e.els=[];for(h=0;h<n.length;h++)e.els.push(n[h]);for(h=0;h<e.currSlide;h++)e.els.push(e.els.shift());e.fxFn=function(k,i,g,q,r){var s=r?d(k):d(i);d(i).css(g.cssBefore); var v=g.slideCount;s.animate(g.shuffle,g.speedIn,g.easeIn,function(){for(var u=d.fn.cycle.hopsFromLast(g,r),x=0;x<u;x++)r?g.els.push(g.els.shift()):g.els.unshift(g.els.pop());if(r){u=0;for(x=g.els.length;u<x;u++)d(g.els[u]).css("z-index",x-u+v)}else{u=d(k).css("z-index");s.css("z-index",parseInt(u)+1+v)}s.animate({left:0,top:0},g.speedOut,g.easeOut,function(){d(r?this:k).hide();q&&q()})})};e.cssBefore={display:"block",opacity:1,top:0,left:0}};d.fn.cycle.transitions.turnUp=function(h,n,e){e.before.push(function(k, i,g){d.fn.cycle.commonReset(k,i,g,true,false);g.cssBefore.top=i.cycleH;g.animIn.height=i.cycleH});e.cssFirst={top:0};e.cssBefore={left:0,height:0};e.animIn={top:0};e.animOut={height:0}};d.fn.cycle.transitions.turnDown=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,true,false);g.animIn.height=i.cycleH;g.animOut.top=k.cycleH});e.cssFirst={top:0};e.cssBefore={left:0,top:0,height:0};e.animOut={height:0}};d.fn.cycle.transitions.turnLeft=function(h,n,e){e.before.push(function(k, i,g){d.fn.cycle.commonReset(k,i,g,false,true);g.cssBefore.left=i.cycleW;g.animIn.width=i.cycleW});e.cssBefore={top:0,width:0};e.animIn={left:0};e.animOut={width:0}};d.fn.cycle.transitions.turnRight=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,false,true);g.animIn.width=i.cycleW;g.animOut.left=k.cycleW});e.cssBefore={top:0,left:0,width:0};e.animIn={left:0};e.animOut={width:0}};d.fn.cycle.transitions.zoom=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k, i,g,false,false,true);g.cssBefore.top=i.cycleH/2;g.cssBefore.left=i.cycleW/2;g.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH};g.animOut={width:0,height:0,top:k.cycleH/2,left:k.cycleW/2}});e.cssFirst={top:0,left:0};e.cssBefore={width:0,height:0}};d.fn.cycle.transitions.fadeZoom=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,false,false);g.cssBefore.left=i.cycleW/2;g.cssBefore.top=i.cycleH/2;g.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH}});e.cssBefore={width:0, height:0};e.animOut={opacity:0}};d.fn.cycle.transitions.blindX=function(h,n,e){h=h.css("overflow","hidden").width();e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g);g.animIn.width=i.cycleW;g.animOut.left=k.cycleW});e.cssBefore={left:h,top:0};e.animIn={left:0};e.animOut={left:h}};d.fn.cycle.transitions.blindY=function(h,n,e){h=h.css("overflow","hidden").height();e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g);g.animIn.height=i.cycleH;g.animOut.top=k.cycleH});e.cssBefore={top:h, left:0};e.animIn={top:0};e.animOut={top:h}};d.fn.cycle.transitions.blindZ=function(h,n,e){n=h.css("overflow","hidden").height();h=h.width();e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g);g.animIn.height=i.cycleH;g.animOut.top=k.cycleH});e.cssBefore={top:n,left:h};e.animIn={top:0,left:0};e.animOut={top:n,left:h}};d.fn.cycle.transitions.growX=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,false,true);g.cssBefore.left=this.cycleW/2;g.animIn={left:0,width:this.cycleW}; g.animOut={left:0}});e.cssBefore={width:0,top:0}};d.fn.cycle.transitions.growY=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,true,false);g.cssBefore.top=this.cycleH/2;g.animIn={top:0,height:this.cycleH};g.animOut={top:0}});e.cssBefore={height:0,left:0}};d.fn.cycle.transitions.curtainX=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,false,true,true);g.cssBefore.left=i.cycleW/2;g.animIn={left:0,width:this.cycleW};g.animOut={left:k.cycleW/2,width:0}}); e.cssBefore={top:0,width:0}};d.fn.cycle.transitions.curtainY=function(h,n,e){e.before.push(function(k,i,g){d.fn.cycle.commonReset(k,i,g,true,false,true);g.cssBefore.top=i.cycleH/2;g.animIn={top:0,height:i.cycleH};g.animOut={top:k.cycleH/2,height:0}});e.cssBefore={left:0,height:0}};d.fn.cycle.transitions.cover=function(h,n,e){var k=e.direction||"left",i=h.css("overflow","hidden").width(),g=h.height();e.before.push(function(q,r,s){d.fn.cycle.commonReset(q,r,s);if(k=="right")s.cssBefore.left=-i;else if(k== "up")s.cssBefore.top=g;else if(k=="down")s.cssBefore.top=-g;else s.cssBefore.left=i});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};d.fn.cycle.transitions.uncover=function(h,n,e){var k=e.direction||"left",i=h.css("overflow","hidden").width(),g=h.height();e.before.push(function(q,r,s){d.fn.cycle.commonReset(q,r,s,true,true,true);if(k=="right")s.animOut.left=i;else if(k=="up")s.animOut.top=-g;else if(k=="down")s.animOut.top=g;else s.animOut.left=-i});e.animIn={left:0,top:0}; e.animOut={opacity:1};e.cssBefore={top:0,left:0}};d.fn.cycle.transitions.toss=function(h,n,e){var k=h.css("overflow","visible").width(),i=h.height();e.before.push(function(g,q,r){d.fn.cycle.commonReset(g,q,r,true,true,true);if(!r.animOut.left&&!r.animOut.top)r.animOut={left:k*2,top:-i/2,opacity:0};else r.animOut.opacity=0});e.cssBefore={left:0,top:0};e.animIn={left:0}};d.fn.cycle.transitions.wipe=function(h,n,e){var k=h.css("overflow","hidden").width(),i=h.height();e.cssBefore=e.cssBefore||{};var g; if(e.clip)if(/l2r/.test(e.clip))g="rect(0px 0px "+i+"px 0px)";else if(/r2l/.test(e.clip))g="rect(0px "+k+"px "+i+"px "+k+"px)";else if(/t2b/.test(e.clip))g="rect(0px "+k+"px 0px 0px)";else if(/b2t/.test(e.clip))g="rect("+i+"px "+k+"px "+i+"px 0px)";else if(/zoom/.test(e.clip)){h=parseInt(i/2);n=parseInt(k/2);g="rect("+h+"px "+n+"px "+h+"px "+n+"px)"}e.cssBefore.clip=e.cssBefore.clip||g||"rect(0px 0px 0px 0px)";h=e.cssBefore.clip.match(/(\d+)/g);var q=parseInt(h[0]),r=parseInt(h[1]),s=parseInt(h[2]), v=parseInt(h[3]);e.before.push(function(u,x,A){if(u!=x){var B=d(u),a=d(x);d.fn.cycle.commonReset(u,x,A,true,true,false);A.cssAfter.display="block";var b=1,f=parseInt(A.speedIn/13)-1;(function j(){var l=q?q-parseInt(b*(q/f)):0,c=v?v-parseInt(b*(v/f)):0,o=s<i?s+parseInt(b*((i-s)/f||1)):i,m=r<k?r+parseInt(b*((k-r)/f||1)):k;a.css({clip:"rect("+l+"px "+m+"px "+o+"px "+c+"px)"});b++<=f?setTimeout(j,13):B.css("display","none")})()}});e.cssBefore={display:"block",opacity:1,top:0,left:0};e.animIn={left:0}; e.animOut={left:0}}})(jQuery);

/*
*
* 
* Function to add a slideshow to a page using Insight media XML
* setUpSlideShow(xmlPath, selector, {jQuery cycle settings})
*
*/

$(window).load(function(){window.check_39475 = 1})

function setUpSlideShow(xmlPath, selector, dynamicLoad, settings)
{
    if(!xmlPath || !selector) return false;
    if(dynamicLoad == undefined) dynamicLoad = false;
    if(settings == undefined) settings = {};

    $(selector).html('');

    function getImgPaths(doc)
    {
        function makeSlide(n)
        {
            var srcText = base + i[n].getAttribute('src');
            var altText = i[n].getAttribute('title').replace(/^\d+\s+(.*)/, '$1');
            var linkURL = i[n].getAttribute('link');
            var img = $('<img>').attr({'src': srcText, 'alt': altText});
            var titleText = i[n].getAttribute('caption');
            if(titleText) img.attr('title', titleText);
            if(i.length > 1) img.css('display', 'none');
            if(n == 0) img.load(function(){$(this).css('display', 'block')});

            if(linkURL)
            {
                img.css('cursor', 'pointer');
                if(i[n].getAttribute('target') != '_self')
                   img.click(function(){window.open(linkURL)});
                else
                   img.click(function(){location.href = linkURL});
            }

            img.load(function()
            {
                this.cycleW = parseInt($(this).css('width'));
                this.cycleH = parseInt($(this).css('height'));
            })

            if(dynamicLoad)
            {
                if(n < 2) $(selector).append(img[0]);
                if(n == 1)
                {
                    if(img[0].readyState != 'complete')
                        img.load(function(){$(selector).cycle(settings)});
                    else
                        $(selector).cycle(settings);
                }
            }
            else
            {
                $(selector).append(img[0]);
                if(n == 0) for(var ct = 1; ct < i.length; ct++) makeSlide(ct);
                if(n+1 == i.length) $(selector).cycle(settings);
            }

            if(n == 0 && dynamicLoad && i.length > 1) var si = setInterval(function(){if(window.check_39475){clearInterval(si);makeSlide(1)}}, 100);

            return img[0];
        }

        var album = doc.getElementsByTagName('album')[0];
        var base = album.getAttribute('lgPath').replace(/(http:\/\/.*?)(\/.*)/gi, "$2");
        var i = album.getElementsByTagName('img');

        if(dynamicLoad && i.length > 2) $.extend(settings, {'before': function(a,b,c,d){
          if(c.nextSlide+1 == i.length)
          {
              c.original.before[0] = function(){};
              return true;
          }
          if(c.addSlide && c.nextSlide == c.slideCount-1) c.addSlide(makeSlide(c.nextSlide+1));
        }});

        makeSlide(0);
    }
    $.get(xmlPath + '&rdm=' + Math.floor(Math.random()*9999999999), getImgPaths);
}