text: 
  /*!
  * jQuery Cycle2; version: 2.1.1 build: 20140128
  * http://jquery.malsup.com/cycle2/
  * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
  */
  
  /* Cycle2 core engine */
  ;(function($) {
  "use strict";
  
  var version = '2.1.1';
  
  $.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 ( manual && opts.manualFx )
              tx = $.fn.cycle.transitions[opts.manualFx];
          if ( !tx )
              tx = $.fn.cycle.transitions[opts.fx];
  
          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 ( 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:  '<div>{{title}}</div><div>{{desc}}</div>',
      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: 20130707 */
  (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() {
              $(this).removeData();
              clean( this, 'parsedAttrs', false );
          });
      },
  
      jump: function( index ) {
          // 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.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: 20130525 */
  (function($) {
  "use strict";
  
  $.extend($.fn.cycle.defaults, {
      pager:            '> .cycle-pager',
      pagerActiveClass: 'cycle-pager-active',
      pagerEvent:       'click.cycle',
      pagerTemplate:    '<span>&bull;</span>'
  });    
  
  $(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) {
              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.API.prepareTx( true, fwd );
      opts.API.trigger('cycle-pager-activated', [opts, pager, target ]);
  }
  
  })(jQuery);
  
  
  /*! prevnext plugin for Cycle2;  version: 20130709 */
  (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.API.next();
          });
          opts.container.on( prevEvent, function() {
              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);
  
  
  /*! youtube plugin for Cycle2;  version: 20130708 */
  (function($) {
  "use strict";
  
  var template = '<div class=cycle-youtube><object width="640" height="360">' +
      '<param name="movie" value="{{url}}"></param>' +
      '<param name="allowFullScreen" value="{{allowFullScreen}}"></param>' +
      '<param name="allowscriptaccess" value="always"></param>' +
      '<embed src="{{url}}" type="application/x-shockwave-flash" wmode="Opaque" allowscriptaccess="always" allowfullscreen="{{allowFullScreen}}"></embed>' +
  '</object></div>';
  
  $.extend($.fn.cycle.defaults, {
      youtubeAllowFullScreen: true,
      youtubeAutostart: false,
      youtubeAutostop:  true
  });    
  
  $(document).on( 'cycle-bootstrap', function( e, opts ) {
      if ( ! opts.youtube )
          return;
  
      // don't hide inactive slides; hiding video causes reload when it's shown again
      opts.hideNonActive = false; 
  
      opts.container.find( opts.slides ).each(function(i) {
          // convert anchors to template markup
          if ( !this.href )
              return;
          var markup, slide = $(this), url = slide.attr( 'href' );
          var fs = opts.youtubeAllowFullScreen ? 'true' : 'false';
          url += ( /\?/.test( url ) ? '&' : '?') + 'enablejsapi=1';
          if ( opts.youtubeAutostart && opts.startingSlide === i )
              url += '&autoplay=1';
          markup = opts.API.tmpl( template, { url: url, allowFullScreen: fs });
          slide.replaceWith( markup );
      });
      opts.slides = opts.slides.replace(/(\b>?a\b)/,'div.cycle-youtube');
  
      if ( opts.youtubeAutostart ) {
          opts.container.on( 'cycle-initialized cycle-after', function( e, opts ) {
              var index = e.type == 'cycle-initialized' ? opts.currSlide : opts.nextSlide;
              $( opts.slides[ index ] ).find('object,embed').each( play );
          });
      }
  
      if ( opts.youtubeAutostop ) {
          opts.container.on( 'cycle-before', function( e, opts ) {
              $( opts.slides[ opts.currSlide ] ).find('object,embed').each( pause );
          });
      }
  });
  
  function play() {
      /*jshint validthis:true */
      try {
          this.playVideo();
      }
      catch( ignore ) {}
  }
  function pause() {
      /*jshint validthis:true */
      try {
          this.pauseVideo();
      }
      catch( ignore ) {}
  }
  
  })(jQuery);
  
  
  /*! carousel transition plugin for Cycle2;  version: 20130528 */
  (function($) {
  "use strict";
  
  $( document ).on('cycle-bootstrap', function( e, opts, API ) {
      if ( opts.fx !== 'carousel' )
          return;
  
      API.getSlideIndex = function( el ) {
          var slides = this.opts()._carouselWrap.children();
          var i = slides.index( el );
          return i % slides.length;
      };
  
      // override default 'next' function
      API.next = function() {
          var count = opts.reverse ? -1 : 1;
          if ( opts.allowWrap === false && ( opts.currSlide + count ) > opts.slideCount - opts.carouselVisible )
              return;
          opts.API.advanceSlide( count );
          opts.API.trigger('cycle-next', [ opts ]).log('cycle-next');
      };
  
  });
  
  
  $.fn.cycle.transitions.carousel = {
      // transition API impl
      preInit: function( opts ) {
          opts.hideNonActive = false;
          
          opts.container.on('cycle-destroyed', $.proxy(this.onDestroy, opts.API));
          // override default API implementation
          opts.API.stopTransition = this.stopTransition;
  
          // issue #10
          for (var i=0; i < opts.startingSlide; i++) {
              opts.container.append( opts.slides[0] );
          }        
      },
  
      // transition API impl
      postInit: function( opts ) {
          var i, j, slide, pagerCutoffIndex, wrap;
          var vert = opts.carouselVertical;
          if (opts.carouselVisible && opts.carouselVisible > opts.slideCount)
              opts.carouselVisible = opts.slideCount - 1;
          var visCount = opts.carouselVisible || opts.slides.length;
          var slideCSS = { display: vert ? 'block' : 'inline-block', position: 'static' };
  
          // required styles
          opts.container.css({ position: 'relative', overflow: 'hidden' });
          opts.slides.css( slideCSS );
  
          opts._currSlide = opts.currSlide;
  
          // wrap slides in a div; this div is what is animated
          wrap = $('<div class="cycle-carousel-wrap"></div>')
              .prependTo( opts.container )
              .css({ margin: 0, padding: 0, top: 0, left: 0, position: 'absolute' })
              .append( opts.slides );
  
          opts._carouselWrap = wrap;
  
          if ( !vert )
              wrap.css('white-space', 'nowrap');
  
          if ( opts.allowWrap !== false ) {
              // prepend and append extra slides so we don't see any empty space when we
              // near the end of the carousel.  for fluid containers, add even more clones
              // so there is plenty to fill the screen
              // @todo: optimzie this based on slide sizes
  
              for ( j=0; j < (opts.carouselVisible === undefined ? 2 : 1); j++ ) {
                  for ( i=0; i < opts.slideCount; i++ ) {
                      wrap.append( opts.slides[i].cloneNode(true) );
                  }
                  i = opts.slideCount;
                  while ( i-- ) { // #160, #209
                      wrap.prepend( opts.slides[i].cloneNode(true) );
                  }
              }
  
              wrap.find('.cycle-slide-active').removeClass('cycle-slide-active');
              opts.slides.eq(opts.startingSlide).addClass('cycle-slide-active');
          }
  
          if ( opts.pager && opts.allowWrap === false ) {
              // hide "extra" pagers
              pagerCutoffIndex = opts.slideCount - visCount;
              $( opts.pager ).children().filter( ':gt('+pagerCutoffIndex+')' ).hide();
          }
  
          opts._nextBoundry = opts.slideCount - opts.carouselVisible;
  
          this.prepareDimensions( opts );
      },
  
      prepareDimensions: function( opts ) {
          var dim, offset, pagerCutoffIndex, tmp;
          var vert = opts.carouselVertical;
          var visCount = opts.carouselVisible || opts.slides.length;
  
          if ( opts.carouselFluid && opts.carouselVisible ) {
              if ( ! opts._carouselResizeThrottle ) {
              // fluid container AND fluid slides; slides need to be resized to fit container
                  this.fluidSlides( opts );
              }
          }
          else if ( opts.carouselVisible && opts.carouselSlideDimension ) {
              dim = visCount * opts.carouselSlideDimension;
              opts.container[ vert ? 'height' : 'width' ]( dim );
          }
          else if ( opts.carouselVisible ) {
              dim = visCount * $(opts.slides[0])[vert ? 'outerHeight' : 'outerWidth'](true);
              opts.container[ vert ? 'height' : 'width' ]( dim );
          }
          // else {
          //     // fluid; don't size the container
          // }
  
          offset = ( opts.carouselOffset || 0 );
          if ( opts.allowWrap !== false ) {
              if ( opts.carouselSlideDimension ) {
                  offset -= ( (opts.slideCount + opts.currSlide) * opts.carouselSlideDimension );
              }
              else {
                  // calculate offset based on actual slide dimensions
                  tmp = opts._carouselWrap.children();
                  for (var j=0; j < (opts.slideCount + opts.currSlide); j++) {
                      offset -= $(tmp[j])[vert?'outerHeight':'outerWidth'](true);
                  }
              }
          }
  
          opts._carouselWrap.css( vert ? 'top' : 'left', offset );
      },
  
      fluidSlides: function( opts ) {
          var timeout;
          var slide = opts.slides.eq(0);
          var adjustment = slide.outerWidth() - slide.width();
          var prepareDimensions = this.prepareDimensions;
  
          // throttle resize event
          $(window).on( 'resize', resizeThrottle);
  
          opts._carouselResizeThrottle = resizeThrottle;
          onResize();
  
          function resizeThrottle() {
              clearTimeout( timeout );
              timeout = setTimeout( onResize, 20 );
          }
  
          function onResize() {
              opts._carouselWrap.stop( false, true );
              var slideWidth = opts.container.width() / opts.carouselVisible;
              slideWidth = Math.ceil( slideWidth - adjustment );
              opts._carouselWrap.children().width( slideWidth );
              if ( opts._sentinel )
                  opts._sentinel.width( slideWidth );
              prepareDimensions( opts );
          }
      },
  
      // transition API impl
      transition: function( opts, curr, next, fwd, callback ) {
          var moveBy, props = {};
          var hops = opts.nextSlide - opts.currSlide;
          var vert = opts.carouselVertical;
          var speed = opts.speed;
  
          // handle all the edge cases for wrapping & non-wrapping
          if ( opts.allowWrap === false ) {
              fwd = hops > 0;
              var currSlide = opts._currSlide;
              var maxCurr = opts.slideCount - opts.carouselVisible;
              if ( hops > 0 && opts.nextSlide > maxCurr && currSlide == maxCurr ) {
                  hops = 0;
              }
              else if ( hops > 0 && opts.nextSlide > maxCurr ) {
                  hops = opts.nextSlide - currSlide - (opts.nextSlide - maxCurr);
              }
              else if ( hops < 0 && opts.currSlide > maxCurr && opts.nextSlide > maxCurr ) {
                  hops = 0;
              }
              else if ( hops < 0 && opts.currSlide > maxCurr ) {
                  hops += opts.currSlide - maxCurr;
              }
              else 
                  currSlide = opts.currSlide;
  
              moveBy = this.getScroll( opts, vert, currSlide, hops );
              opts.API.opts()._currSlide = opts.nextSlide > maxCurr ? maxCurr : opts.nextSlide;
          }
          else {
              if ( fwd && opts.nextSlide === 0 ) {
                  // moving from last slide to first
                  moveBy = this.getDim( opts, opts.currSlide, vert );
                  callback = this.genCallback( opts, fwd, vert, callback );
              }
              else if ( !fwd && opts.nextSlide == opts.slideCount - 1 ) {
                  // moving from first slide to last
                  moveBy = this.getDim( opts, opts.currSlide, vert );
                  callback = this.genCallback( opts, fwd, vert, callback );
              }
              else {
                  moveBy = this.getScroll( opts, vert, opts.currSlide, hops );
              }
          }
  
          props[ vert ? 'top' : 'left' ] = fwd ? ( "-=" + moveBy ) : ( "+=" + moveBy );
  
          // throttleSpeed means to scroll slides at a constant rate, rather than
          // a constant speed
          if ( opts.throttleSpeed )
              speed = (moveBy / $(opts.slides[0])[vert ? 'height' : 'width']() ) * opts.speed;
  
          opts._carouselWrap.animate( props, speed, opts.easing, callback );
      },
  
      getDim: function( opts, index, vert ) {
          var slide = $( opts.slides[index] );
          return slide[ vert ? 'outerHeight' : 'outerWidth'](true);
      },
  
      getScroll: function( opts, vert, currSlide, hops ) {
          var i, moveBy = 0;
  
          if (hops > 0) {
              for (i=currSlide; i < currSlide+hops; i++)
                  moveBy += this.getDim( opts, i, vert);
          }
          else {
              for (i=currSlide; i > currSlide+hops; i--)
                  moveBy += this.getDim( opts, i, vert);
          }
          return moveBy;
      },
  
      genCallback: function( opts, fwd, vert, callback ) {
          // returns callback fn that resets the left/top wrap position to the "real" slides
          return function() {
              var pos = $(opts.slides[opts.nextSlide]).position();
              var offset = 0 - pos[vert?'top':'left'] + (opts.carouselOffset || 0);
              opts._carouselWrap.css( opts.carouselVertical ? 'top' : 'left', offset );
              callback();
          };
      },
  
      // core API override
      stopTransition: function() {
          var opts = this.opts();
          opts.slides.stop( false, true );
          opts._carouselWrap.stop( false, true );
      },
  
      // core API supplement
      onDestroy: function( e ) {
          var opts = this.opts();
          if ( opts._carouselResizeThrottle )
              $( window ).off( 'resize', opts._carouselResizeThrottle );
          opts.slides.prependTo( opts.container );
          opts._carouselWrap.remove();
      }
  };
  
  })(jQuery);
  
  /*
   * 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.
   *
  */
  jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});
  
  
  /*
   * jQuery Selectbox plugin 0.2
   *
   * Copyright 2011-2012, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/selectbox/)
   * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
   * 
   * Date: Tue Jul 17 19:58:36 2012 +0300
   */
  (function($,undefined){var PROP_NAME="selectbox",FALSE=false,TRUE=true;function Selectbox(){this._state=[];this._defaults={classHolder:"sbHolder",classHolderDisabled:"sbHolderDisabled",classSelector:"sbSelector",classOptions:"sbOptions",classGroup:"sbGroup",classSub:"sbSub",classDisabled:"sbDisabled",classToggleOpen:"sbToggleOpen",classToggle:"sbToggle",classFocus:"sbFocus",speed:200,effect:"slide",onChange:null,onOpen:null,onClose:null}}$.extend(Selectbox.prototype,{_isOpenSelectbox:function(target){if(!target){return FALSE}var inst=this._getInst(target);return inst.isOpen},_isDisabledSelectbox:function(target){if(!target){return FALSE}var inst=this._getInst(target);return inst.isDisabled},_attachSelectbox:function(target,settings){if(this._getInst(target)){return FALSE}var $target=$(target),self=this,inst=self._newInst($target),sbHolder,sbSelector,sbToggle,sbOptions,s=FALSE,optGroup=$target.find("optgroup"),opts=$target.find("option"),olen=opts.length;$target.attr("sb",inst.uid);$.extend(inst.settings,self._defaults,settings);self._state[inst.uid]=FALSE;$target.hide();function closeOthers(){var key,sel,uid=this.attr("id").split("_")[1];for(key in self._state){if(key!==uid){if(self._state.hasOwnProperty(key)){sel=$("select[sb='"+key+"']")[0];if(sel){self._closeSelectbox(sel)}}}}}sbHolder=$("<div>",{id:"sbHolder_"+inst.uid,"class":inst.settings.classHolder,tabindex:$target.attr("tabindex")});sbSelector=$("<a>",{id:"sbSelector_"+inst.uid,href:"#","class":inst.settings.classSelector,click:function(e){e.preventDefault();closeOthers.apply($(this),[]);var uid=$(this).attr("id").split("_")[1];if(self._state[uid]){self._closeSelectbox(target)}else{self._openSelectbox(target)}}});sbToggle=$("<a>",{id:"sbToggle_"+inst.uid,href:"#","class":inst.settings.classToggle,click:function(e){e.preventDefault();closeOthers.apply($(this),[]);var uid=$(this).attr("id").split("_")[1];if(self._state[uid]){self._closeSelectbox(target)}else{self._openSelectbox(target)}}});sbToggle.appendTo(sbHolder);sbOptions=$("<ul>",{id:"sbOptions_"+inst.uid,"class":inst.settings.classOptions,css:{display:"none"}});$target.children().each(function(i){var that=$(this),li,config={};if(that.is("option")){getOptions(that)}else{if(that.is("optgroup")){li=$("<li>");$("<span>",{text:that.attr("label")}).addClass(inst.settings.classGroup).appendTo(li);li.appendTo(sbOptions);if(that.is(":disabled")){config.disabled=true}config.sub=true;getOptions(that.find("option"),config)}}});function getOptions(){var sub=arguments[1]&&arguments[1].sub?true:false,disabled=arguments[1]&&arguments[1].disabled?true:false;arguments[0].each(function(i){var that=$(this),li=$("<li>"),child;if(that.is(":selected")){sbSelector.text(that.text());s=TRUE}if(i===olen-1){li.addClass("last")}if(!that.is(":disabled")&&!disabled){child=$("<a>",{href:"#"+that.val(),rel:that.val()}).text(that.text()).bind("click.sb",function(e){if(e&&e.preventDefault){e.preventDefault()}var t=sbToggle,$this=$(this),uid=t.attr("id").split("_")[1];self._changeSelectbox(target,$this.attr("rel"),$this.text());self._closeSelectbox(target)}).bind("mouseover.sb",function(){var $this=$(this);$this.parent().siblings().find("a").removeClass(inst.settings.classFocus);$this.addClass(inst.settings.classFocus)}).bind("mouseout.sb",function(){$(this).removeClass(inst.settings.classFocus)});if(sub){child.addClass(inst.settings.classSub)}if(that.is(":selected")){child.addClass(inst.settings.classFocus)}child.appendTo(li)}else{child=$("<span>",{text:that.text()}).addClass(inst.settings.classDisabled);if(sub){child.addClass(inst.settings.classSub)}child.appendTo(li)}li.appendTo(sbOptions)})}if(!s){sbSelector.text(opts.first().text())}$.data(target,PROP_NAME,inst);sbHolder.data("uid",inst.uid).bind("keydown.sb",function(e){var key=e.charCode?e.charCode:e.keyCode?e.keyCode:0,$this=$(this),uid=$this.data("uid"),inst=$this.siblings("select[sb='"+uid+"']").data(PROP_NAME),trgt=$this.siblings(["select[sb='",uid,"']"].join("")).get(0),$f=$this.find("ul").find("a."+inst.settings.classFocus);switch(key){case 37:case 38:if($f.length>0){var $next;$("a",$this).removeClass(inst.settings.classFocus);$next=$f.parent().prevAll("li:has(a)").eq(0).find("a");if($next.length>0){$next.addClass(inst.settings.classFocus).focus();$("#sbSelector_"+uid).text($next.text())}}break;case 39:case 40:var $next;$("a",$this).removeClass(inst.settings.classFocus);if($f.length>0){$next=$f.parent().nextAll("li:has(a)").eq(0).find("a")}else{$next=$this.find("ul").find("a").eq(0)}if($next.length>0){$next.addClass(inst.settings.classFocus).focus();$("#sbSelector_"+uid).text($next.text())}break;case 13:if($f.length>0){self._changeSelectbox(trgt,$f.attr("rel"),$f.text())}self._closeSelectbox(trgt);break;case 9:if(trgt){var inst=self._getInst(trgt);if(inst){if($f.length>0){self._changeSelectbox(trgt,$f.attr("rel"),$f.text())}self._closeSelectbox(trgt)}}var i=parseInt($this.attr("tabindex"),10);if(!e.shiftKey){i++}else{i--}$("*[tabindex='"+i+"']").focus();break;case 27:self._closeSelectbox(trgt);break}e.stopPropagation();return false}).delegate("a","mouseover",function(e){$(this).addClass(inst.settings.classFocus)}).delegate("a","mouseout",function(e){$(this).removeClass(inst.settings.classFocus)});sbSelector.appendTo(sbHolder);sbOptions.appendTo(sbHolder);sbHolder.insertAfter($target);$("html").live("mousedown",function(e){e.stopPropagation();$("select").selectbox("close")});$([".",inst.settings.classHolder,", .",inst.settings.classSelector].join("")).mousedown(function(e){e.stopPropagation()})},_detachSelectbox:function(target){var inst=this._getInst(target);if(!inst){return FALSE}$("#sbHolder_"+inst.uid).remove();$.data(target,PROP_NAME,null);$(target).show()},_changeSelectbox:function(target,value,text){var onChange,inst=this._getInst(target);if(inst){onChange=this._get(inst,"onChange");$("#sbSelector_"+inst.uid).text(text)}value=value.replace(/\'/g,"\\'");$(target).find("option[value='"+value+"']").attr("selected",TRUE);if(inst&&onChange){onChange.apply((inst.input?inst.input[0]:null),[value,inst])}else{if(inst&&inst.input){inst.input.trigger("change")}}},_enableSelectbox:function(target){var inst=this._getInst(target);if(!inst||!inst.isDisabled){return FALSE}$("#sbHolder_"+inst.uid).removeClass(inst.settings.classHolderDisabled);inst.isDisabled=FALSE;$.data(target,PROP_NAME,inst)},_disableSelectbox:function(target){var inst=this._getInst(target);if(!inst||inst.isDisabled){return FALSE}$("#sbHolder_"+inst.uid).addClass(inst.settings.classHolderDisabled);inst.isDisabled=TRUE;$.data(target,PROP_NAME,inst)},_optionSelectbox:function(target,name,value){var inst=this._getInst(target);if(!inst){return FALSE}inst[name]=value;$.data(target,PROP_NAME,inst)},_openSelectbox:function(target){var inst=this._getInst(target);if(!inst||inst.isOpen||inst.isDisabled){return }var el=$("#sbOptions_"+inst.uid),viewportHeight=parseInt($(window).height(),10),offset=$("#sbHolder_"+inst.uid).offset(),scrollTop=$(window).scrollTop(),height=el.prev().height(),diff=viewportHeight-(offset.top-scrollTop)-height/2,onOpen=this._get(inst,"onOpen");el.css({top:height+"px",maxHeight:(diff-height)+"px"});inst.settings.effect==="fade"?el.fadeIn(inst.settings.speed):el.slideDown(inst.settings.speed);$("#sbToggle_"+inst.uid).addClass(inst.settings.classToggleOpen);this._state[inst.uid]=TRUE;inst.isOpen=TRUE;if(onOpen){onOpen.apply((inst.input?inst.input[0]:null),[inst])}$.data(target,PROP_NAME,inst)},_closeSelectbox:function(target){var inst=this._getInst(target);if(!inst||!inst.isOpen){return }var onClose=this._get(inst,"onClose");inst.settings.effect==="fade"?$("#sbOptions_"+inst.uid).fadeOut(inst.settings.speed):$("#sbOptions_"+inst.uid).slideUp(inst.settings.speed);$("#sbToggle_"+inst.uid).removeClass(inst.settings.classToggleOpen);this._state[inst.uid]=FALSE;inst.isOpen=FALSE;if(onClose){onClose.apply((inst.input?inst.input[0]:null),[inst])}$.data(target,PROP_NAME,inst)},_newInst:function(target){var id=target[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:id,input:target,uid:Math.floor(Math.random()*99999999),isOpen:FALSE,isDisabled:FALSE,settings:{}}},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this selectbox"}},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]}});$.fn.selectbox=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&options=="isDisabled"){return $.selectbox["_"+options+"Selectbox"].apply($.selectbox,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.selectbox["_"+options+"Selectbox"].apply($.selectbox,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.selectbox["_"+options+"Selectbox"].apply($.selectbox,[this].concat(otherArgs)):$.selectbox._attachSelectbox(this,options)})};$.selectbox=new Selectbox();$.selectbox.version="0.2"})(jQuery);