/* * jquery cycle plugin (with transition definitions) * examples and documentation at: http://jquery.malsup.com/cycle/ * copyright (c) 2007-2010 m. alsup * version: 2.94 (20-dec-2010) * dual licensed under the mit and gpl licenses. * http://jquery.malsup.com/license.html * requires: jquery v1.2.6 or later */ (function($){var ver="2.94";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isready&&o.s){log("dom not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isready?"":" (dom not ready)"));return this;}return this.each(function(){var opts=handlearguments(this,options,arg2);if(opts===false){return;}opts.updateactivepagerlink=opts.updateactivepagerlink||$.fn.cycle.updateactivepagerlink;if(this.cycletimeout){cleartimeout(this.cycletimeout);}this.cycletimeout=this.cyclepause=0;var $cont=$(this);var $slides=opts.slideexpr?$(opts.slideexpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildoptions($cont,$slides,els,opts,o);if(opts2===false){return;}var starttime=opts2.continuous?10:gettimeout(els[opts2.currslide],els[opts2.nextslide],opts2,!opts2.backwards);if(starttime){starttime+=(opts2.delay||0);if(starttime<10){starttime=10;}debug("first timeout: "+starttime);this.cycletimeout=settimeout(function(){go(els,opts2,0,!opts.backwards);},starttime);}});};function handlearguments(cont,options,arg2){if(cont.cyclestop==undefined){cont.cyclestop=0;}if(options===undefined||options===null){options={};}if(options.constructor==string){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cyclestop++;if(cont.cycletimeout){cleartimeout(cont.cycletimeout);}cont.cycletimeout=0;$(cont).removedata("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclepause=(cont.cyclepause===1)?0:1;checkinstantresume(cont.cyclepause,arg2,cont);return false;case"pause":cont.cyclepause=1;return false;case"resume":cont.cyclepause=0;checkinstantresume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextslide=num;if(cont.cycletimeout){cleartimeout(cont.cycletimeout);cont.cycletimeout=0;}if(typeof arg2=="string"){options.onetimefx=arg2;}go(options.elements,options,1,num>=options.currslide);return false;}}return options;function checkinstantresume(ispaused,arg2,cont){if(!ispaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycletimeout){cleartimeout(cont.cycletimeout);cont.cycletimeout=0;}go(options.elements,options,1,!options.backwards);}}}function removefilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeattribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevnextevent);}if(opts.prev){$(opts.prev).unbind(opts.prevnextevent);}if(opts.pager||opts.pageranchorbuilder){$.each(opts.pageranchors||[],function(){this.unbind().remove();});}opts.pageranchors=null;if(opts.destroy){opts.destroy(opts);}}function buildoptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopcount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopcount=cont.cyclestop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removefilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.backwards);});}saveoriginalopts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypenobg){cleartypefix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingslide){opts.startingslide=parseint(opts.startingslide);}else{if(opts.backwards){opts.startingslide=els.length-1;}}if(opts.random){opts.randommap=[];for(var i=0;i=els.length){opts.startingslide=0;}}opts.currslide=opts.startingslide||0;var first=opts.startingslide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removefilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerresize&&!$cont.innerheight();if(reshape){var maxw=0,maxh=0;for(var j=0;jmaxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclepause++;},function(){this.cyclepause--;});}if(supportmultitransitions(opts)===false){return false;}var requeue=false;options.requeueattempts=options.requeueattempts||0;$slides.each(function(){var $el=$(this);this.cycleh=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetheight||this.height||$el.attr("height")||0);this.cyclew=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetwidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingie=($.browser.msie&&this.cyclew==28&&this.cycleh==30&&!this.complete);var loadingff=($.browser.mozilla&&this.cyclew==34&&this.cycleh==19&&!this.complete);var loadingop=($.browser.opera&&((this.cyclew==42&&this.cycleh==19)||(this.cyclew==37&&this.cycleh==17))&&!this.complete);var loadingother=(this.cycleh==0&&this.cyclew==0&&!this.complete);if(loadingie||loadingff||loadingop||loadingother){if(o.s&&opts.requeueonimagenotloaded&&++options.requeueattempts<100){log(options.requeueattempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cyclew,this.cycleh);settimeout(function(){$(o.s,o.c).cycle(options);},opts.requeuetimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cyclew,this.cycleh);}}}return true;});if(requeue){return false;}opts.cssbefore=opts.cssbefore||{};opts.animin=opts.animin||{};opts.animout=opts.animout||{};$slides.not(":eq("+first+")").css(opts.cssbefore);if(opts.cssfirst){$($slides[first]).css(opts.cssfirst);}if(opts.timeout){opts.timeout=parseint(opts.timeout);if(opts.speed.constructor==string){opts.speed=$.fx.speeds[opts.speed]||parseint(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)=(els.length-1)?0:opts.startingslide+1;}}if(!opts.multifx){var init=$.fn.cycle.transitions[opts.fx];if($.isfunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multifx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevnextevent,function(){return advance(opts,1);});}if(opts.prev){$(opts.prev).bind(opts.prevnextevent,function(){return advance(opts,0);});}if(opts.pager||opts.pageranchorbuilder){buildpager(els,opts);}exposeaddslide(opts,els);return opts;}function saveoriginalopts(opts){opts.original={before:[],after:[]};opts.original.cssbefore=$.extend({},opts.cssbefore);opts.original.cssafter=$.extend({},opts.cssafter);opts.original.animin=$.extend({},opts.animin);opts.original.animout=$.extend({},opts.animout);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportmultitransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexof(",")>0){opts.multifx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i=opts.fxs.length){opts.lastfx=0;}fx=opts.fxs[opts.lastfx];opts.currfx=fx;}if(opts.onetimefx){fx=opts.onetimefx;opts.onetimefx=null;}$.fn.cycle.resetstate(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cyclestop!=opts.stopcount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cyclestop!=opts.stopcount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currslide: "+opts.currslide+"; nextslide: "+opts.nextslide);opts.busy=1;if(opts.fxfn){opts.fxfn(curr,next,opts,after,fwd,manual&&opts.fastonevent);}else{if($.isfunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastonevent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastonevent);}}}if(changed||opts.nextslide==opts.currslide){opts.lastslide=opts.currslide;if(opts.random){opts.currslide=opts.nextslide;if(++opts.randomindex==els.length){opts.randomindex=0;}opts.nextslide=opts.randommap[opts.randomindex];if(opts.nextslide==opts.currslide){opts.nextslide=(opts.currslide==opts.slidecount-1)?0:opts.currslide+1;}}else{if(opts.backwards){var roll=(opts.nextslide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextslide=1;opts.currslide=0;}else{opts.nextslide=roll?(els.length-1):opts.nextslide-1;opts.currslide=roll?0:opts.nextslide+1;}}else{var roll=(opts.nextslide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextslide=els.length-2;opts.currslide=els.length-1;}else{opts.nextslide=roll?0:opts.nextslide+1;opts.currslide=roll?els.length-1:opts.nextslide-1;}}}}if(changed&&opts.pager){opts.updateactivepagerlink(opts.pager,opts.currslide,opts.activepagerclass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=gettimeout(els[opts.currslide],els[opts.nextslide],opts,fwd);}else{if(opts.continuous&&p.cyclepause){ms=10;}}if(ms>0){p.cycletimeout=settimeout(function(){go(els,opts,0,!opts.backwards);},ms);}}$.fn.cycle.updateactivepagerlink=function(pager,currslide,clsname){$(pager).each(function(){$(this).children().removeclass(clsname).eq(currslide).addclass(clsname);});};function gettimeout(curr,next,opts,fwd){if(opts.timeoutfn){var t=opts.timeoutfn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,1);};$.fn.cycle.prev=function(opts){advance(opts,0);};function advance(opts,moveforward){var val=moveforward?1:-1;var els=opts.elements;var p=opts.$cont[0],timeout=p.cycletimeout;if(timeout){cleartimeout(timeout);p.cycletimeout=0;}if(opts.random&&val<0){opts.randomindex--;if(--opts.randomindex==-2){opts.randomindex=els.length-2;}else{if(opts.randomindex==-1){opts.randomindex=els.length-1;}}opts.nextslide=opts.randommap[opts.randomindex];}else{if(opts.random){opts.nextslide=opts.randommap[opts.randomindex];}else{opts.nextslide=opts.currslide+val;if(opts.nextslide<0){if(opts.nowrap){return false;}opts.nextslide=els.length-1;}else{if(opts.nextslide>=els.length){if(opts.nowrap){return false;}opts.nextslide=0;}}}}var cb=opts.onprevnextevent||opts.prevnextclick;if($.isfunction(cb)){cb(val>0,opts.nextslide,els[opts.nextslide]);}go(els,opts,1,moveforward);return false;}function buildpager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createpageranchor(i,o,$p,els,opts);});opts.updateactivepagerlink(opts.pager,opts.startingslide,opts.activepagerclass);}$.fn.cycle.createpageranchor=function(i,el,$p,els,opts){var a;if($.isfunction(opts.pageranchorbuilder)){a=opts.pageranchorbuilder(i,el);debug("pageranchorbuilder("+i+", el) returned: "+a);}else{a=''+(i+1)+"";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendto($p);}}opts.pageranchors=opts.pageranchors||[];opts.pageranchors.push($a);$a.bind(opts.pagerevent,function(e){e.preventdefault();opts.nextslide=i;var p=opts.$cont[0],timeout=p.cycletimeout;if(timeout){cleartimeout(timeout);p.cycletimeout=0;}var cb=opts.onpagerevent||opts.pagerclick;if($.isfunction(cb)){cb(opts.nextslide,els[opts.nextslide]);}go(els,opts,1,opts.currslidel?c-l:opts.slidecount-l;}else{hops=c=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getbg(this));});}$.fn.cycle.commonreset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssbefore.opacity=1;opts.cssbefore.display="block";if(opts.slideresize&&w!==false&&next.cyclew>0){opts.cssbefore.width=next.cyclew;}if(opts.slideresize&&h!==false&&next.cycleh>0){opts.cssbefore.height=next.cycleh;}opts.cssafter=opts.cssafter||{};opts.cssafter.display="none";$(curr).css("zindex",opts.slidecount+(rev===true?1:0));$(next).css("zindex",opts.slidecount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedoverride){var $l=$(curr),$n=$(next);var speedin=opts.speedin,speedout=opts.speedout,easein=opts.easein,easeout=opts.easeout;$n.css(opts.cssbefore);if(speedoverride){if(typeof speedoverride=="number"){speedin=speedout=speedoverride;}else{speedin=speedout=1;}easein=easeout=null;}var fn=function(){$n.animate(opts.animin,speedin,easein,cb);};$l.animate(opts.animout,speedout,easeout,function(){if(opts.cssafter){$l.css(opts.cssafter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currslide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonreset(curr,next,opts);opts.cssbefore.opacity=0;});opts.animin={opacity:1};opts.animout={opacity:0};opts.cssbefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutfn:null,continuous:0,speed:1000,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,slideresize:1,pause:0,pauseonpagerhover:0,autostop:0,autostopcount:0,delay:0,slideexpr:null,cleartype:!$.support.opacity,cleartypenobg:false,nowrap:0,fastonevent:0,randomizeeffects:1,rev:0,manualtrump:true,requeueonimagenotloaded:true,requeuetimeout:250,activepagerclass:"activeslide",updateactivepagerlink:null,backwards:false};})(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-2010 m. alsup * version: 2.73 * dual licensed under the mit and gpl licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxfn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.fadeout=function($cont,$slides,opts){$slides.not(":eq("+opts.currslide+")").css({display:"block",opacity:1});opts.before.push(function(curr,next,opts,w,h,rev){$(curr).css("zindex",opts.slidecount+(!rev===true?1:0));$(next).css("zindex",opts.slidecount+(!rev===true?0:1));});opts.animin={opacity:1};opts.animout={opacity:0};opts.cssbefore={opacity:1,display:"block"};opts.cssafter={zindex:0};};$.fn.cycle.transitions.scrollup=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonreset);var h=$cont.height();opts.cssbefore={top:h,left:0};opts.cssfirst={top:0};opts.animin={top:0};opts.animout={top:-h};};$.fn.cycle.transitions.scrolldown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonreset);var h=$cont.height();opts.cssfirst={top:0};opts.cssbefore={top:-h,left:0};opts.animin={top:0};opts.animout={top:h};};$.fn.cycle.transitions.scrollleft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonreset);var w=$cont.width();opts.cssfirst={left:0};opts.cssbefore={left:w,top:0};opts.animin={left:0};opts.animout={left:0-w};};$.fn.cycle.transitions.scrollright=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonreset);var w=$cont.width();opts.cssfirst={left:0};opts.cssbefore={left:-w,top:0};opts.animin={left:0};opts.animout={left:w};};$.fn.cycle.transitions.scrollhorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonreset(curr,next,opts);opts.cssbefore.left=fwd?(next.cyclew-1):(1-next.cyclew);opts.animout.left=fwd?-curr.cyclew:curr.cyclew;});opts.cssfirst={left:0};opts.cssbefore={top:0};opts.animin={left:0};opts.animout={top:0};};$.fn.cycle.transitions.scrollvert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonreset(curr,next,opts);opts.cssbefore.top=fwd?(1-next.cycleh):(next.cycleh-1);opts.animout.top=fwd?curr.cycleh:-curr.cycleh;});opts.cssfirst={top:0};opts.cssbefore={left:0};opts.animin={top:0};opts.animout={left:0};};$.fn.cycle.transitions.slidex=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonreset(curr,next,opts,false,true);opts.animin.width=next.cyclew;});opts.cssbefore={left:0,top:0,width:0};opts.animin={width:"show"};opts.animout={width:0};};$.fn.cycle.transitions.slidey=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonreset(curr,next,opts,true,false);opts.animin.height=next.cycleh;});opts.cssbefore={left:0,top:0,height:0};opts.animin={height:"show"};opts.animout={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonreset(curr,next,opts,true,true,true);});if(!opts.speedadjusted){opts.speed=opts.speed/2;opts.speedadjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i