/*! * jquery cycle2; version: 2.1.6 build: 20141007 * http://jquery.malsup.com/cycle2/ * copyright (c) 2014 m. alsup; dual licensed: mit/gpl */ /* cycle2 core engine */ ;(function($) { "use strict"; var version = '2.1.6'; $.fn.cycle = function( options ) { // fix mistakes with the ready state var o; if ( this.length === 0 && !$.isready ) { o = { s: this.selector, c: this.context }; $.fn.cycle.log('requeuing slideshow (dom not ready)'); $(function() { $( o.s, o.c ).cycle(options); }); return this; } return this.each(function() { var data, opts, shortname, val; var container = $(this); var log = $.fn.cycle.log; if ( container.data('cycle.opts') ) return; // already initialized if ( container.data('cycle-log') === false || ( options && options.log === false ) || ( opts && opts.log === false) ) { log = $.noop; } log('--c2 init--'); data = container.data(); for (var p in data) { // allow props to be accessed sans 'cycle' prefix and log the overrides if (data.hasownproperty(p) && /^cycle[a-z]+/.test(p) ) { val = data[p]; shortname = p.match(/^cycle(.*)/)[1].replace(/^[a-z]/, lowercase); log(shortname+':', val, '('+typeof val +')'); data[shortname] = val; } } opts = $.extend( {}, $.fn.cycle.defaults, data, options || {}); opts.timeoutid = 0; opts.paused = opts.paused || false; // #57 opts.container = container; opts._maxz = opts.maxz; opts.api = $.extend ( { _container: container }, $.fn.cycle.api ); opts.api.log = log; opts.api.trigger = function( eventname, args ) { opts.container.trigger( eventname, args ); return opts.api; }; container.data( 'cycle.opts', opts ); container.data( 'cycle.api', opts.api ); // opportunity for plugins to modify opts and api opts.api.trigger('cycle-bootstrap', [ opts, opts.api ]); opts.api.addinitialslides(); opts.api.preinitslideshow(); if ( opts.slides.length ) opts.api.initslideshow(); }); }; $.fn.cycle.api = { opts: function() { return this._container.data( 'cycle.opts' ); }, addinitialslides: function() { var opts = this.opts(); var slides = opts.slides; opts.slidecount = 0; opts.slides = $(); // empty set // add slides that already exist slides = slides.jquery ? slides : opts.container.find( slides ); if ( opts.random ) { slides.sort(function() {return math.random() - 0.5;}); } opts.api.add( slides ); }, preinitslideshow: function() { var opts = this.opts(); opts.api.trigger('cycle-pre-initialize', [ opts ]); var tx = $.fn.cycle.transitions[opts.fx]; if (tx && $.isfunction(tx.preinit)) tx.preinit( opts ); opts._preinitialized = true; }, postinitslideshow: function() { var opts = this.opts(); opts.api.trigger('cycle-post-initialize', [ opts ]); var tx = $.fn.cycle.transitions[opts.fx]; if (tx && $.isfunction(tx.postinit)) tx.postinit( opts ); }, initslideshow: function() { var opts = this.opts(); var pauseobj = opts.container; var slideopts; opts.api.calcfirstslide(); if ( opts.container.css('position') == 'static' ) opts.container.css('position', 'relative'); $(opts.slides[opts.currslide]).css({ opacity: 1, display: 'block', visibility: 'visible' }); opts.api.stackslides( opts.slides[opts.currslide], opts.slides[opts.nextslide], !opts.reverse ); if ( opts.pauseonhover ) { // allow pauseonhover to specify an element if ( opts.pauseonhover !== true ) pauseobj = $( opts.pauseonhover ); pauseobj.hover( function(){ opts.api.pause( true ); }, function(){ opts.api.resume( true ); } ); } // stage initial transition if ( opts.timeout ) { slideopts = opts.api.getslideopts( opts.currslide ); opts.api.queuetransition( slideopts, slideopts.timeout + opts.delay ); } opts._initialized = true; opts.api.updateview( true ); opts.api.trigger('cycle-initialized', [ opts ]); opts.api.postinitslideshow(); }, pause: function( hover ) { var opts = this.opts(), slideopts = opts.api.getslideopts(), alreadypaused = opts.hoverpaused || opts.paused; if ( hover ) opts.hoverpaused = true; else opts.paused = true; if ( ! alreadypaused ) { opts.container.addclass('cycle-paused'); opts.api.trigger('cycle-paused', [ opts ]).log('cycle-paused'); if ( slideopts.timeout ) { cleartimeout( opts.timeoutid ); opts.timeoutid = 0; // determine how much time is left for the current slide opts._remainingtimeout -= ( $.now() - opts._lastqueue ); if ( opts._remainingtimeout < 0 || isnan(opts._remainingtimeout) ) opts._remainingtimeout = undefined; } } }, resume: function( hover ) { var opts = this.opts(), alreadyresumed = !opts.hoverpaused && !opts.paused, remaining; if ( hover ) opts.hoverpaused = false; else opts.paused = false; if ( ! alreadyresumed ) { opts.container.removeclass('cycle-paused'); // #gh-230; if an animation is in progress then don't queue a new transition; it will // happen naturally if ( opts.slides.filter(':animated').length === 0 ) opts.api.queuetransition( opts.api.getslideopts(), opts._remainingtimeout ); opts.api.trigger('cycle-resumed', [ opts, opts._remainingtimeout ] ).log('cycle-resumed'); } }, add: function( slides, prepend ) { var opts = this.opts(); var oldslidecount = opts.slidecount; var startslideshow = false; var len; if ( $.type(slides) == 'string') slides = $.trim( slides ); $( slides ).each(function(i) { var slideopts; var slide = $(this); if ( prepend ) opts.container.prepend( slide ); else opts.container.append( slide ); opts.slidecount++; slideopts = opts.api.buildslideopts( slide ); if ( prepend ) opts.slides = $( slide ).add( opts.slides ); else opts.slides = opts.slides.add( slide ); opts.api.initslide( slideopts, slide, --opts._maxz ); slide.data('cycle.opts', slideopts); opts.api.trigger('cycle-slide-added', [ opts, slideopts, slide ]); }); opts.api.updateview( true ); startslideshow = opts._preinitialized && (oldslidecount < 2 && opts.slidecount >= 1); if ( startslideshow ) { if ( !opts._initialized ) opts.api.initslideshow(); else if ( opts.timeout ) { len = opts.slides.length; opts.nextslide = opts.reverse ? len - 1 : 1; if ( !opts.timeoutid ) { opts.api.queuetransition( opts ); } } } }, calcfirstslide: function() { var opts = this.opts(); var firstslideindex; firstslideindex = parseint( opts.startingslide || 0, 10 ); if (firstslideindex >= opts.slides.length || firstslideindex < 0) firstslideindex = 0; opts.currslide = firstslideindex; if ( opts.reverse ) { opts.nextslide = firstslideindex - 1; if (opts.nextslide < 0) opts.nextslide = opts.slides.length - 1; } else { opts.nextslide = firstslideindex + 1; if (opts.nextslide == opts.slides.length) opts.nextslide = 0; } }, calcnextslide: function() { var opts = this.opts(); var roll; if ( opts.reverse ) { roll = (opts.nextslide - 1) < 0; opts.nextslide = roll ? opts.slidecount - 1 : opts.nextslide-1; opts.currslide = roll ? 0 : opts.nextslide+1; } else { roll = (opts.nextslide + 1) == opts.slides.length; opts.nextslide = roll ? 0 : opts.nextslide+1; opts.currslide = roll ? opts.slides.length-1 : opts.nextslide-1; } }, calctx: function( slideopts, manual ) { var opts = slideopts; var tx; if ( opts._tempfx ) tx = $.fn.cycle.transitions[opts._tempfx]; else if ( manual && opts.manualfx ) tx = $.fn.cycle.transitions[opts.manualfx]; if ( !tx ) tx = $.fn.cycle.transitions[opts.fx]; opts._tempfx = null; this.opts()._tempfx = null; if (!tx) { tx = $.fn.cycle.transitions.fade; opts.api.log('transition "' + opts.fx + '" not found. using fade.'); } return tx; }, preparetx: function( manual, fwd ) { var opts = this.opts(); var after, curr, next, slideopts, tx; if ( opts.slidecount < 2 ) { opts.timeoutid = 0; return; } if ( manual && ( !opts.busy || opts.manualtrump ) ) { opts.api.stoptransition(); opts.busy = false; cleartimeout(opts.timeoutid); opts.timeoutid = 0; } if ( opts.busy ) return; if ( opts.timeoutid === 0 && !manual ) return; curr = opts.slides[opts.currslide]; next = opts.slides[opts.nextslide]; slideopts = opts.api.getslideopts( opts.nextslide ); tx = opts.api.calctx( slideopts, manual ); opts._tx = tx; if ( manual && slideopts.manualspeed !== undefined ) slideopts.speed = slideopts.manualspeed; // if ( opts.nextslide === opts.currslide ) // opts.api.calcnextslide(); // ensure that: // 1. advancing to a different slide // 2. this is either a manual event (prev/next, pager, cmd) or // a timer event and slideshow is not paused if ( opts.nextslide != opts.currslide && (manual || (!opts.paused && !opts.hoverpaused && opts.timeout) )) { // #62 opts.api.trigger('cycle-before', [ slideopts, curr, next, fwd ]); if ( tx.before ) tx.before( slideopts, curr, next, fwd ); after = function() { opts.busy = false; // #76; bail if slideshow has been destroyed if (! opts.container.data( 'cycle.opts' ) ) return; if (tx.after) tx.after( slideopts, curr, next, fwd ); opts.api.trigger('cycle-after', [ slideopts, curr, next, fwd ]); opts.api.queuetransition( slideopts); opts.api.updateview( true ); }; opts.busy = true; if (tx.transition) tx.transition(slideopts, curr, next, fwd, after); else opts.api.dotransition( slideopts, curr, next, fwd, after); opts.api.calcnextslide(); opts.api.updateview(); } else { opts.api.queuetransition( slideopts ); } }, // perform the actual animation dotransition: function( slideopts, currel, nextel, fwd, callback) { var opts = slideopts; var curr = $(currel), next = $(nextel); var fn = function() { // make sure animin has something so that callback doesn't trigger immediately next.animate(opts.animin || { opacity: 1}, opts.speed, opts.easein || opts.easing, callback); }; next.css(opts.cssbefore || {}); curr.animate(opts.animout || {}, opts.speed, opts.easeout || opts.easing, function() { curr.css(opts.cssafter || {}); if (!opts.sync) { fn(); } }); if (opts.sync) { fn(); } }, queuetransition: function( slideopts, specifictimeout ) { var opts = this.opts(); var timeout = specifictimeout !== undefined ? specifictimeout : slideopts.timeout; if (opts.nextslide === 0 && --opts.loop === 0) { opts.api.log('terminating; loop=0'); opts.timeout = 0; if ( timeout ) { settimeout(function() { opts.api.trigger('cycle-finished', [ opts ]); }, timeout); } else { opts.api.trigger('cycle-finished', [ opts ]); } // reset nextslide opts.nextslide = opts.currslide; return; } if ( opts.continueauto !== undefined ) { if ( opts.continueauto === false || ($.isfunction(opts.continueauto) && opts.continueauto() === false )) { opts.api.log('terminating automatic transitions'); opts.timeout = 0; if ( opts.timeoutid ) cleartimeout(opts.timeoutid); return; } } if ( timeout ) { opts._lastqueue = $.now(); if ( specifictimeout === undefined ) opts._remainingtimeout = slideopts.timeout; if ( !opts.paused && ! opts.hoverpaused ) { opts.timeoutid = settimeout(function() { opts.api.preparetx( false, !opts.reverse ); }, timeout ); } } }, stoptransition: function() { var opts = this.opts(); if ( opts.slides.filter(':animated').length ) { opts.slides.stop(false, true); opts.api.trigger('cycle-transition-stopped', [ opts ]); } if ( opts._tx && opts._tx.stoptransition ) opts._tx.stoptransition( opts ); }, // advance slide forward or back advanceslide: function( val ) { var opts = this.opts(); cleartimeout(opts.timeoutid); opts.timeoutid = 0; opts.nextslide = opts.currslide + val; if (opts.nextslide < 0) opts.nextslide = opts.slides.length - 1; else if (opts.nextslide >= opts.slides.length) opts.nextslide = 0; opts.api.preparetx( true, val >= 0 ); return false; }, buildslideopts: function( slide ) { var opts = this.opts(); var val, shortname; var slideopts = slide.data() || {}; for (var p in slideopts) { // allow props to be accessed sans 'cycle' prefix and log the overrides if (slideopts.hasownproperty(p) && /^cycle[a-z]+/.test(p) ) { val = slideopts[p]; shortname = p.match(/^cycle(.*)/)[1].replace(/^[a-z]/, lowercase); opts.api.log('['+(opts.slidecount-1)+']', shortname+':', val, '('+typeof val +')'); slideopts[shortname] = val; } } slideopts = $.extend( {}, $.fn.cycle.defaults, opts, slideopts ); slideopts.slidenum = opts.slidecount; try { // these props should always be read from the master state object delete slideopts.api; delete slideopts.slidecount; delete slideopts.currslide; delete slideopts.nextslide; delete slideopts.slides; } catch(e) { // no op } return slideopts; }, getslideopts: function( index ) { var opts = this.opts(); if ( index === undefined ) index = opts.currslide; var slide = opts.slides[index]; var slideopts = $(slide).data('cycle.opts'); return $.extend( {}, opts, slideopts ); }, initslide: function( slideopts, slide, suggestedzindex ) { var opts = this.opts(); slide.css( slideopts.slidecss || {} ); if ( suggestedzindex > 0 ) slide.css( 'zindex', suggestedzindex ); // ensure that speed settings are sane if ( isnan( slideopts.speed ) ) slideopts.speed = $.fx.speeds[slideopts.speed] || $.fx.speeds._default; if ( !slideopts.sync ) slideopts.speed = slideopts.speed / 2; slide.addclass( opts.slideclass ); }, updateview: function( isafter, isduring, forceevent ) { var opts = this.opts(); if ( !opts._initialized ) return; var slideopts = opts.api.getslideopts(); var currslide = opts.slides[ opts.currslide ]; if ( ! isafter && isduring !== true ) { opts.api.trigger('cycle-update-view-before', [ opts, slideopts, currslide ]); if ( opts.updateview < 0 ) return; } if ( opts.slideactiveclass ) { opts.slides.removeclass( opts.slideactiveclass ) .eq( opts.currslide ).addclass( opts.slideactiveclass ); } if ( isafter && opts.hidenonactive ) opts.slides.filter( ':not(.' + opts.slideactiveclass + ')' ).css('visibility', 'hidden'); if ( opts.updateview === 0 ) { settimeout(function() { opts.api.trigger('cycle-update-view', [ opts, slideopts, currslide, isafter ]); }, slideopts.speed / (opts.sync ? 2 : 1) ); } if ( opts.updateview !== 0 ) opts.api.trigger('cycle-update-view', [ opts, slideopts, currslide, isafter ]); if ( isafter ) opts.api.trigger('cycle-update-view-after', [ opts, slideopts, currslide ]); }, getcomponent: function( name ) { var opts = this.opts(); var selector = opts[name]; if (typeof selector === 'string') { // if selector is a child, sibling combinator, adjancent selector then use find, otherwise query full dom return (/^\s*[\>|\+|~]/).test( selector ) ? opts.container.find( selector ) : $( selector ); } if (selector.jquery) return selector; return $(selector); }, stackslides: function( curr, next, fwd ) { var opts = this.opts(); if ( !curr ) { curr = opts.slides[opts.currslide]; next = opts.slides[opts.nextslide]; fwd = !opts.reverse; } // reset the zindex for the common case: // curr slide on top, next slide beneath, and the rest in order to be shown $(curr).css('zindex', opts.maxz); var i; var z = opts.maxz - 2; var len = opts.slidecount; if (fwd) { for ( i = opts.currslide + 1; i < len; i++ ) $( opts.slides[i] ).css( 'zindex', z-- ); for ( i = 0; i < opts.currslide; i++ ) $( opts.slides[i] ).css( 'zindex', z-- ); } else { for ( i = opts.currslide - 1; i >= 0; i-- ) $( opts.slides[i] ).css( 'zindex', z-- ); for ( i = len - 1; i > opts.currslide; i-- ) $( opts.slides[i] ).css( 'zindex', z-- ); } $(next).css('zindex', opts.maxz - 1); }, getslideindex: function( el ) { return this.opts().slides.index( el ); } }; // api // default logger $.fn.cycle.log = function log() { /*global console:true */ if (window.console && console.log) console.log('[cycle2] ' + array.prototype.join.call(arguments, ' ') ); }; $.fn.cycle.version = function() { return 'cycle2: ' + version; }; // helper functions function lowercase(s) { return (s || '').tolowercase(); } // expose transition object $.fn.cycle.transitions = { custom: { }, none: { before: function( opts, curr, next, fwd ) { opts.api.stackslides( next, curr, fwd ); opts.cssbefore = { opacity: 1, visibility: 'visible', display: 'block' }; } }, fade: { before: function( opts, curr, next, fwd ) { var css = opts.api.getslideopts( opts.nextslide ).slidecss || {}; opts.api.stackslides( curr, next, fwd ); opts.cssbefore = $.extend(css, { opacity: 0, visibility: 'visible', display: 'block' }); opts.animin = { opacity: 1 }; opts.animout = { opacity: 0 }; } }, fadeout: { before: function( opts , curr, next, fwd ) { var css = opts.api.getslideopts( opts.nextslide ).slidecss || {}; opts.api.stackslides( curr, next, fwd ); opts.cssbefore = $.extend(css, { opacity: 1, visibility: 'visible', display: 'block' }); opts.animout = { opacity: 0 }; } }, scrollhorz: { before: function( opts, curr, next, fwd ) { opts.api.stackslides( curr, next, fwd ); var w = opts.container.css('overflow','hidden').width(); opts.cssbefore = { left: fwd ? w : - w, top: 0, opacity: 1, visibility: 'visible', display: 'block' }; opts.cssafter = { zindex: opts._maxz - 2, left: 0 }; opts.animin = { left: 0 }; opts.animout = { left: fwd ? -w : w }; } } }; // @see: http://jquery.malsup.com/cycle2/api $.fn.cycle.defaults = { allowwrap: true, autoselector: '.cycle-slideshow[data-cycle-auto-init!=false]', delay: 0, easing: null, fx: 'fade', hidenonactive: true, loop: 0, manualfx: undefined, manualspeed: undefined, manualtrump: true, maxz: 100, pauseonhover: false, reverse: false, slideactiveclass: 'cycle-slide-active', slideclass: 'cycle-slide', slidecss: { position: 'absolute', top: 0, left: 0 }, slides: '> img', speed: 500, startingslide: 0, sync: true, timeout: 4000, updateview: 0 }; // automatically find and run slideshows $(document).ready(function() { $( $.fn.cycle.defaults.autoselector ).cycle(); }); })(jquery); /*! cycle2 autoheight plugin; copyright (c) m.alsup, 2012; version: 20130913 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { autoheight: 0, // setting this option to false disables autoheight logic autoheightspeed: 250, autoheighteasing: null }); $(document).on( 'cycle-initialized', function( e, opts ) { var autoheight = opts.autoheight; var t = $.type( autoheight ); var resizethrottle = null; var ratio; if ( t !== 'string' && t !== 'number' ) return; // bind events opts.container.on( 'cycle-slide-added cycle-slide-removed', initautoheight ); opts.container.on( 'cycle-destroyed', ondestroy ); if ( autoheight == 'container' ) { opts.container.on( 'cycle-before', onbefore ); } else if ( t === 'string' && /\d+\:\d+/.test( autoheight ) ) { // use ratio ratio = autoheight.match(/(\d+)\:(\d+)/); ratio = ratio[1] / ratio[2]; opts._autoheightratio = ratio; } // if autoheight is a number then we don't need to recalculate the sentinel // index on resize if ( t !== 'number' ) { // bind unique resize handler per slideshow (so it can be 'off-ed' in ondestroy) opts._autoheightonresize = function () { cleartimeout( resizethrottle ); resizethrottle = settimeout( onresize, 50 ); }; $(window).on( 'resize orientationchange', opts._autoheightonresize ); } settimeout( onresize, 30 ); function onresize() { initautoheight( e, opts ); } }); function initautoheight( e, opts ) { var clone, height, sentinelindex; var autoheight = opts.autoheight; if ( autoheight == 'container' ) { height = $( opts.slides[ opts.currslide ] ).outerheight(); opts.container.height( height ); } else if ( opts._autoheightratio ) { opts.container.height( opts.container.width() / opts._autoheightratio ); } else if ( autoheight === 'calc' || ( $.type( autoheight ) == 'number' && autoheight >= 0 ) ) { if ( autoheight === 'calc' ) sentinelindex = calcsentinelindex( e, opts ); else if ( autoheight >= opts.slides.length ) sentinelindex = 0; else sentinelindex = autoheight; // only recreate sentinel if index is different if ( sentinelindex == opts._sentinelindex ) return; opts._sentinelindex = sentinelindex; if ( opts._sentinel ) opts._sentinel.remove(); // clone existing slide as sentinel clone = $( opts.slides[ sentinelindex ].clonenode(true) ); // #50; remove special attributes from cloned content clone.removeattr( 'id name rel' ).find( '[id],[name],[rel]' ).removeattr( 'id name rel' ); clone.css({ position: 'static', visibility: 'hidden', display: 'block' }).prependto( opts.container ).addclass('cycle-sentinel cycle-slide').removeclass('cycle-slide-active'); clone.find( '*' ).css( 'visibility', 'hidden' ); opts._sentinel = clone; } } function calcsentinelindex( e, opts ) { var index = 0, max = -1; // calculate tallest slide index opts.slides.each(function(i) { var h = $(this).height(); if ( h > max ) { max = h; index = i; } }); return index; } function onbefore( e, opts, outgoing, incoming, forward ) { var h = $(incoming).outerheight(); opts.container.animate( { height: h }, opts.autoheightspeed, opts.autoheighteasing ); } function ondestroy( e, opts ) { if ( opts._autoheightonresize ) { $(window).off( 'resize orientationchange', opts._autoheightonresize ); opts._autoheightonresize = null; } opts.container.off( 'cycle-slide-added cycle-slide-removed', initautoheight ); opts.container.off( 'cycle-destroyed', ondestroy ); opts.container.off( 'cycle-before', onbefore ); if ( opts._sentinel ) { opts._sentinel.remove(); opts._sentinel = null; } } })(jquery); /*! caption plugin for cycle2; version: 20130306 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { caption: '> .cycle-caption', captiontemplate: '{{slidenum}} / {{slidecount}}', overlay: '> .cycle-overlay', overlaytemplate: '
{{title}}
{{desc}}
', captionmodule: 'caption' }); $(document).on( 'cycle-update-view', function( e, opts, slideopts, currslide ) { if ( opts.captionmodule !== 'caption' ) return; var el; $.each(['caption','overlay'], function() { var name = this; var template = slideopts[name+'template']; var el = opts.api.getcomponent( name ); if( el.length && template ) { el.html( opts.api.tmpl( template, slideopts, opts, currslide ) ); el.show(); } else { el.hide(); } }); }); $(document).on( 'cycle-destroyed', function( e, opts ) { var el; $.each(['caption','overlay'], function() { var name = this, template = opts[name+'template']; if ( opts[name] && template ) { el = opts.api.getcomponent( 'caption' ); el.empty(); } }); }); })(jquery); /*! command plugin for cycle2; version: 20140415 */ (function($) { "use strict"; var c2 = $.fn.cycle; $.fn.cycle = function( options ) { var cmd, cmdfn, opts; var args = $.makearray( arguments ); if ( $.type( options ) == 'number' ) { return this.cycle( 'goto', options ); } if ( $.type( options ) == 'string' ) { return this.each(function() { var cmdargs; cmd = options; opts = $(this).data('cycle.opts'); if ( opts === undefined ) { c2.log('slideshow must be initialized before sending commands; "' + cmd + '" ignored'); return; } else { cmd = cmd == 'goto' ? 'jump' : cmd; // issue #3; change 'goto' to 'jump' internally cmdfn = opts.api[ cmd ]; if ( $.isfunction( cmdfn )) { cmdargs = $.makearray( args ); cmdargs.shift(); return cmdfn.apply( opts.api, cmdargs ); } else { c2.log( 'unknown command: ', cmd ); } } }); } else { return c2.apply( this, arguments ); } }; // copy props $.extend( $.fn.cycle, c2 ); $.extend( c2.api, { next: function() { var opts = this.opts(); if ( opts.busy && ! opts.manualtrump ) return; var count = opts.reverse ? -1 : 1; if ( opts.allowwrap === false && ( opts.currslide + count ) >= opts.slidecount ) return; opts.api.advanceslide( count ); opts.api.trigger('cycle-next', [ opts ]).log('cycle-next'); }, prev: function() { var opts = this.opts(); if ( opts.busy && ! opts.manualtrump ) return; var count = opts.reverse ? 1 : -1; if ( opts.allowwrap === false && ( opts.currslide + count ) < 0 ) return; opts.api.advanceslide( count ); opts.api.trigger('cycle-prev', [ opts ]).log('cycle-prev'); }, destroy: function() { this.stop(); //#204 var opts = this.opts(); var clean = $.isfunction( $._data ) ? $._data : $.noop; // hack for #184 and #201 cleartimeout(opts.timeoutid); opts.timeoutid = 0; opts.api.stop(); opts.api.trigger( 'cycle-destroyed', [ opts ] ).log('cycle-destroyed'); opts.container.removedata(); clean( opts.container[0], 'parsedattrs', false ); // #75; remove inline styles if ( ! opts.retainstylesondestroy ) { opts.container.removeattr( 'style' ); opts.slides.removeattr( 'style' ); opts.slides.removeclass( opts.slideactiveclass ); } opts.slides.each(function() { var slide = $(this); slide.removedata(); slide.removeclass( opts.slideclass ); clean( this, 'parsedattrs', false ); }); }, jump: function( index, fx ) { // go to the requested slide var fwd; var opts = this.opts(); if ( opts.busy && ! opts.manualtrump ) return; var num = parseint( index, 10 ); if (isnan(num) || num < 0 || num >= opts.slides.length) { opts.api.log('goto: invalid slide index: ' + num); return; } if (num == opts.currslide) { opts.api.log('goto: skipping, already on slide', num); return; } opts.nextslide = num; cleartimeout(opts.timeoutid); opts.timeoutid = 0; opts.api.log('goto: ', num, ' (zero-index)'); fwd = opts.currslide < opts.nextslide; opts._tempfx = fx; opts.api.preparetx( true, fwd ); }, stop: function() { var opts = this.opts(); var pauseobj = opts.container; cleartimeout(opts.timeoutid); opts.timeoutid = 0; opts.api.stoptransition(); if ( opts.pauseonhover ) { if ( opts.pauseonhover !== true ) pauseobj = $( opts.pauseonhover ); pauseobj.off('mouseenter mouseleave'); } opts.api.trigger('cycle-stopped', [ opts ]).log('cycle-stopped'); }, reinit: function() { var opts = this.opts(); opts.api.destroy(); opts.container.cycle(); }, remove: function( index ) { var opts = this.opts(); var slide, slidetoremove, slides = [], slidenum = 1; for ( var i=0; i < opts.slides.length; i++ ) { slide = opts.slides[i]; if ( i == index ) { slidetoremove = slide; } else { slides.push( slide ); $( slide ).data('cycle.opts').slidenum = slidenum; slidenum++; } } if ( slidetoremove ) { opts.slides = $( slides ); opts.slidecount--; $( slidetoremove ).remove(); if (index == opts.currslide) opts.api.advanceslide( 1 ); else if ( index < opts.currslide ) opts.currslide--; else opts.currslide++; opts.api.trigger('cycle-slide-removed', [ opts, index, slidetoremove ]).log('cycle-slide-removed'); opts.api.updateview(); } } }); // listen for clicks on elements with data-cycle-cmd attribute $(document).on('click.cycle', '[data-cycle-cmd]', function(e) { // issue cycle command e.preventdefault(); var el = $(this); var command = el.data('cycle-cmd'); var context = el.data('cycle-context') || '.cycle-slideshow'; $(context).cycle(command, el.data('cycle-arg')); }); })(jquery); /*! hash plugin for cycle2; version: 20130905 */ (function($) { "use strict"; $(document).on( 'cycle-pre-initialize', function( e, opts ) { onhashchange( opts, true ); opts._onhashchange = function() { onhashchange( opts, false ); }; $( window ).on( 'hashchange', opts._onhashchange); }); $(document).on( 'cycle-update-view', function( e, opts, slideopts ) { if ( slideopts.hash && ( '#' + slideopts.hash ) != window.location.hash ) { opts._hashfence = true; window.location.hash = slideopts.hash; } }); $(document).on( 'cycle-destroyed', function( e, opts) { if ( opts._onhashchange ) { $( window ).off( 'hashchange', opts._onhashchange ); } }); function onhashchange( opts, setstartingslide ) { var hash; if ( opts._hashfence ) { opts._hashfence = false; return; } hash = window.location.hash.substring(1); opts.slides.each(function(i) { if ( $(this).data( 'cycle-hash' ) == hash ) { if ( setstartingslide === true ) { opts.startingslide = i; } else { var fwd = opts.currslide < i; opts.nextslide = i; opts.api.preparetx( true, fwd ); } return false; } }); } })(jquery); /*! loader plugin for cycle2; version: 20131121 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { loader: false }); $(document).on( 'cycle-bootstrap', function( e, opts ) { var addfn; if ( !opts.loader ) return; // override api.add for this slideshow addfn = opts.api.add; opts.api.add = add; function add( slides, prepend ) { var slidearr = []; if ( $.type( slides ) == 'string' ) slides = $.trim( slides ); else if ( $.type( slides) === 'array' ) { for (var i=0; i < slides.length; i++ ) slides[i] = $(slides[i])[0]; } slides = $( slides ); var slidecount = slides.length; if ( ! slidecount ) return; slides.css('visibility','hidden').appendto('body').each(function(i) { // appendto fixes #56 var count = 0; var slide = $(this); var images = slide.is('img') ? slide : slide.find('img'); slide.data('index', i); // allow some images to be marked as unimportant (and filter out images w/o src value) images = images.filter(':not(.cycle-loader-ignore)').filter(':not([src=""])'); if ( ! images.length ) { --slidecount; slidearr.push( slide ); return; } count = images.length; images.each(function() { // add images that are already loaded if ( this.complete ) { imageloaded(); } else { $(this).load(function() { imageloaded(); }).on("error", function() { if ( --count === 0 ) { // ignore this slide opts.api.log('slide skipped; img not loaded:', this.src); if ( --slidecount === 0 && opts.loader == 'wait') { addfn.apply( opts.api, [ slidearr, prepend ] ); } } }); } }); function imageloaded() { if ( --count === 0 ) { --slidecount; addslide( slide ); } } }); if ( slidecount ) opts.container.addclass('cycle-loading'); function addslide( slide ) { var curr; if ( opts.loader == 'wait' ) { slidearr.push( slide ); if ( slidecount === 0 ) { // #59; sort slides into original markup order slidearr.sort( sorter ); addfn.apply( opts.api, [ slidearr, prepend ] ); opts.container.removeclass('cycle-loading'); } } else { curr = $(opts.slides[opts.currslide]); addfn.apply( opts.api, [ slide, prepend ] ); curr.show(); opts.container.removeclass('cycle-loading'); } } function sorter(a, b) { return a.data('index') - b.data('index'); } } }); })(jquery); /*! pager plugin for cycle2; version: 20140415 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { pager: '> .cycle-pager', pageractiveclass: 'cycle-pager-active', pagerevent: 'click.cycle', pagereventbubble: undefined, pagertemplate: '' }); $(document).on( 'cycle-bootstrap', function( e, opts, api ) { // add method to api api.buildpagerlink = buildpagerlink; }); $(document).on( 'cycle-slide-added', function( e, opts, slideopts, slideadded ) { if ( opts.pager ) { opts.api.buildpagerlink ( opts, slideopts, slideadded ); opts.api.page = page; } }); $(document).on( 'cycle-slide-removed', function( e, opts, index, slideremoved ) { if ( opts.pager ) { var pagers = opts.api.getcomponent( 'pager' ); pagers.each(function() { var pager = $(this); $( pager.children()[index] ).remove(); }); } }); $(document).on( 'cycle-update-view', function( e, opts, slideopts ) { var pagers; if ( opts.pager ) { pagers = opts.api.getcomponent( 'pager' ); pagers.each(function() { $(this).children().removeclass( opts.pageractiveclass ) .eq( opts.currslide ).addclass( opts.pageractiveclass ); }); } }); $(document).on( 'cycle-destroyed', function( e, opts ) { var pager = opts.api.getcomponent( 'pager' ); if ( pager ) { pager.children().off( opts.pagerevent ); // #202 if ( opts.pagertemplate ) pager.empty(); } }); function buildpagerlink( opts, slideopts, slide ) { var pagerlink; var pagers = opts.api.getcomponent( 'pager' ); pagers.each(function() { var pager = $(this); if ( slideopts.pagertemplate ) { var markup = opts.api.tmpl( slideopts.pagertemplate, slideopts, opts, slide[0] ); pagerlink = $( markup ).appendto( pager ); } else { pagerlink = pager.children().eq( opts.slidecount - 1 ); } pagerlink.on( opts.pagerevent, function(e) { if ( ! opts.pagereventbubble ) e.preventdefault(); opts.api.page( pager, e.currenttarget); }); }); } function page( pager, target ) { /*jshint validthis:true */ var opts = this.opts(); if ( opts.busy && ! opts.manualtrump ) return; var index = pager.children().index( target ); var nextslide = index; var fwd = opts.currslide < nextslide; if (opts.currslide == nextslide) { return; // no op, clicked pager for the currently displayed slide } opts.nextslide = nextslide; opts._tempfx = opts.pagerfx; opts.api.preparetx( true, fwd ); opts.api.trigger('cycle-pager-activated', [opts, pager, target ]); } })(jquery); /*! prevnext plugin for cycle2; version: 20140408 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { next: '> .cycle-next', nextevent: 'click.cycle', disabledclass: 'disabled', prev: '> .cycle-prev', prevevent: 'click.cycle', swipe: false }); $(document).on( 'cycle-initialized', function( e, opts ) { opts.api.getcomponent( 'next' ).on( opts.nextevent, function(e) { e.preventdefault(); opts.api.next(); }); opts.api.getcomponent( 'prev' ).on( opts.prevevent, function(e) { e.preventdefault(); opts.api.prev(); }); if ( opts.swipe ) { var nextevent = opts.swipevert ? 'swipeup.cycle' : 'swipeleft.cycle swipeleft.cycle'; var prevevent = opts.swipevert ? 'swipedown.cycle' : 'swiperight.cycle swiperight.cycle'; opts.container.on( nextevent, function(e) { opts._tempfx = opts.swipefx; opts.api.next(); }); opts.container.on( prevevent, function() { opts._tempfx = opts.swipefx; opts.api.prev(); }); } }); $(document).on( 'cycle-update-view', function( e, opts, slideopts, currslide ) { if ( opts.allowwrap ) return; var cls = opts.disabledclass; var next = opts.api.getcomponent( 'next' ); var prev = opts.api.getcomponent( 'prev' ); var prevboundry = opts._prevboundry || 0; var nextboundry = (opts._nextboundry !== undefined)?opts._nextboundry:opts.slidecount - 1; if ( opts.currslide == nextboundry ) next.addclass( cls ).prop( 'disabled', true ); else next.removeclass( cls ).prop( 'disabled', false ); if ( opts.currslide === prevboundry ) prev.addclass( cls ).prop( 'disabled', true ); else prev.removeclass( cls ).prop( 'disabled', false ); }); $(document).on( 'cycle-destroyed', function( e, opts ) { opts.api.getcomponent( 'prev' ).off( opts.nextevent ); opts.api.getcomponent( 'next' ).off( opts.prevevent ); opts.container.off( 'swipeleft.cycle swiperight.cycle swipeleft.cycle swiperight.cycle swipeup.cycle swipedown.cycle' ); }); })(jquery); /*! progressive loader plugin for cycle2; version: 20130315 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { progressive: false }); $(document).on( 'cycle-pre-initialize', function( e, opts ) { if ( !opts.progressive ) return; var api = opts.api; var nextfn = api.next; var prevfn = api.prev; var preparetxfn = api.preparetx; var type = $.type( opts.progressive ); var slides, scriptel; if ( type == 'array' ) { slides = opts.progressive; } else if ($.isfunction( opts.progressive ) ) { slides = opts.progressive( opts ); } else if ( type == 'string' ) { scriptel = $( opts.progressive ); slides = $.trim( scriptel.html() ); if ( !slides ) return; // is it json array? if ( /^(\[)/.test( slides ) ) { try { slides = $.parsejson( slides ); } catch(err) { api.log( 'error parsing progressive slides', err ); return; } } else { // plain text, split on delimeter slides = slides.split( new regexp( scriptel.data('cycle-split') || '\n') ); // #95; look for empty slide if ( ! slides[ slides.length - 1 ] ) slides.pop(); } } if ( preparetxfn ) { api.preparetx = function( manual, fwd ) { var index, slide; if ( manual || slides.length === 0 ) { preparetxfn.apply( opts.api, [ manual, fwd ] ); return; } if ( fwd && opts.currslide == ( opts.slidecount-1) ) { slide = slides[ 0 ]; slides = slides.slice( 1 ); opts.container.one('cycle-slide-added', function(e, opts ) { settimeout(function() { opts.api.advanceslide( 1 ); },50); }); opts.api.add( slide ); } else if ( !fwd && opts.currslide === 0 ) { index = slides.length-1; slide = slides[ index ]; slides = slides.slice( 0, index ); opts.container.one('cycle-slide-added', function(e, opts ) { settimeout(function() { opts.currslide = 1; opts.api.advanceslide( -1 ); },50); }); opts.api.add( slide, true ); } else { preparetxfn.apply( opts.api, [ manual, fwd ] ); } }; } if ( nextfn ) { api.next = function() { var opts = this.opts(); if ( slides.length && opts.currslide == ( opts.slidecount - 1 ) ) { var slide = slides[ 0 ]; slides = slides.slice( 1 ); opts.container.one('cycle-slide-added', function(e, opts ) { nextfn.apply( opts.api ); opts.container.removeclass('cycle-loading'); }); opts.container.addclass('cycle-loading'); opts.api.add( slide ); } else { nextfn.apply( opts.api ); } }; } if ( prevfn ) { api.prev = function() { var opts = this.opts(); if ( slides.length && opts.currslide === 0 ) { var index = slides.length-1; var slide = slides[ index ]; slides = slides.slice( 0, index ); opts.container.one('cycle-slide-added', function(e, opts ) { opts.currslide = 1; opts.api.advanceslide( -1 ); opts.container.removeclass('cycle-loading'); }); opts.container.addclass('cycle-loading'); opts.api.add( slide, true ); } else { prevfn.apply( opts.api ); } }; } }); })(jquery); /*! tmpl plugin for cycle2; version: 20121227 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { tmplregex: '{{((.)?.*?)}}' }); $.extend($.fn.cycle.api, { tmpl: function( str, opts /*, ... */) { var regex = new regexp( opts.tmplregex || $.fn.cycle.defaults.tmplregex, 'g' ); var args = $.makearray( arguments ); args.shift(); return str.replace(regex, function(_, str) { var i, j, obj, prop, names = str.split('.'); for (i=0; i < args.length; i++) { obj = args[i]; if ( ! obj ) continue; if (names.length > 1) { prop = obj; for (j=0; j < names.length; j++) { obj = prop; prop = prop[ names[j] ] || str; } } else { prop = obj[str]; } if ($.isfunction(prop)) return prop.apply(obj, args); if (prop !== undefined && prop !== null && prop != str) return prop; } return str; }); } }); })(jquery); /*scrollto*/ function todouble(n){ if(n<10){ return '0'+n; }else{ return ''+n; } } function tick(){ var odate=new date(); var show_day=new array('星期日','星期一','星期二','星期三','星期四','星期五','星期六'); var day=parseint(odate.getday()); /* var str=odate.getfullyear()+"年" +(odate.getmonth()+1)+'月' +odate.getdate()+'日 ' +todouble(odate.gethours())+":" +todouble(odate.getminutes())+":" +todouble(odate.getseconds())+" " +show_day[day];*/ var str= odate.getfullyear()+"年" +todouble(odate.getmonth()+1)+'月' +todouble(odate.getdate())+'日 ' +show_day[day]; $('#time').text(str); } setinterval(tick,1000); tick(); /*superslide*/ !function(a){a.fn.slide=function(b){return a.fn.slide.defaults={type:"slide",effect:"fade",autoplay:!1,delaytime:500,intertime:2500,triggertime:150,defaultindex:0,titcell:".hd li",maincell:".bd",targetcell:null,trigger:"mouseover",scroll:1,vis:1,titonclassname:"on",autopage:!1,prevcell:".prev",nextcell:".next",pagestatecell:".pagestate",opp:!1,pnloop:!0,easing:"swing",startfun:null,endfun:null,switchload:null,playstatecell:".playstate",mouseoverstop:!0,defaultplay:!0,returndefault:!1},this.each(function(){var c=a.extend({},a.fn.slide.defaults,b),d=a(this),e=c.effect,f=a(c.prevcell,d),g=a(c.nextcell,d),h=a(c.pagestatecell,d),i=a(c.playstatecell,d),j=a(c.titcell,d),k=j.size(),l=a(c.maincell,d),m=l.children().size(),n=c.switchload,o=a(c.targetcell,d),p=parseint(c.defaultindex),q=parseint(c.delaytime),r=parseint(c.intertime);parseint(c.triggertime);var q,t=parseint(c.scroll),u=parseint(c.vis),v="false"==c.autoplay||0==c.autoplay?!1:!0,w="false"==c.opp||0==c.opp?!1:!0,x="false"==c.autopage||0==c.autopage?!1:!0,y="false"==c.pnloop||0==c.pnloop?!1:!0,z="false"==c.mouseoverstop||0==c.mouseoverstop?!1:!0,a="false"==c.defaultplay||0==c.defaultplay?!1:!0,b="false"==c.returndefault||0==c.returndefault?!1:!0,c=0,d=0,e=0,f=0,g=c.easing,h=null,i=null,j=null,k=c.titonclassname,l=j.index(d.find("."+k)),m=p=-1==l?p:l,n=p,o=p,p=m>=u?0!=m%t?m%t:t:0,r="leftmarquee"==e||"topmarquee"==e?!0:!1,s=function(){a.isfunction(c.startfun)&&c.startfun(p,k,d,a(c.titcell,d),l,o,f,g)},t=function(){a.isfunction(c.endfun)&&c.endfun(p,k,d,a(c.titcell,d),l,o,f,g)},u=function(){j.removeclass(k),a&&j.eq(n).addclass(k)};if("menu"==c.type)return a&&j.removeclass(k).eq(p).addclass(k),j.hover(function(){q=a(this).find(c.targetcell);var b=j.index(a(this));i=settimeout(function(){switch(p=b,j.removeclass(k).eq(p).addclass(k),s(),e){case"fade":q.stop(!0,!0).animate({opacity:"show"},q,g,t);break;case"slidedown":q.stop(!0,!0).animate({height:"show"},q,g,t)}},c.triggertime)},function(){switch(cleartimeout(i),e){case"fade":q.animate({opacity:"hide"},q,g);break;case"slidedown":q.animate({height:"hide"},q,g)}}),b&&d.hover(function(){cleartimeout(j)},function(){j=settimeout(u,q)}),void 0;if(0==k&&(k=m),r&&(k=2),x){if(m>=u)if("leftloop"==e||"toploop"==e)k=0!=m%t?(0^m/t)+1:m/t;else{var v=m-u;k=1+parseint(0!=v%t?v/t+1:v/t),0>=k&&(k=1)}else k=1;j.html("");var w="";if(1==c.autopage||"true"==c.autopage)for(var x=0;k>x;x++)w+="
  • "+(x+1)+"
  • ";else for(var x=0;k>x;x++)w+=c.autopage.replace("$",x+1);j.html(w);var j=j.children()}if(m>=u){l.children().each(function(){a(this).width()>e&&(e=a(this).width(),d=a(this).outerwidth(!0)),a(this).height()>f&&(f=a(this).height(),c=a(this).outerheight(!0))});var y=l.children(),z=function(){for(var a=0;u>a;a++)y.eq(a).clone().addclass("clone").appendto(l);for(var a=0;p>a;a++)y.eq(m-a-1).clone().addclass("clone").prependto(l)};switch(e){case"fold":l.css({position:"relative",width:d,height:c}).children().css({position:"absolute",width:e,left:0,top:0,display:"none"});break;case"top":l.wrap('
    ').css({top:-(p*t)*c,position:"relative",padding:"0",margin:"0"}).children().css({height:f});break;case"left":l.wrap('
    ').css({width:m*d,left:-(p*t)*d,position:"relative",overflow:"hidden",padding:"0",margin:"0"}).children().css({"float":"left",width:e});break;case"leftloop":case"leftmarquee":z(),l.wrap('
    ').css({width:(m+u+p)*d,position:"relative",overflow:"hidden",padding:"0",margin:"0",left:-(p+p*t)*d}).children().css({"float":"left",width:e});break;case"toploop":case"topmarquee":z(),l.wrap('
    ').css({height:(m+u+p)*c,position:"relative",padding:"0",margin:"0",top:-(p+p*t)*c}).children().css({height:f})}}var $=function(a){var b=a*t;return a==k?b=m:-1==a&&0!=m%t&&(b=-m%t),b},_=function(b){var c=function(c){for(var d=c;u+c>d;d++)b.eq(d).find("img["+n+"]").each(function(){var b=a(this);if(b.attr("src",b.attr(n)).removeattr(n),l.find(".clone")[0])for(var c=l.children(),d=0;d=1?p=1:0>=p&&(p=0):(o=p,p>=k?p=0:0>p&&(p=k-1)),s(),null!=n&&_(l.children()),o[0]&&(q=o.eq(p),null!=n&&_(o),"slidedown"==e?(o.not(q).stop(!0,!0).slideup(q),q.slidedown(q,g,function(){l[0]||t()})):(o.not(q).stop(!0,!0).hide(),q.animate({opacity:"show"},q,function(){l[0]||t()}))),m>=u)switch(e){case"fade":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,g,function(){t()}).siblings().hide();break;case"fold":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,g,function(){t()}).siblings().animate({opacity:"hide"},q,g);break;case"top":l.stop(!0,!1).animate({top:-p*t*c},q,g,function(){t()});break;case"left":l.stop(!0,!1).animate({left:-p*t*d},q,g,function(){t()});break;case"leftloop":var b=o;l.stop(!0,!0).animate({left:-($(o)+p)*d},q,g,function(){-1>=b?l.css("left",-(p+(k-1)*t)*d):b>=k&&l.css("left",-p*d),t()});break;case"toploop":var b=o;l.stop(!0,!0).animate({top:-($(o)+p)*c},q,g,function(){-1>=b?l.css("top",-(p+(k-1)*t)*c):b>=k&&l.css("top",-p*c),t()});break;case"leftmarquee":var c=l.css("left").replace("px","");0==p?l.animate({left:++c},0,function(){l.css("left").replace("px","")>=0&&l.css("left",-m*d)}):l.animate({left:--c},0,function(){l.css("left").replace("px","")<=-(m+p)*d&&l.css("left",-p*d)});break;case"topmarquee":var d=l.css("top").replace("px","");0==p?l.animate({top:++d},0,function(){l.css("top").replace("px","")>=0&&l.css("top",-m*c)}):l.animate({top:--d},0,function(){l.css("top").replace("px","")<=-(m+p)*c&&l.css("top",-p*c)})}j.removeclass(k).eq(p).addclass(k),m=p,y||(g.removeclass("nextstop"),f.removeclass("prevstop"),0==p&&f.addclass("prevstop"),p==k-1&&g.addclass("nextstop")),h.html(""+(p+1)+"/"+k)}};a&&ab(!0),b&&d.hover(function(){cleartimeout(j)},function(){j=settimeout(function(){p=n,a?ab():"slidedown"==e?q.slideup(q,u):q.animate({opacity:"hide"},q,u),m=p},300)});var bb=function(a){h=setinterval(function(){w?p--:p++,ab()},a?a:r)},cb=function(a){h=setinterval(ab,a?a:r)},db=function(){z||(clearinterval(h),bb())},eb=function(){(y||p!=k-1)&&(p++,ab(),r||db())},fb=function(){(y||0!=p)&&(p--,ab(),r||db())},gb=function(){clearinterval(h),r?cb():bb(),i.removeclass("pausestate")},hb=function(){clearinterval(h),i.addclass("pausestate")};if(v?r?(w?p--:p++,cb(),z&&l.hover(hb,gb)):(bb(),z&&d.hover(hb,gb)):(r&&(w?p--:p++),i.addclass("pausestate")),i.click(function(){i.hasclass("pausestate")?gb():hb()}),"mouseover"==c.trigger?j.hover(function(){var a=j.index(this);i=settimeout(function(){p=a,ab(),db()},c.triggertime)},function(){cleartimeout(i)}):j.click(function(){p=j.index(this),ab(),db()}),r){if(g.mousedown(eb),f.mousedown(fb),y){var ib,jb=function(){ib=settimeout(function(){clearinterval(h),cb(0^r/10)},150)},kb=function(){cleartimeout(ib),clearinterval(h),cb()};g.mousedown(jb),g.mouseup(kb),f.mousedown(jb),f.mouseup(kb)}"mouseover"==c.trigger&&(g.hover(eb,function(){}),f.hover(fb,function(){}))}else g.click(eb),f.click(fb)})}}(jquery),jquery.easing.jswing=jquery.easing.swing,jquery.extend(jquery.easing,{def:"easeoutquad",swing:function(a,b,c,d,e){return jquery.easing[jquery.easing.def](a,b,c,d,e)},easeinquad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeoutquad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeinoutquad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeincubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeoutcubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeinoutcubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeinquart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeoutquart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeinoutquart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeinquint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeoutquint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeinoutquint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeinsine:function(a,b,c,d,e){return-d*math.cos(b/e*(math.pi/2))+d+c},easeoutsine:function(a,b,c,d,e){return d*math.sin(b/e*(math.pi/2))+c},easeinoutsine:function(a,b,c,d,e){return-d/2*(math.cos(math.pi*b/e)-1)+c},easeinexpo:function(a,b,c,d,e){return 0==b?c:d*math.pow(2,10*(b/e-1))+c},easeoutexpo:function(a,b,c,d,e){return b==e?c+d:d*(-math.pow(2,-10*b/e)+1)+c},easeinoutexpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*math.pow(2,10*(b-1))+c:d/2*(-math.pow(2,-10*--b)+2)+c},easeincirc:function(a,b,c,d,e){return-d*(math.sqrt(1-(b/=e)*b)-1)+c},easeoutcirc:function(a,b,c,d,e){return d*math.sqrt(1-(b=b/e-1)*b)+c},easeinoutcirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(math.sqrt(1-b*b)-1)+c:d/2*(math.sqrt(1-(b-=2)*b)+1)+c},easeinelastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),hb?-.5*h*math.pow(2,10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+c:.5*h*math.pow(2,-10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+d+c},easeinback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeinoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeinbounce:function(a,b,c,d,e){return d-jquery.easing.easeoutbounce(a,e-b,0,d,e)+c},easeoutbounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeinoutbounce:function(a,b,c,d,e){return e/2>b?.5*jquery.easing.easeinbounce(a,2*b,0,d,e)+c:.5*jquery.easing.easeoutbounce(a,2*b-e,0,d,e)+.5*d+c}});