(function($){var n='2.09';var q=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);$.fn.cycle=function(m){return this.each(function(){m=m||{};if(m.constructor==String){switch(m){case'stop':if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;return;case'pause':this.cyclePause=1;return;case'resume':this.cyclePause=0;return;default:m={fx:m}}}var c=$(this);var d=m.slideExpr?$(m.slideExpr,this):c.children();var e=d.get();if(e.length<2)return;var f=$.extend({},$.fn.cycle.defaults,m||{},$.metadata?c.metadata():$.meta?c.data():{});if(f.autostop)f.countdown=f.autostopCount||e.length;f.before=f.before?[f.before]:[];f.after=f.after?[f.after]:[];f.after.unshift(function(){f.busy=0});if(q&&f.cleartype&&!f.cleartypeNoBg)clearTypeFix(d);var g=this.className;var w=parseInt((g.match(/w:(\d+)/)||[])[1])||f.width;var h=parseInt((g.match(/h:(\d+)/)||[])[1])||f.height;f.timeout=parseInt((g.match(/t:(\d+)/)||[])[1])||f.timeout;if(c.css('position')=='static')c.css('position','relative');if(w)c.width(w);if(h&&h!='auto')c.height(h);if(f.random){f.randomMap=[];for(var i=0;i<e.length;i++)f.randomMap.push(i);f.randomMap.sort(function(a,b){return Math.random()-0.5});f.randomIndex=0;f.startingSlide=f.randomMap[0]}else if(f.startingSlide>=e.length)f.startingSlide=0;var j=f.startingSlide||0;d.css('position','absolute').hide().each(function(i){var z=j?i>=j?e.length-(i-j):j-i:e.length-i;$(this).css('z-index',z)});$(e[j]).show();if(f.fit&&w)d.width(w);if(f.fit&&h&&h!='auto')d.height(h);if(f.pause)c.hover(function(){this.cyclePause=1},function(){this.cyclePause=0});var k=$.fn.cycle.transitions[f.fx];if($.isFunction(k))k(c,d,f);d.each(function(){var a=$(this);this.cycleH=(f.fit&&h)?h:a.height();this.cycleW=(f.fit&&w)?w:a.width()});f.cssBefore=f.cssBefore||{};f.animIn=f.animIn||{};f.animOut=f.animOut||{};d.not(':eq('+j+')').css(f.cssBefore);if(f.cssFirst)$(d[j]).css(f.cssFirst);if(f.timeout){if(f.speed.constructor==String)f.speed={slow:600,fast:200}[f.speed]||400;if(!f.sync)f.speed=f.speed/2;while((f.timeout-f.speed)<250)f.timeout+=f.speed}if(f.easing)f.easeIn=f.easeOut=f.easing;if(!f.speedIn)f.speedIn=f.speed;if(!f.speedOut)f.speedOut=f.speed;f.slideCount=e.length;f.currSlide=j;if(f.random){f.nextSlide=f.currSlide;if(++f.randomIndex==e.length)f.randomIndex=0;f.nextSlide=f.randomMap[f.randomIndex]}else f.nextSlide=f.startingSlide>=(e.length-1)?0:f.startingSlide+1;var l=d[j];if(f.before.length)f.before[0].apply(l,[l,l,f,true]);if(f.after.length>1)f.after[1].apply(l,[l,l,f,true]);if(f.click&&!f.next)f.next=f.click;if(f.next)$(f.next).bind('click',function(){return advance(e,f,f.rev?-1:1)});if(f.prev)$(f.prev).bind('click',function(){return advance(e,f,f.rev?1:-1)});if(f.pager)buildPager(e,f);if(f.timeout)this.cycleTimeout=setTimeout(function(){go(e,f,0,!f.rev)},f.timeout+(f.delay||0))})};function go(a,b,c,d){if(b.busy)return;var p=a[0].parentNode,curr=a[b.currSlide],next=a[b.nextSlide];if(p.cycleTimeout===0&&!c)return;if(!c&&!p.cyclePause&&b.autostop&&(--b.countdown<=0))return;if(c||!p.cyclePause){if(b.before.length)$.each(b.before,function(i,o){o.apply(next,[curr,next,b,d])});var e=function(){if($.browser.msie&&b.cleartype)this.style.removeAttribute('filter');$.each(b.after,function(i,o){o.apply(next,[curr,next,b,d])})};if(b.nextSlide!=b.currSlide){b.busy=1;if(b.fxFn)b.fxFn(curr,next,b,e,d);else if($.isFunction($.fn.cycle[b.fx]))$.fn.cycle[b.fx](curr,next,b,e);else $.fn.cycle.custom(curr,next,b,e)}if(b.random){b.currSlide=b.nextSlide;if(++b.randomIndex==a.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex]}else{var f=(b.nextSlide+1)==a.length;b.nextSlide=f?0:b.nextSlide+1;b.currSlide=f?a.length-1:b.nextSlide-1}if(b.pager)$(b.pager).find('a').removeClass('activeSlide').filter('a:eq('+b.currSlide+')').addClass('activeSlide')}if(b.timeout)p.cycleTimeout=setTimeout(function(){go(a,b,0,!b.rev)},b.timeout)};function advance(a,b,c){var p=a[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0}b.nextSlide=b.currSlide+c;if(b.nextSlide<0)b.nextSlide=a.length-1;else if(b.nextSlide>=a.length)b.nextSlide=0;if(b.prevNextClick&&typeof b.prevNextClick=='function')b.prevNextClick(c>0,b.nextSlide,a[b.nextSlide]);go(a,b,1,c>=0);return false};function buildPager(d,e){var f=$(e.pager);$.each(d,function(i,o){var a=d[i].src.split('/');a[a.length-1]='thumb/'+a[a.length-1];var b=a.join('/');b='<img src="'+b+'" />';var c=(typeof e.pagerAnchorBuilder=='function')?$(e.pagerAnchorBuilder(i,o)):$('<a href="#">'+b+'</a>');if(c.parents('body').length==0)c.appendTo(f);c.bind('click',function(){e.nextSlide=i;var p=d[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0}if(typeof e.pagerClick=='function')e.pagerClick(e.nextSlide,d[e.nextSlide]);go(d,e,1,!e.rev);return false})});f.find('a').filter('a:eq('+e.startingSlide+')').addClass('activeSlide')};function clearTypeFix(b){function hex(s){var s=parseInt(s).toString(16);return s.length<2?'0'+s:s};function getBg(e){for(;e&&e.nodeName.toLowerCase()!='html';e=e.parentNode){var v=$.css(e,'background-color');if(v.indexOf('rgb')>=0){var a=v.match(/\d+/g);return'#'+hex(a[0])+hex(a[1])+hex(a[2])}if(v&&v!='transparent')return v}return'#ffffff'};b.each(function(){$(this).css('background-color',getBg(this))})};$.fn.cycle.custom=function(a,b,c,d){var e=$(a),$n=$(b);$n.css(c.cssBefore);var f=function(){$n.animate(c.animIn,c.speedIn,c.easeIn,d)};e.animate(c.animOut,c.speedOut,c.easeOut,function(){if(c.cssAfter)e.css(c.cssAfter);if(!c.sync)f()});if(c.sync)f()};$.fn.cycle.transitions={fade:function(a,b,c){b.not(':eq('+c.startingSlide+')').css('opacity',0);c.before.push(function(){$(this).show()});c.animIn={opacity:1};c.animOut={opacity:0};c.cssAfter={display:'none'}}};$.fn.cycle.ver=function(){return n};$.fn.cycle.defaults={fx:'fade',timeout:4000,speed:1000,speedIn:null,speedOut:null,click:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerAnchorBuilder:null,before:null,after: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,pause:0,autostop:0,delay:0,slideExpr:null,cleartype:0}})(jQuery);jQuery.fn.cycle.transitions.scrollUp=function(d,e,f){d.css('overflow','hidden');f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.top=b.offsetHeight;c.animOut.top=0-a.offsetHeight});f.cssFirst={top:0};f.animIn={top:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.scrollDown=function(d,e,f){d.css('overflow','hidden');f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.top=0-b.offsetHeight;c.animOut.top=a.offsetHeight});f.cssFirst={top:0};f.animIn={top:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.scrollLeft=function(d,e,f){d.css('overflow','hidden');f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.left=b.offsetWidth;c.animOut.left=0-a.offsetWidth});f.cssFirst={left:0};f.animIn={left:0}};jQuery.fn.cycle.transitions.scrollRight=function(d,e,f){d.css('overflow','hidden');f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.left=0-b.offsetWidth;c.animOut.left=a.offsetWidth});f.cssFirst={left:0};f.animIn={left:0}};jQuery.fn.cycle.transitions.scrollHorz=function(f,g,h){f.css('overflow','hidden').width();h.before.push(function(a,b,c,d){jQuery(this).show();var e=a.offsetWidth,nextW=b.offsetWidth;c.cssBefore=d?{left:nextW}:{left:-nextW};c.animIn.left=0;c.animOut.left=d?-e:e;g.not(a).css(c.cssBefore)});h.cssFirst={left:0};h.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.scrollVert=function(f,g,h){f.css('overflow','hidden');h.before.push(function(a,b,c,d){jQuery(this).show();var e=a.offsetHeight,nextH=b.offsetHeight;c.cssBefore=d?{top:-nextH}:{top:nextH};c.animIn.top=0;c.animOut.top=d?e:-e;g.not(a).css(c.cssBefore)});h.cssFirst={top:0};h.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.slideX=function(a,b,c){c.animIn={width:'show'};c.animOut={width:'hide'}};jQuery.fn.cycle.transitions.slideY=function(a,b,c){c.animIn={height:'show'};c.animOut={height:'hide'}};jQuery.fn.cycle.transitions.shuffle=function(g,h,j){var w=g.css('overflow','visible').width();h.css({left:0,top:0});j.before.push(function(){jQuery(this).show()});j.speed=j.speed/2;j.random=0;j.shuffle=j.shuffle||{left:-w,top:15};j.els=[];for(var i=0;i<h.length;i++)j.els.push(h[i]);for(var i=0;i<j.startingSlide;i++)j.els.push(j.els.shift());j.fxFn=function(a,b,c,d,e){var f=e?jQuery(a):jQuery(b);f.animate(c.shuffle,c.speedIn,c.easeIn,function(){e?c.els.push(c.els.shift()):c.els.unshift(c.els.pop());if(e)for(var i=0,len=c.els.length;i<len;i++)jQuery(c.els[i]).css('z-index',len-i);else{var z=jQuery(a).css('z-index');f.css('z-index',parseInt(z)+1)}f.animate({left:0,top:0},c.speedOut,c.easeOut,function(){jQuery(e?this:a).hide();if(d)d()})})}};jQuery.fn.cycle.transitions.turnUp=function(d,e,f){f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.top=b.cycleH;c.animIn.height=b.cycleH});f.cssFirst={top:0};f.cssBefore={height:0};f.animIn={top:0};f.animOut={height:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.turnDown=function(d,e,f){f.before.push(function(a,b,c){jQuery(this).show();c.animIn.height=b.cycleH;c.animOut.top=a.cycleH});f.cssFirst={top:0};f.cssBefore={top:0,height:0};f.animOut={height:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.turnLeft=function(d,e,f){f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore.left=b.cycleW;c.animIn.width=b.cycleW});f.cssBefore={width:0};f.animIn={left:0};f.animOut={width:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.turnRight=function(d,e,f){f.before.push(function(a,b,c){jQuery(this).show();c.animIn.width=b.cycleW;c.animOut.left=a.cycleW});f.cssBefore={left:0,width:0};f.animIn={left:0};f.animOut={width:0};f.cssAfter={display:'none'}};jQuery.fn.cycle.transitions.zoom=function(d,e,f){f.cssFirst={top:0,left:0};f.cssAfter={display:'none'};f.before.push(function(a,b,c){jQuery(this).show();c.cssBefore={width:0,height:0,top:b.cycleH/2,left:b.cycleW/2};c.animIn={top:0,left:0,width:b.cycleW,height:b.cycleH};c.animOut={width:0,height:0,top:a.cycleH/2,left:a.cycleW/2}})};jQuery.fn.cycle.transitions.fadeZoom=function(d,e,f){f.before.push(function(a,b,c){c.cssBefore={width:0,height:0,opacity:1,left:b.cycleW/2,top:b.cycleH/2,zIndex:1};c.animIn={top:0,left:0,width:b.cycleW,height:b.cycleH}});f.animOut={opacity:0};f.cssAfter={zIndex:0}};
