/* File: jquery.cycle.lite-mod.min.js */
/*
 * jQuery Cycle Lite Plugin
 * http://malsup.com/jquery/cycle/lite/
 * Copyright (c) 2008 M. Alsup
 * Version: 1.0 (06/08/2008)
 * 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
 *
 * Contains minor Aspen Digital Changes
 */
(function(e){var a="Lite-1.0";e.fn.cycle=function(f){return this.each(function(){f=f||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var j=e(this);var k=f.slideExpr?e(f.slideExpr,this):j.children();var h=k.get();if(h.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+h.length)}return}var i=e.extend({},e.fn.cycle.defaults,f||{},e.metadata?j.metadata():e.meta?j.data():{});if(i.keep){i.sync=1}i.before=i.before?[i.before]:[];i.after=i.after?[i.after]:[];i.after.unshift(function(){i.busy=0});var g=this.className;i.width=parseInt((g.match(/w:(\d+)/)||[])[1])||i.width;i.height=parseInt((g.match(/h:(\d+)/)||[])[1])||i.height;i.timeout=parseInt((g.match(/t:(\d+)/)||[])[1])||i.timeout;if(j.css("position")=="static"){j.css("position","relative")}if(i.width){j.width(i.width)}if(i.height&&i.height!="auto"){j.height(i.height)}var l=0;k.css({position:"absolute",top:0,left:0}).hide();if(i.hoverExpr){b(h,i)}e(h[l]).css("opacity",1).show();if(e.browser.msie){h[l].style.removeAttribute("filter")}if(i.fit&&i.width){k.width(i.width)}if(i.fit&&i.height&&i.height!="auto"){k.height(i.height)}if(i.pause){j.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}e.fn.cycle.transitions.fade(j,k,i);k.each(function(){var n=e(this);this.cycleH=(i.fit&&i.height)?i.height:n.height();this.cycleW=(i.fit&&i.width)?i.width:n.width()});k.not(":eq("+l+")").css({opacity:0});if(i.cssFirst){e(k[l]).css(i.cssFirst)}if(i.timeout){if(i.speed.constructor==String){i.speed={slow:600,fast:200}[i.speed]||400}if(!i.sync){i.speed=i.speed/2}while((i.timeout-i.speed)<250){i.timeout+=i.speed}}i.speedIn=i.speed;i.speedOut=i.speed;i.slideCount=h.length;i.currSlide=l;i.nextSlide=1;var m=k[l];if(i.before.length){i.before[0].apply(m,[m,m,i,true])}if(i.after.length>1){i.after[1].apply(m,[m,m,i,true])}if(i.click&&!i.next){i.next=i.click}if(i.next){e(i.next).bind("click",function(){return d(h,i,i.rev?-1:1)})}if(i.prev){e(i.prev).bind("click",function(){return d(h,i,i.rev?1:-1)})}if(i.timeout){this.cycleTimeout=setTimeout(function(){c(h,i,0,!i.rev)},i.timeout+(i.delay||0))}})};function b(g,h){var f={},i=g[0].parentNode;e.each(g,function(j){if(this.id){f[this.id]=j+1}});e(h.hoverExpr).each(function(){var j=f[this.rel];if(j){e(this).hover(function(){i.cyclePause=1;h.nextSlide=j-1;if(i.cycleTimeout){clearTimeout(i.cycleTimeout);i.cycleTimeout=0}h.speedIn=h.speedOut=0;c(g,h,1,!h.rev)},function(){i.cyclePause=0;if(i.cycleTimeout===0){i.cycleTimeout=setTimeout(function(){c(g,h,0,!h.rev)},h.timeout)}h.speedIn=h.speedOut=h.speed})}})}function c(l,f,j,m){if(f.busy){return}var i=l[0].parentNode,q=l[f.currSlide],n=l[f.nextSlide],o=e(q),k=e(n);if(i.cycleTimeout===0&&!j){return}if(j||!i.cyclePause){if(f.sync){o.css("z-index",1);k.css("z-index",2)}if(f.before.length){e.each(f.before,function(p,r){r.apply(n,[q,n,f,m])})}var g=function(){if(f.keep){o.css({display:"none",opacity:0,"z-index":0})}if(e.browser.msie){this.style.removeAttribute("filter")}e.each(f.after,function(p,r){r.apply(n,[q,n,f,m])})};if(f.nextSlide!=f.currSlide){f.busy=1;e.fn.cycle.custom(q,n,f,g)}var h=(f.nextSlide+1)==l.length;f.nextSlide=h?0:f.nextSlide+1;f.currSlide=h?l.length-1:f.nextSlide-1}if(f.timeout){i.cycleTimeout=setTimeout(function(){c(l,f,0,!f.rev)},f.timeout)}}function d(f,g,j){var i=f[0].parentNode,h=i.cycleTimeout;if(h){clearTimeout(h);i.cycleTimeout=0}g.nextSlide=g.currSlide+j;if(g.nextSlide<0){g.nextSlide=f.length-1}else{if(g.nextSlide>=f.length){g.nextSlide=0}}c(f,g,1,j>=0);return false}e.fn.cycle.custom=function(l,i,j,f){var k=e(l),h=e(i);h.css({opacity:0});var g=function(){h.animate({opacity:1},j.speedIn,j.easeIn,f)};if(j.sync){g()}if(!j.keep){k.animate({opacity:0},j.speedOut,j.easeOut,function(){k.css({display:"none"});if(!j.sync){g()}})}};e.fn.cycle.transitions={fade:function(g,h,f){h.not(":eq(0)").css("opacity",0);f.before.push(function(){e(this).show()})}};e.fn.cycle.ver=function(){return a};e.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",keep:0,sync:1,fit:0,pause:0,delay:0,slideExpr:null,hoverExpr:null}})(jQuery);