// remap jQuery to $
(function($){

	(function($){
	  /* hoverIntent by Brian Cherne */
	  $.fn.hoverIntent = function(f,g) {
	    // default configuration options
	    var cfg = {
	      sensitivity: 7,
	      interval: 100,
	      timeout: 0
	    };
	    // override configuration options with user supplied object
	    cfg = $.extend(cfg, g ? { over: f, out: g } : f );

	    // instantiate variables
	    // cX, cY = current X and Y position of mouse, updated by mousemove event
	    // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
	    var cX, cY, pX, pY;

	    // A private function for getting mouse position
	    var track = function(ev) {
	      cX = ev.pageX;
	      cY = ev.pageY;
	    };

	    // A private function for comparing current and previous mouse position
	    var compare = function(ev,ob) {
	      ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
	      // compare mouse positions to see if they've crossed the threshold
	      if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
	        $(ob).unbind("mousemove",track);
	        // set hoverIntent state to true (so mouseOut can be called)
	        ob.hoverIntent_s = 1;
	        return cfg.over.apply(ob,[ev]);
	      } else {
	        // set previous coordinates for next time
	        pX = cX; pY = cY;
	        // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
	        ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
	      }
	    };

	    // A private function for delaying the mouseOut function
	    var delay = function(ev,ob) {
	      ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
	      ob.hoverIntent_s = 0;
	      return cfg.out.apply(ob,[ev]);
	    };

	    // A private function for handling mouse 'hovering'
	    var handleHover = function(e) {
	      // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
	      var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
	      while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
	      if ( p == this ) { return false; }

	      // copy objects to be passed into t (required for event object to be passed in IE)
	      var ev = jQuery.extend({},e);
	      var ob = this;

	      // cancel hoverIntent timer if it exists
	      if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

	      // else e.type == "onmouseover"
	      if (e.type == "mouseover") {
	        // set "previous" X and Y position based on initial entry point
	        pX = ev.pageX; pY = ev.pageY;
	        // update "current" X and Y position based on mousemove
	        $(ob).bind("mousemove",track);
	        // start polling interval (self-calling timeout) to compare mouse coordinates over time
	        if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}

	      // else e.type == "onmouseout"
	      } else {
	        // unbind expensive mousemove event
	        $(ob).unbind("mousemove",track);
	        // if hoverIntent state is true, then call the mouseOut function after the specified delay
	        if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
	      }
	    };

	    // bind the function to the two event listeners
	    return this.mouseover(handleHover).mouseout(handleHover);
	  };

	})(jQuery);
	
	/*
	 * Superfish v1.4.8 - jQuery menu widget
	 * Copyright (c) 2008 Joel Birch
	 *
	 * Dual licensed under the MIT and GPL licenses:
	 *   http://www.opensource.org/licenses/mit-license.php
	 *   http://www.gnu.org/licenses/gpl.html
	 *
	 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
	 */

	;(function($){
	  $.fn.superfish = function(op){

	    var sf = $.fn.superfish,
	      c = sf.c,
	      $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
	      over = function(){
	        var $$ = $(this), menu = getMenu($$);
	        clearTimeout(menu.sfTimer);
	        $$.showSuperfishUl().siblings().hideSuperfishUl();
	      },
	      out = function(){
	        var $$ = $(this), menu = getMenu($$), o = sf.op;
	        clearTimeout(menu.sfTimer);
	        menu.sfTimer=setTimeout(function(){
	          o.retainPath=($.inArray($$[0],o.$path)>-1);
	          $$.hideSuperfishUl();
	          if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
	        },o.delay);  
	      },
	      getMenu = function($menu){
	        var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
	        sf.op = sf.o[menu.serial];
	        return menu;
	      },
	      addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };

	    return this.each(function() {
	      var s = this.serial = sf.o.length;
	      var o = $.extend({},sf.defaults,op);
	      o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
	        $(this).addClass([o.hoverClass,c.bcClass].join(' '))
	          .filter('li:has(ul)').removeClass(o.pathClass);
	      });
	      sf.o[s] = sf.op = o;

	      $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
	        if (o.autoArrows) addArrow( $('>a:first-child',this) );
	      })
	      .not('.'+c.bcClass)
	        .hideSuperfishUl();

	      var $a = $('a',this);
	      $a.each(function(i){
	        var $li = $a.eq(i).parents('li');
	        $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
	      });
	      o.onInit.call(this);

	    }).each(function() {
	      var menuClasses = [c.menuClass];
	      if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
	      $(this).addClass(menuClasses.join(' '));
	    });
	  };

	  var sf = $.fn.superfish;
	  sf.o = [];
	  sf.op = {};
	  sf.IE7fix = function(){
	    var o = sf.op;
	    if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
	      this.toggleClass(sf.c.shadowClass+'-off');
	    };
	  sf.c = {
	    bcClass     : 'sf-breadcrumb',
	    menuClass   : 'sf-js-enabled',
	    anchorClass : 'sf-with-ul',
	    arrowClass  : 'sf-sub-indicator',
	    shadowClass : 'sf-shadow'
	  };
	  sf.defaults = {
	    hoverClass  : 'sfHover',
	    pathClass  : 'selected',
	    pathLevels  : 0,
	    delay    : 800,
	    animation  : {opacity:'show',height:'show'},
	    speed    : 'normal',
	    autoArrows  : false,
	    dropShadows : true,
	    disableHI  : false,    // true disables hoverIntent detection
	    onInit    : function(){}, // callback functions
	    onBeforeShow: function(){},
	    onShow    : function(){},
	    onHide    : function(){}
	  };
	  $.fn.extend({
	    hideSuperfishUl : function(){
	      var o = sf.op,
	        not = (o.retainPath===true) ? o.$path : '';
	      o.retainPath = false;
	      var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
	          .find('>ul').hide().css('visibility','hidden');
	      o.onHide.call($ul);
	      return this;
	    },
	    showSuperfishUl : function(){
	      var o = sf.op,
	        sh = sf.c.shadowClass+'-off',
	        $ul = this.addClass(o.hoverClass)
	          .find('>ul:hidden').css('visibility','visible');
	      sf.IE7fix.call($ul);
	      o.onBeforeShow.call($ul);
	      $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
	      return this;
	    }
	  });

	})(jQuery);
	
	
	/* http://keith-wood.name/countdown.html
	   Countdown for jQuery v1.5.8.
	   Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
	   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
	   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
	   Please attribute the author if you use it. */

	/* Display a countdown timer.
	   Attach it with options like:
	   $('div selector').countdown(
	       {until: new Date(2009, 1 - 1, 1, 0, 0, 0), onExpiry: happyNewYear}); */

	(function($) { // Hide scope, no $ conflict

	/* Countdown manager. */
	function Countdown() {
	  this.regional = []; // Available regional settings, indexed by language code
	  this.regional[''] = { // Default regional settings
	    // The display texts for the counters
	    labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
	    // The display texts for the counters if only one
	    labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
	    compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters
	    whichLabels: null, // Function to determine which labels to use
	    timeSeparator: ':', // Separator for time periods
	    isRTL: false // True for right-to-left languages, false for left-to-right
	  };
	  this._defaults = {
	    until: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
	      // or numeric for seconds offset, or string for unit offset(s):
	      // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
	    since: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count up from
	      // or numeric for seconds offset, or string for unit offset(s):
	      // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
	    timezone: null, // The timezone (hours or minutes from GMT) for the target times,
	      // or null for client local
	    serverSync: null, // A function to retrieve the current server time for synchronisation
	    format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
	      // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
	    layout: '', // Build your own layout for the countdown
	    compact: false, // True to display in a compact format, false for an expanded one
	    significant: 0, // The number of periods with values to show, zero for all
	    description: '', // The description displayed for the countdown
	    expiryUrl: '', // A URL to load upon expiry, replacing the current page
	    expiryText: '', // Text to display upon expiry, replacing the countdown
	    alwaysExpire: false, // True to trigger onExpiry even if never counted down
	    onExpiry: null, // Callback when the countdown expires -
	      // receives no parameters and 'this' is the containing division
	    onTick: null, // Callback when the countdown is updated -
	      // receives int[7] being the breakdown by period (based on format)
	      // and 'this' is the containing division
	    tickInterval: 1 // Interval (seconds) between onTick callbacks
	  };
	  $.extend(this._defaults, this.regional['']);
	  this._serverSyncs = [];
	}

	var PROP_NAME = 'countdown';

	var Y = 0; // Years
	var O = 1; // Months
	var W = 2; // Weeks
	var D = 3; // Days
	var H = 4; // Hours
	var M = 5; // Minutes
	var S = 6; // Seconds

	$.extend(Countdown.prototype, {
	  /* Class name added to elements to indicate already configured with countdown. */
	  markerClassName: 'hasCountdown',

	  /* Shared timer for all countdowns. */
	  _timer: setInterval(function() { $.countdown._updateTargets(); }, 980),
	  /* List of currently active countdown targets. */
	  _timerTargets: [],

	  /* Override the default settings for all instances of the countdown widget.
	     @param  options  (object) the new settings to use as defaults */
	  setDefaults: function(options) {
	    this._resetExtraLabels(this._defaults, options);
	    extendRemove(this._defaults, options || {});
	  },

	  /* Convert a date/time to UTC.
	     @param  tz     (number) the hour or minute offset from GMT, e.g. +9, -360
	     @param  year   (Date) the date/time in that timezone or
	                    (number) the year in that timezone
	     @param  month  (number, optional) the month (0 - 11) (omit if year is a Date)
	     @param  day    (number, optional) the day (omit if year is a Date)
	     @param  hours  (number, optional) the hour (omit if year is a Date)
	     @param  mins   (number, optional) the minute (omit if year is a Date)
	     @param  secs   (number, optional) the second (omit if year is a Date)
	     @param  ms     (number, optional) the millisecond (omit if year is a Date)
	     @return  (Date) the equivalent UTC date/time */
	  UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
	    if (typeof year == 'object' && year.constructor == Date) {
	      ms = year.getMilliseconds();
	      secs = year.getSeconds();
	      mins = year.getMinutes();
	      hours = year.getHours();
	      day = year.getDate();
	      month = year.getMonth();
	      year = year.getFullYear();
	    }
	    var d = new Date();
	    d.setUTCFullYear(year);
	    d.setUTCDate(1);
	    d.setUTCMonth(month || 0);
	    d.setUTCDate(day || 1);
	    d.setUTCHours(hours || 0);
	    d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
	    d.setUTCSeconds(secs || 0);
	    d.setUTCMilliseconds(ms || 0);
	    return d;
	  },

	  /* Convert a set of periods into seconds.
	     Averaged for months and years.
	     @param  periods  (number[7]) the periods per year/month/week/day/hour/minute/second
	     @return  (number) the corresponding number of seconds */
	  periodsToSeconds: function(periods) {
	    return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
	      periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
	  },

	  /* Retrieve one or more settings values.
	     @param  name  (string, optional) the name of the setting to retrieve
	                   or 'all' for all instance settings or omit for all default settings
	     @return  (any) the requested setting(s) */
	  _settingsCountdown: function(target, name) {
	    if (!name) {
	      return $.countdown._defaults;
	    }
	    var inst = $.data(target, PROP_NAME);
	    return (name == 'all' ? inst.options : inst.options[name]);
	  },

	  /* Attach the countdown widget to a div.
	     @param  target   (element) the containing division
	     @param  options  (object) the initial settings for the countdown */
	  _attachCountdown: function(target, options) {
	    var $target = $(target);
	    if ($target.hasClass(this.markerClassName)) {
	      return;
	    }
	    $target.addClass(this.markerClassName);
	    var inst = {options: $.extend({}, options),
	      _periods: [0, 0, 0, 0, 0, 0, 0]};
	    $.data(target, PROP_NAME, inst);
	    this._changeCountdown(target);
	  },

	  /* Add a target to the list of active ones.
	     @param  target  (element) the countdown target */
	  _addTarget: function(target) {
	    if (!this._hasTarget(target)) {
	      this._timerTargets.push(target);
	    }
	  },

	  /* See if a target is in the list of active ones.
	     @param  target  (element) the countdown target
	     @return  (boolean) true if present, false if not */
	  _hasTarget: function(target) {
	    return ($.inArray(target, this._timerTargets) > -1);
	  },

	  /* Remove a target from the list of active ones.
	     @param  target  (element) the countdown target */
	  _removeTarget: function(target) {
	    this._timerTargets = $.map(this._timerTargets,
	      function(value) { return (value == target ? null : value); }); // delete entry
	  },

	  /* Update each active timer target. */
	  _updateTargets: function() {
	    for (var i = this._timerTargets.length - 1; i >= 0; i--) {
	      this._updateCountdown(this._timerTargets[i]);
	    }
	  },

	  /* Redisplay the countdown with an updated display.
	     @param  target  (jQuery) the containing division
	     @param  inst    (object) the current settings for this instance */
	  _updateCountdown: function(target, inst) {
	    var $target = $(target);
	    inst = inst || $.data(target, PROP_NAME);
	    if (!inst) {
	      return;
	    }
	    $target.html(this._generateHTML(inst));
	    $target[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl');
	    var onTick = this._get(inst, 'onTick');
	    if (onTick) {
	      var periods = inst._hold != 'lap' ? inst._periods :
	        this._calculatePeriods(inst, inst._show, this._get(inst, 'significant'), new Date());
	      var tickInterval = this._get(inst, 'tickInterval');
	      if (tickInterval == 1 || this.periodsToSeconds(periods) % tickInterval == 0) {
	        onTick.apply(target, [periods]);
	      }
	    }
	    var expired = inst._hold != 'pause' &&
	      (inst._since ? inst._now.getTime() < inst._since.getTime() :
	      inst._now.getTime() >= inst._until.getTime());
	    if (expired && !inst._expiring) {
	      inst._expiring = true;
	      if (this._hasTarget(target) || this._get(inst, 'alwaysExpire')) {
	        this._removeTarget(target);
	        var onExpiry = this._get(inst, 'onExpiry');
	        if (onExpiry) {
	          onExpiry.apply(target, []);
	        }
	        var expiryText = this._get(inst, 'expiryText');
	        if (expiryText) {
	          var layout = this._get(inst, 'layout');
	          inst.options.layout = expiryText;
	          this._updateCountdown(target, inst);
	          inst.options.layout = layout;
	        }
	        var expiryUrl = this._get(inst, 'expiryUrl');
	        if (expiryUrl) {
	          window.location = expiryUrl;
	        }
	      }
	      inst._expiring = false;
	    }
	    else if (inst._hold == 'pause') {
	      this._removeTarget(target);
	    }
	    $.data(target, PROP_NAME, inst);
	  },

	  /* Reconfigure the settings for a countdown div.
	     @param  target   (element) the containing division
	     @param  options  (object) the new settings for the countdown or
	                      (string) an individual property name
	     @param  value    (any) the individual property value
	                      (omit if options is an object) */
	  _changeCountdown: function(target, options, value) {
	    options = options || {};
	    if (typeof options == 'string') {
	      var name = options;
	      options = {};
	      options[name] = value;
	    }
	    var inst = $.data(target, PROP_NAME);
	    if (inst) {
	      this._resetExtraLabels(inst.options, options);
	      extendRemove(inst.options, options);
	      this._adjustSettings(target, inst);
	      $.data(target, PROP_NAME, inst);
	      var now = new Date();
	      if ((inst._since && inst._since < now) ||
	          (inst._until && inst._until > now)) {
	        this._addTarget(target);
	      }
	      this._updateCountdown(target, inst);
	    }
	  },

	  /* Reset any extra labelsn and compactLabelsn entries if changing labels.
	     @param  base     (object) the options to be updated
	     @param  options  (object) the new option values */
	  _resetExtraLabels: function(base, options) {
	    var changingLabels = false;
	    for (var n in options) {
	      if (n != 'whichLabels' && n.match(/[Ll]abels/)) {
	        changingLabels = true;
	        break;
	      }
	    }
	    if (changingLabels) {
	      for (var n in base) { // Remove custom numbered labels
	        if (n.match(/[Ll]abels[0-9]/)) {
	          base[n] = null;
	        }
	      }
	    }
	  },

	  /* Calculate interal settings for an instance.
	     @param  target  (element) the containing division
	     @param  inst    (object) the current settings for this instance */
	  _adjustSettings: function(target, inst) {
	    var now;
	    var serverSync = this._get(inst, 'serverSync');
	    var serverOffset = 0;
	    var serverEntry = null;
	    for (var i = 0; i < this._serverSyncs.length; i++) {
	      if (this._serverSyncs[i][0] == serverSync) {
	        serverEntry = this._serverSyncs[i][1];
	        break;
	      }
	    }
	    if (serverEntry != null) {
	      serverOffset = (serverSync ? serverEntry : 0);
	      now = new Date();
	    }
	    else {
	      var serverResult = (serverSync ? serverSync.apply(target, []) : null);
	      now = new Date();
	      serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
	      this._serverSyncs.push([serverSync, serverOffset]);
	    }
	    var timezone = this._get(inst, 'timezone');
	    timezone = (timezone == null ? -now.getTimezoneOffset() : timezone);
	    inst._since = this._get(inst, 'since');
	    if (inst._since != null) {
	      inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
	      if (inst._since && serverOffset) {
	        inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
	      }
	    }
	    inst._until = this.UTCDate(timezone, this._determineTime(this._get(inst, 'until'), now));
	    if (serverOffset) {
	      inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
	    }
	    inst._show = this._determineShow(inst);
	  },

	  /* Remove the countdown widget from a div.
	     @param  target  (element) the containing division */
	  _destroyCountdown: function(target) {
	    var $target = $(target);
	    if (!$target.hasClass(this.markerClassName)) {
	      return;
	    }
	    this._removeTarget(target);
	    $target.removeClass(this.markerClassName).empty();
	    $.removeData(target, PROP_NAME);
	  },

	  /* Pause a countdown widget at the current time.
	     Stop it running but remember and display the current time.
	     @param  target  (element) the containing division */
	  _pauseCountdown: function(target) {
	    this._hold(target, 'pause');
	  },

	  /* Pause a countdown widget at the current time.
	     Stop the display but keep the countdown running.
	     @param  target  (element) the containing division */
	  _lapCountdown: function(target) {
	    this._hold(target, 'lap');
	  },

	  /* Resume a paused countdown widget.
	     @param  target  (element) the containing division */
	  _resumeCountdown: function(target) {
	    this._hold(target, null);
	  },

	  /* Pause or resume a countdown widget.
	     @param  target  (element) the containing division
	     @param  hold    (string) the new hold setting */
	  _hold: function(target, hold) {
	    var inst = $.data(target, PROP_NAME);
	    if (inst) {
	      if (inst._hold == 'pause' && !hold) {
	        inst._periods = inst._savePeriods;
	        var sign = (inst._since ? '-' : '+');
	        inst[inst._since ? '_since' : '_until'] =
	          this._determineTime(sign + inst._periods[0] + 'y' +
	            sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
	            sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' + 
	            sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
	        this._addTarget(target);
	      }
	      inst._hold = hold;
	      inst._savePeriods = (hold == 'pause' ? inst._periods : null);
	      $.data(target, PROP_NAME, inst);
	      this._updateCountdown(target, inst);
	    }
	  },

	  /* Return the current time periods.
	     @param  target  (element) the containing division
	     @return  (number[7]) the current periods for the countdown */
	  _getTimesCountdown: function(target) {
	    var inst = $.data(target, PROP_NAME);
	    return (!inst ? null : (!inst._hold ? inst._periods :
	      this._calculatePeriods(inst, inst._show, this._get(inst, 'significant'), new Date())));
	  },

	  /* Get a setting value, defaulting if necessary.
	     @param  inst  (object) the current settings for this instance
	     @param  name  (string) the name of the required setting
	     @return  (any) the setting's value or a default if not overridden */
	  _get: function(inst, name) {
	    return (inst.options[name] != null ?
	      inst.options[name] : $.countdown._defaults[name]);
	  },

	  /* A time may be specified as an exact value or a relative one.
	     @param  setting      (string or number or Date) - the date/time value
	                          as a relative or absolute value
	     @param  defaultTime  (Date) the date/time to use if no other is supplied
	     @return  (Date) the corresponding date/time */
	  _determineTime: function(setting, defaultTime) {
	    var offsetNumeric = function(offset) { // e.g. +300, -2
	      var time = new Date();
	      time.setTime(time.getTime() + offset * 1000);
	      return time;
	    };
	    var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
	      offset = offset.toLowerCase();
	      var time = new Date();
	      var year = time.getFullYear();
	      var month = time.getMonth();
	      var day = time.getDate();
	      var hour = time.getHours();
	      var minute = time.getMinutes();
	      var second = time.getSeconds();
	      var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
	      var matches = pattern.exec(offset);
	      while (matches) {
	        switch (matches[2] || 's') {
	          case 's': second += parseInt(matches[1], 10); break;
	          case 'm': minute += parseInt(matches[1], 10); break;
	          case 'h': hour += parseInt(matches[1], 10); break;
	          case 'd': day += parseInt(matches[1], 10); break;
	          case 'w': day += parseInt(matches[1], 10) * 7; break;
	          case 'o':
	            month += parseInt(matches[1], 10); 
	            day = Math.min(day, $.countdown._getDaysInMonth(year, month));
	            break;
	          case 'y':
	            year += parseInt(matches[1], 10);
	            day = Math.min(day, $.countdown._getDaysInMonth(year, month));
	            break;
	        }
	        matches = pattern.exec(offset);
	      }
	      return new Date(year, month, day, hour, minute, second, 0);
	    };
	    var time = (setting == null ? defaultTime :
	      (typeof setting == 'string' ? offsetString(setting) :
	      (typeof setting == 'number' ? offsetNumeric(setting) : setting)));
	    if (time) time.setMilliseconds(0);
	    return time;
	  },

	  /* Determine the number of days in a month.
	     @param  year   (number) the year
	     @param  month  (number) the month
	     @return  (number) the days in that month */
	  _getDaysInMonth: function(year, month) {
	    return 32 - new Date(year, month, 32).getDate();
	  },

	  /* Determine which set of labels should be used for an amount.
	     @param  num  (number) the amount to be displayed
	     @return  (number) the set of labels to be used for this amount */
	  _normalLabels: function(num) {
	    return num;
	  },

	  /* Generate the HTML to display the countdown widget.
	     @param  inst  (object) the current settings for this instance
	     @return  (string) the new HTML for the countdown display */
	  _generateHTML: function(inst) {
	    // Determine what to show
	    var significant = this._get(inst, 'significant');
	    inst._periods = (inst._hold ? inst._periods :
	      this._calculatePeriods(inst, inst._show, significant, new Date()));
	    // Show all 'asNeeded' after first non-zero value
	    var shownNonZero = false;
	    var showCount = 0;
	    var sigCount = significant;
	    var show = $.extend({}, inst._show);
	    for (var period = Y; period <= S; period++) {
	      shownNonZero |= (inst._show[period] == '?' && inst._periods[period] > 0);
	      show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]);
	      showCount += (show[period] ? 1 : 0);
	      sigCount -= (inst._periods[period] > 0 ? 1 : 0);
	    }
	    var showSignificant = [false, false, false, false, false, false, false];
	    for (var period = S; period >= Y; period--) { // Determine significant periods
	      if (inst._show[period]) {
	        if (inst._periods[period]) {
	          showSignificant[period] = true;
	        }
	        else {
	          showSignificant[period] = sigCount > 0;
	          sigCount--;
	        }
	      }
	    }
	    var compact = this._get(inst, 'compact');
	    var layout = this._get(inst, 'layout');
	    var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels'));
	    var whichLabels = this._get(inst, 'whichLabels') || this._normalLabels;
	    var timeSeparator = this._get(inst, 'timeSeparator');
	    var description = this._get(inst, 'description') || '';
	    var showCompact = function(period) {
	      var labelsNum = $.countdown._get(inst,
	        'compactLabels' + whichLabels(inst._periods[period]));
	      return (show[period] ? inst._periods[period] +
	        (labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
	    };
	    var showFull = function(period) {
	      var labelsNum = $.countdown._get(inst, 'labels' + whichLabels(inst._periods[period]));
	      return ((!significant && show[period]) || (significant && showSignificant[period]) ?
	        '<span class="countdown_section"><span class="countdown_amount">' +
	        inst._periods[period] + '</span><br/>' +
	        (labelsNum ? labelsNum[period] : labels[period]) + '</span>' : '');
	    };
	    return (layout ? this._buildLayout(inst, show, layout, compact, significant, showSignificant) :
	      ((compact ? // Compact version
	      '<span class="countdown_row countdown_amount' +
	      (inst._hold ? ' countdown_holding' : '') + '">' + 
	      showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) + 
	      (show[H] ? this._minDigits(inst._periods[H], 2) : '') +
	      (show[M] ? (show[H] ? timeSeparator : '') +
	      this._minDigits(inst._periods[M], 2) : '') +
	      (show[S] ? (show[H] || show[M] ? timeSeparator : '') +
	      this._minDigits(inst._periods[S], 2) : '') :
	      // Full version
	      '<span class="countdown_row countdown_show' + (significant || showCount) +
	      (inst._hold ? ' countdown_holding' : '') + '">' +
	      showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
	      showFull(H) + showFull(M) + showFull(S)) + '</span>' +
	      (description ? '<span class="countdown_row countdown_descr">' + description + '</span>' : '')));
	  },

	  /* Construct a custom layout.
	     @param  inst             (object) the current settings for this instance
	     @param  show             (string[7]) flags indicating which periods are requested
	     @param  layout           (string) the customised layout
	     @param  compact          (boolean) true if using compact labels
	     @param  significant      (number) the number of periods with values to show, zero for all
	     @param  showSignificant  (boolean[7]) other periods to show for significance
	     @return  (string) the custom HTML */
	  _buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
	    var labels = this._get(inst, (compact ? 'compactLabels' : 'labels'));
	    var whichLabels = this._get(inst, 'whichLabels') || this._normalLabels;
	    var labelFor = function(index) {
	      return ($.countdown._get(inst,
	        (compact ? 'compactLabels' : 'labels') + whichLabels(inst._periods[index])) ||
	        labels)[index];
	    };
	    var digit = function(value, position) {
	      return Math.floor(value / position) % 10;
	    };
	    var subs = {desc: this._get(inst, 'description'), sep: this._get(inst, 'timeSeparator'),
	      yl: labelFor(Y), yn: inst._periods[Y], ynn: this._minDigits(inst._periods[Y], 2),
	      ynnn: this._minDigits(inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
	      y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
	      y1000: digit(inst._periods[Y], 1000),
	      ol: labelFor(O), on: inst._periods[O], onn: this._minDigits(inst._periods[O], 2),
	      onnn: this._minDigits(inst._periods[O], 3), o1: digit(inst._periods[O], 1),
	      o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
	      o1000: digit(inst._periods[O], 1000),
	      wl: labelFor(W), wn: inst._periods[W], wnn: this._minDigits(inst._periods[W], 2),
	      wnnn: this._minDigits(inst._periods[W], 3), w1: digit(inst._periods[W], 1),
	      w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
	      w1000: digit(inst._periods[W], 1000),
	      dl: labelFor(D), dn: inst._periods[D], dnn: this._minDigits(inst._periods[D], 2),
	      dnnn: this._minDigits(inst._periods[D], 3), d1: digit(inst._periods[D], 1),
	      d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
	      d1000: digit(inst._periods[D], 1000),
	      hl: labelFor(H), hn: inst._periods[H], hnn: this._minDigits(inst._periods[H], 2),
	      hnnn: this._minDigits(inst._periods[H], 3), h1: digit(inst._periods[H], 1),
	      h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
	      h1000: digit(inst._periods[H], 1000),
	      ml: labelFor(M), mn: inst._periods[M], mnn: this._minDigits(inst._periods[M], 2),
	      mnnn: this._minDigits(inst._periods[M], 3), m1: digit(inst._periods[M], 1),
	      m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
	      m1000: digit(inst._periods[M], 1000),
	      sl: labelFor(S), sn: inst._periods[S], snn: this._minDigits(inst._periods[S], 2),
	      snnn: this._minDigits(inst._periods[S], 3), s1: digit(inst._periods[S], 1),
	      s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
	      s1000: digit(inst._periods[S], 1000)};
	    var html = layout;
	    // Replace period containers: {p<}...{p>}
	    for (var i = Y; i <= S; i++) {
	      var period = 'yowdhms'.charAt(i);
	      var re = new RegExp('\\{' + period + '<\\}(.*)\\{' + period + '>\\}', 'g');
	      html = html.replace(re, ((!significant && show[i]) ||
	        (significant && showSignificant[i]) ? '$1' : ''));
	    }
	    // Replace period values: {pn}
	    $.each(subs, function(n, v) {
	      var re = new RegExp('\\{' + n + '\\}', 'g');
	      html = html.replace(re, v);
	    });
	    return html;
	  },

	  /* Ensure a numeric value has at least n digits for display.
	     @param  value  (number) the value to display
	     @param  len    (number) the minimum length
	     @return  (string) the display text */
	  _minDigits: function(value, len) {
	    value = '' + value;
	    if (value.length >= len) {
	      return value;
	    }
	    value = '0000000000' + value;
	    return value.substr(value.length - len);
	  },

	  /* Translate the format into flags for each period.
	     @param  inst  (object) the current settings for this instance
	     @return  (string[7]) flags indicating which periods are requested (?) or
	              required (!) by year, month, week, day, hour, minute, second */
	  _determineShow: function(inst) {
	    var format = this._get(inst, 'format');
	    var show = [];
	    show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
	    show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
	    show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
	    show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
	    show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
	    show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
	    show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
	    return show;
	  },

	  /* Calculate the requested periods between now and the target time.
	     @param  inst         (object) the current settings for this instance
	     @param  show         (string[7]) flags indicating which periods are requested/required
	     @param  significant  (number) the number of periods with values to show, zero for all
	     @param  now          (Date) the current date and time
	     @return  (number[7]) the current time periods (always positive)
	              by year, month, week, day, hour, minute, second */
	  _calculatePeriods: function(inst, show, significant, now) {
	    // Find endpoints
	    inst._now = now;
	    inst._now.setMilliseconds(0);
	    var until = new Date(inst._now.getTime());
	    if (inst._since) {
	      if (now.getTime() < inst._since.getTime()) {
	        inst._now = now = until;
	      }
	      else {
	        now = inst._since;
	      }
	    }
	    else {
	      until.setTime(inst._until.getTime());
	      if (now.getTime() > inst._until.getTime()) {
	        inst._now = now = until;
	      }
	    }
	    // Calculate differences by period
	    var periods = [0, 0, 0, 0, 0, 0, 0];
	    if (show[Y] || show[O]) {
	      // Treat end of months as the same
	      var lastNow = $.countdown._getDaysInMonth(now.getFullYear(), now.getMonth());
	      var lastUntil = $.countdown._getDaysInMonth(until.getFullYear(), until.getMonth());
	      var sameDay = (until.getDate() == now.getDate() ||
	        (until.getDate() >= Math.min(lastNow, lastUntil) &&
	        now.getDate() >= Math.min(lastNow, lastUntil)));
	      var getSecs = function(date) {
	        return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
	      };
	      var months = Math.max(0,
	        (until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
	        ((until.getDate() < now.getDate() && !sameDay) ||
	        (sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
	      periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
	      periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
	      // Adjust for months difference and end of month if necessary
	      now = new Date(now.getTime());
	      var wasLastDay = (now.getDate() == lastNow);
	      var lastDay = $.countdown._getDaysInMonth(now.getFullYear() + periods[Y],
	        now.getMonth() + periods[O]);
	      if (now.getDate() > lastDay) {
	        now.setDate(lastDay);
	      }
	      now.setFullYear(now.getFullYear() + periods[Y]);
	      now.setMonth(now.getMonth() + periods[O]);
	      if (wasLastDay) {
	        now.setDate(lastDay);
	      }
	    }
	    var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
	    var extractPeriod = function(period, numSecs) {
	      periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
	      diff -= periods[period] * numSecs;
	    };
	    extractPeriod(W, 604800);
	    extractPeriod(D, 86400);
	    extractPeriod(H, 3600);
	    extractPeriod(M, 60);
	    extractPeriod(S, 1);
	    if (diff > 0 && !inst._since) { // Round up if left overs
	      var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
	      var lastShown = S;
	      var max = 1;
	      for (var period = S; period >= Y; period--) {
	        if (show[period]) {
	          if (periods[lastShown] >= max) {
	            periods[lastShown] = 0;
	            diff = 1;
	          }
	          if (diff > 0) {
	            periods[period]++;
	            diff = 0;
	            lastShown = period;
	            max = 1;
	          }
	        }
	        max *= multiplier[period];
	      }
	    }
	    if (significant) { // Zero out insignificant periods
	      for (var period = Y; period <= S; period++) {
	        if (significant && periods[period]) {
	          significant--;
	        }
	        else if (!significant) {
	          periods[period] = 0;
	        }
	      }
	    }
	    return periods;
	  }
	});

	/* jQuery extend now ignores nulls!
	   @param  target  (object) the object to update
	   @param  props   (object) the new settings
	   @return  (object) the updated object */
	function extendRemove(target, props) {
	  $.extend(target, props);
	  for (var name in props) {
	    if (props[name] == null) {
	      target[name] = null;
	    }
	  }
	  return target;
	}

	/* Process the countdown functionality for a jQuery selection.
	   @param  command  (string) the command to run (optional, default 'attach')
	   @param  options  (object) the new settings to use for these countdown instances
	   @return  (jQuery) for chaining further calls */
	$.fn.countdown = function(options) {
	  var otherArgs = Array.prototype.slice.call(arguments, 1);
	  if (options == 'getTimes' || options == 'settings') {
	    return $.countdown['_' + options + 'Countdown'].
	      apply($.countdown, [this[0]].concat(otherArgs));
	  }
	  return this.each(function() {
	    if (typeof options == 'string') {
	      $.countdown['_' + options + 'Countdown'].apply($.countdown, [this].concat(otherArgs));
	    }
	    else {
	      $.countdown._attachCountdown(this, options);
	    }
	  });
	};

	/* Initialise the countdown functionality. */
	$.countdown = new Countdown(); // singleton instance

	})(jQuery);
	
	
	/*
	 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
	 *
	 * Uses the built In easIng capabilities added In jQuery 1.1
	 * to offer multiple easIng options
	 *
	 * Copyright (c) 2007 George Smith
	 * Licensed under the MIT License:
	 *   http://www.opensource.org/licenses/mit-license.php
	 */

	// t: current time, b: begInnIng value, c: change In value, d: duration

	jQuery.extend( jQuery.easing,
	{
	  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;
	  }
	});
	
	/*
	  AnythingSlider v1.5.6.5

	  By Chris Coyier: http://css-tricks.com
	  with major improvements by Doug Neiner: http://pixelgraphics.us/
	  based on work by Remy Sharp: http://jqueryfordesigners.com/
	  crazy mods by Rob Garrison (aka Mottie)

	  To use the navigationFormatter function, you must have a function that
	  accepts two paramaters, and returns a string of HTML text.

	  index = integer index (1 based);
	  panel = jQuery wrapped LI item this tab references
	  @return = Must return a string of HTML/Text

	  navigationFormatter: function(index, panel){
	    return "Panel #" + index; // This would have each tab with the text 'Panel #X' where X = index
	  }
	*/

	(function($) {

	  $.anythingSlider = function(el, options) {

	    // To avoid scope issues, use 'base' instead of 'this'
	    // to reference this class from internal events and functions.
	    var base = this;

	    // Wraps the ul in the necessary divs and then gives Access to jQuery element
	    base.$el = $(el).addClass('anythingBase').wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');

	    // Add a reverse reference to the DOM object
	    base.$el.data("AnythingSlider", base);

	    base.init = function(){

	      base.options = $.extend({}, $.anythingSlider.defaults, options);

	      if ($.isFunction(base.options.onBeforeInitialize)) { base.$el.bind('before_initialize', base.options.onBeforeInitialize); }
	      base.$el.trigger('before_initialize', base);

	      // Cache existing DOM elements for later
	      // base.$el = original ul
	      // for wrap - get parent() then closest in case the ul has "anythingSlider" class
	      base.$wrapper = base.$el.parent().closest('div.anythingSlider').addClass('anythingSlider-' + base.options.theme);
	      base.$window = base.$el.closest('div.anythingWindow');
	      base.$controls = $('<div class="anythingControls"></div>').appendTo( $(base.options.appendControlsTo).length ? $(base.options.appendControlsTo) : base.$wrapper);
	      base.$nav = $('<ul class="thumbNav" />').appendTo(base.$controls);

	      // Set up a few defaults & get details
	      base.timer   = null;  // slideshow timer (setInterval) container
	      base.flag    = false; // event flag to prevent multiple calls (used in control click/focusin)
	      base.playing = false; // slideshow state
	      base.hovered = false; // actively hovering over the slider
	      base.panelSize = [];  // will contain dimensions and left position of each panel
	      base.currentPage = base.options.startPanel;
	      if (base.options.playRtl) { base.$wrapper.addClass('rtl'); }

	      // save some options
	      base.original = [ base.options.autoPlay, base.options.buildNavigation, base.options.buildArrows];
	      base.updateSlider();

	      base.$currentPage = base.$items.eq(base.currentPage);
	      base.$lastPage = base.$currentPage;

	      // Get index (run time) of this slider on the page
	      base.runTimes = $('div.anythingSlider').index(base.$wrapper) + 1;
	      base.regex = new RegExp('panel' + base.runTimes + '-(\\d+)', 'i'); // hash tag regex

	      // Make sure easing function exists.
	      if (!$.isFunction($.easing[base.options.easing])) { base.options.easing = "swing"; }

	      // Add theme stylesheet, if it isn't already loaded
	      if (base.options.theme != 'default' && !$('link[href*=' + base.options.theme + ']').length){
	        $('body').append('<link rel="stylesheet" href="' + base.options.themeDirectory.replace(/\{themeName\}/g, base.options.theme) + '" type="text/css" />');
	      }

	      // If pauseOnHover then add hover effects
	      if (base.options.pauseOnHover) {
	        base.$wrapper.hover(function() {
	          if (base.playing) {
	            base.$el.trigger('slideshow_paused', base);
	            base.clearTimer(true);
	          }
	        }, function() {
	          if (base.playing) {
	            base.$el.trigger('slideshow_unpaused', base);
	            base.startStop(base.playing, true);
	          }
	        });
	      }

	      // If a hash can not be used to trigger the plugin, then go to start panel
	      var startPanel = (base.options.hashTags) ? base.gotoHash() || base.options.startPanel : base.options.startPanel;
	      base.setCurrentPage(startPanel, false); // added to trigger events for FX code

	      // Hide/Show navigation & play/stop controls
	      base.slideControls(false);
	      base.$wrapper.hover(function(e){
	        base.hovered = (e.type=="mouseenter") ? true : false;
	        base.slideControls( base.hovered, false );
	      });

	      // Add keyboard navigation
	      if (base.options.enableKeyboard) {
	        $(document).keyup(function(e){
	          if (base.$wrapper.is('.activeSlider')) {
	            switch (e.which) {
	              case 39: // right arrow
	                base.goForward();
	                break;
	              case 37: //left arrow
	                base.goBack();
	                break;
	            }
	          }
	        });
	      }

	      // Binds events
	      if ($.isFunction(base.options.onShowPause))   { base.$el.bind('slideshow_paused', base.options.onShowPause); }
	      if ($.isFunction(base.options.onShowUnpause)) { base.$el.bind('slideshow_unpaused', base.options.onShowUnpause); }
	      if ($.isFunction(base.options.onSlideInit))   { base.$el.bind('slide_init', base.options.onSlideInit); }
	      if ($.isFunction(base.options.onSlideBegin))  { base.$el.bind('slide_begin', base.options.onSlideBegin); }
	      if ($.isFunction(base.options.onShowStop))    { base.$el.bind('slideshow_stop', base.options.onShowStop); }
	      if ($.isFunction(base.options.onShowStart))   { base.$el.bind('slideshow_start', base.options.onShowStart); }
	      if ($.isFunction(base.options.onInitialized)) { base.$el.bind('initialized', base.options.onInitialized); }
	      if ($.isFunction(base.options.onSWFComplete)) { base.$el.bind('swf_completed', base.options.onSWFComplete); }
	      if ($.isFunction(base.options.onSlideComplete)){
	        // Added setTimeout (zero time) to ensure animation is complete... see this bug report: http://bugs.jquery.com/ticket/7157
	        base.$el.bind('slide_complete', function(){
	          setTimeout(function(){ base.options.onSlideComplete(base); }, 0);
	        });
	      }
	      base.$el.trigger('initialized', base);

	    };

	    // called during initialization & to update the slider if a panel is added or deleted
	    base.updateSlider = function(){
	      // needed for updating the slider
	      base.$el.find('li.cloned').remove();
	      base.$nav.empty();

	      base.$items = base.$el.find('> li'); 
	      base.pages = base.$items.length;

	      // Set the dimensions of each panel
	      if (base.options.resizeContents) {
	        if (base.options.width) { base.$wrapper.add(base.$items).css('width', base.options.width); }
	        if (base.options.height) { base.$wrapper.add(base.$items).css('height', base.options.height); }
	      }

	      // Remove navigation & player if there is only one page
	      if (base.pages === 1) {
	        base.options.autoPlay = false;
	        base.options.buildNavigation = false;
	        base.options.buildArrows = false;
	        base.$controls.hide();
	        base.$nav.hide();
	        if (base.$forward) { base.$forward.add(base.$back).hide(); }
	      } else {
	        base.options.autoPlay = base.original[0];
	        base.options.buildNavigation = base.original[1];
	        base.options.buildArrows = base.original[2];
	        base.$controls.show();
	        base.$nav.show();
	        if (base.$forward) { base.$forward.add(base.$back).show(); }
	      }

	      // Build navigation tabs
	      base.buildNavigation();

	      // If autoPlay functionality is included, then initialize the settings
	      if (base.options.autoPlay) {
	        base.playing = !base.options.startStopped; // Sets the playing variable to false if startStopped is true
	        base.buildAutoPlay();
	      }

	      // Build forwards/backwards buttons
	      if (base.options.buildArrows) { base.buildNextBackButtons(); }

	      // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
	      // This supports the "infinite" scrolling, also ensures any cloned elements don't duplicate an ID
	      base.$el.prepend( base.$items.filter(':last').clone().addClass('cloned').removeAttr('id') );
	      base.$el.append( base.$items.filter(':first').clone().addClass('cloned').removeAttr('id') );
	      base.$el.find('li.cloned').each(function(){
	        // replace <a> with <span> in cloned panels to prevent shifting the panels by tabbing
	        $(this).html(function(i,h){ return h.replace(/<a/gi, '<span').replace(/\/a>/gi, '/span>'); });
	      });

	      // We just added two items, time to re-cache the list, then get the dimensions of each panel
	      base.$items = base.$el.find('> li').addClass('panel');
	      base.setDimensions();
	      if (!base.options.resizeContents) { $(window).load(function(){ base.setDimensions(); }); } // set dimensions after all images load

	      if (base.currentPage > base.pages) {
	        base.currentPage = base.pages;
	        base.setCurrentPage(base.pages, false);
	      }
	      base.$nav.find('a').eq(base.currentPage - 1).addClass('cur'); // update current selection

	      base.hasEmb = base.$items.find('embed[src*=youtube]').length; // embedded youtube objects exist in the slider
	      base.hasSwfo = (typeof(swfobject) !== 'undefined' && swfobject.hasOwnProperty('embedSWF') && $.isFunction(swfobject.embedSWF)) ? true : false; // is swfobject loaded?

	      // Initialize YouTube javascript api, if YouTube video is present
	      if (base.hasEmb && base.hasSwfo) {
	        base.$items.find('embed[src*=youtube]').each(function(i){
	          // Older IE doesn't have an object - just make sure we are wrapping the correct element
	          var $tar = ($(this).parent()[0].tagName == "OBJECT") ? $(this).parent() : $(this);
	          $tar.wrap('<div id="ytvideo' + i + '"></div>');
	          // use SWFObject if it exists, it replaces the wrapper with the object/embed
	          swfobject.embedSWF($(this).attr('src') + '&enablejsapi=1&version=3&playerapiid=ytvideo' + i, 'ytvideo' + i,
	            $tar.attr('width'), $tar.attr('height'), '10', null, null,
	            { allowScriptAccess: "always", wmode : base.options.addWmodeToObject }, { 'class' : $tar.attr('class'), 'style' : $tar.attr('style') }, 
	            function(){ if (i >= base.hasEmb - 1) { base.$el.trigger('swf_completed', base); } } // swf callback
	          );
	        });
	      }

	      // Fix tabbing through the page
	      base.$items.find('a').unbind('focus').bind('focus', function(e){
	        base.$items.find('.focusedLink').removeClass('focusedLink');
	        $(this).addClass('focusedLink');
	        var panel = $(this).closest('.panel');
	        if (!panel.is('.activePage')) {
	          base.gotoPage(base.$items.index(panel));
	          e.preventDefault();
	        }
	      });

	    };

	    // Creates the numbered navigation links
	    base.buildNavigation = function() {

	      if (base.options.buildNavigation && (base.pages > 1)) {
	        base.$items.filter(':not(.cloned)').each(function(i,el) {
	          var index = i + 1,
	            klass = ((index == 1) ? 'first' : '') + ((index == base.pages) ? 'last' : ''),
	            $a = $('<a href="#"></a>').addClass('panel' + index).wrap('<li class="' + klass + '" />');
	          base.$nav.append($a.parent()); // use $a.parent() so IE will add <li> instead of only the <a> to the <ul>

	          // If a formatter function is present, use it
	          if ($.isFunction(base.options.navigationFormatter)) {
	            var tmp = base.options.navigationFormatter(index, $(this));
	            $a.html(tmp);
	            // Add formatting to title attribute if text is hidden
	            if (parseInt($a.css('text-indent'),10) < 0) { $a.addClass(base.options.tooltipClass).attr('title', tmp); }
	          } else {
	            $a.text(index);
	          }

	          $a.bind(base.options.clickControls, function(e) {
	            if (!base.flag && base.options.enableNavigation) {
	              // prevent running functions twice (once for click, second time for focusin)
	              base.flag = true; setTimeout(function(){ base.flag = false; }, 100);
	              base.gotoPage(index);
	              if (base.options.hashTags) { base.setHash(index); }
	            }
	            e.preventDefault();
	          });
	        });
	      }
	    };

	    // Creates the Forward/Backward buttons
	    base.buildNextBackButtons = function() {
	      if (base.$forward) { return; }
	      base.$forward = $('<span class="arrow forward"><a href="#">' + base.options.forwardText + '</a></span>');
	      base.$back = $('<span class="arrow back"><a href="#">' + base.options.backText + '</a></span>');

	      // Bind to the forward and back buttons
	      base.$back.bind(base.options.clickArrows, function(e) {
	        base.goBack();
	        e.preventDefault();
	      });
	      base.$forward.bind(base.options.clickArrows, function(e) {
	        base.goForward();
	        e.preventDefault();
	      });
	      // using tab to get to arrow links will show they have focus (outline is disabled in css)
	      base.$back.add(base.$forward).find('a').bind('focusin focusout',function(){
	       $(this).toggleClass('hover');
	      });

	      // Append elements to page
	      base.$wrapper.prepend(base.$forward).prepend(base.$back);
	      base.$arrowWidth = base.$forward.width();
	    };

	    // Creates the Start/Stop button
	    base.buildAutoPlay = function(){
	      if (base.$startStop) { return; }
	      base.$startStop = $("<a href='#' class='start-stop'></a>").html(base.playing ? base.options.stopText : base.options.startText);
	      base.$controls.prepend(base.$startStop);
	      base.$startStop
	        .bind(base.options.clickSlideshow, function(e) {
	          if (base.options.enablePlay) {
	            base.startStop(!base.playing);
	            if (base.playing) {
	              if (base.options.playRtl) {
	                base.goBack(true);
	              } else {
	                base.goForward(true);
	              }
	            }
	          }
	          e.preventDefault();
	        })
	        // show button has focus while tabbing
	        .bind('focusin focusout',function(){
	          $(this).toggleClass('hover');
	        });

	      // Use the same setting, but trigger the start;
	      base.startStop(base.playing);
	    };

	    // Set panel dimensions to either resize content or adjust panel to content
	    base.setDimensions = function(){
	      var w, h, c, cw, dw, leftEdge = 0, bww = base.$window.width(), winw = $(window).width();
	      base.$items.each(function(i){
	        c = $(this).children('*');
	        if (base.options.resizeContents){
	          // get viewport width & height from options (if set), or css
	          w = parseInt(base.options.width,10) || bww;
	          h = parseInt(base.options.height,10) || base.$window.height();
	          // resize panel
	          $(this).css({ width: w, height: h });
	          // resize panel contents, if solitary (wrapped content or solitary image)
	          if (c.length == 1){
	            c.css({ width: '100%', height: '100%' });
	            if (c[0].tagName == "OBJECT") { c.find('embed').andSelf().attr({ width: '100%', height: '100%' }); }
	          }
	        } else {
	          // get panel width & height and save it
	          w = $(this).width(); // if not defined, it will return the width of the ul parent
	          dw = (w >= winw) ? true : false; // width defined from css?
	          if (c.length == 1 && dw){
	            cw = (c.width() >= winw) ? bww : c.width(); // get width of solitary child
	            $(this).css('width', cw); // set width of panel
	            c.css('max-width', cw);   // set max width for all children
	            w = cw;
	          }
	          w = (dw) ? base.options.width || bww : w;
	          $(this).css('width', w);
	          h = $(this).outerHeight(); // get height after setting width
	          $(this).css('height', h);
	        }
	        base.panelSize[i] = [w,h,leftEdge];
	        leftEdge += w;
	      });
	      // Set total width of slider, but don't go beyond the set max overall width (limited by Opera)
	      base.$el.css('width', (leftEdge < base.options.maxOverallWidth) ? leftEdge : base.options.maxOverallWidth);
	    };

	    base.gotoPage = function(page, autoplay, callback) {
	      if (base.pages === 1) { return; }
	      base.$lastPage = base.$items.eq(base.currentPage);
	      if (typeof(page) === "undefined" || page === null) {
	        page = base.options.startPage;
	        base.setCurrentPage(base.options.startPage);
	      }

	      // pause YouTube videos before scrolling or prevent change if playing
	      if (base.hasEmb && base.checkVideo(base.playing)) { return; }

	      if (page > base.pages + 1) { page = base.pages; }
	      if (page < 0 ) { page = 1; }
	      base.$currentPage = base.$items.eq(page);
	      base.currentPage = page; // ensure that event has correct target page
	      base.$el.trigger('slide_init', base);

	      base.slideControls(true, false);

	      // When autoplay isn't passed, we stop the timer
	      if (autoplay !== true) { autoplay = false; }
	      // Stop the slider when we reach the last page, if the option stopAtEnd is set to true
	      if (!autoplay || (base.options.stopAtEnd && page == base.pages)) { base.startStop(false); }

	      base.$el.trigger('slide_begin', base);

	      // resize slider if content size varies
	      if (!base.options.resizeContents) {
	        // animating the wrapper resize before the window prevents flickering in Firefox
	        base.$wrapper.filter(':not(:animated)').animate(
	          { width: base.panelSize[page][0], height: base.panelSize[page][1] },
	          { queue: false, duration: base.options.animationTime, easing: base.options.easing }
	        );
	      }
	      // Animate Slider
	      base.$window.filter(':not(:animated)').animate(
	        { scrollLeft : base.panelSize[page][2] },
	        { queue: false, duration: base.options.animationTime, easing: base.options.easing, complete: function(){ base.endAnimation(page, callback); } }
	      );
	    };

	    base.endAnimation = function(page, callback){
	      if (page === 0) {
	        base.$window.scrollLeft(base.panelSize[base.pages][2]);
	        page = base.pages;
	      } else if (page > base.pages) {
	        // reset back to start position
	        base.$window.scrollLeft(base.panelSize[1][2]);
	        page = 1;
	      }
	      base.setCurrentPage(page, false);
	      // Add active panel class
	      base.$items.removeClass('activePage').eq(page).addClass('activePage');

	      if (!base.hovered) { base.slideControls(false); }

	      // continue YouTube video if in current panel
	      if (base.hasEmb){
	        var emb = base.$currentPage.find('object[id*=ytvideo], embed[id*=ytvideo]');
	        // player states: unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5).
	        if (emb.length && $.isFunction(emb[0].getPlayerState) && emb[0].getPlayerState() > 0 && emb[0].getPlayerState() != 5) {
	          emb[0].playVideo();
	        }
	      }

	      base.$el.trigger('slide_complete', base);
	      // callback from external slide control: $('#slider').anythingSlider(4, function(slider){ })
	      if (typeof callback === 'function') { callback(base); }
	      // Continue slideshow after a delay
	      if (base.options.autoPlayLocked && !base.playing) {
	        setTimeout(function(){
	          base.startStop(true);
	        // subtract out slide delay as the slideshow waits that additional time.
	        }, base.options.resumeDelay - base.options.delay);
	      }
	    };

	    base.setCurrentPage = function(page, move) {
	      if (page > base.pages + 1) { page = base.pages; }
	      if (page < 0 ) { page = 1; }

	      // Set visual
	      if (base.options.buildNavigation){
	        base.$nav.find('.cur').removeClass('cur');
	        base.$nav.find('a').eq(page - 1).addClass('cur');
	      }

	      // Only change left if move does not equal false
	      if (!move) {
	        base.$wrapper.css({
	          width: base.panelSize[page][0],
	          height: base.panelSize[page][1]
	        });
	        base.$wrapper.scrollLeft(0); // reset in case tabbing changed this scrollLeft
	        base.$window.scrollLeft( base.panelSize[page][2] );
	      }
	      // Update local variable
	      base.currentPage = page;

	      // Set current slider as active so keyboard navigation works properly
	      if (!base.$wrapper.is('.activeSlider')){
	        $('.activeSlider').removeClass('activeSlider');
	        base.$wrapper.addClass('activeSlider');
	      }
	    };

	    base.goForward = function(autoplay) {
	      if (autoplay !== true) { autoplay = false; base.startStop(false); }
	      base.gotoPage(base.currentPage + 1, autoplay);
	    };

	    base.goBack = function(autoplay) {
	      if (autoplay !== true) { autoplay = false; base.startStop(false); }
	      base.gotoPage(base.currentPage - 1, autoplay);
	    };

	    // This method tries to find a hash that matches panel-X
	    // If found, it tries to find a matching item
	    // If that is found as well, then that item starts visible
	    base.gotoHash = function(){
	      var n = window.location.hash.match(base.regex);
	      return (n===null) ? '' : parseInt(n[1],10);
	    };

	    base.setHash = function(n){
	      var s = 'panel' + base.runTimes + '-',
	        h = window.location.hash;
	      if ( typeof h !== 'undefined' ) {
	        window.location.hash = (h.indexOf(s) > 0) ? h.replace(base.regex, s + n) : h + "&" + s + n;
	      }
	    };

	    // Slide controls (nav and play/stop button up or down)
	    base.slideControls = function(toggle, playing){
	      var dir = (toggle) ? 'slideDown' : 'slideUp',
	        t1 = (toggle) ? 0 : base.options.animationTime,
	        t2 = (toggle) ? base.options.animationTime: 0,
	        sign = (toggle) ? 0 : 1; // 0 = visible, 1 = hidden
	      if (base.options.toggleControls) {
	        base.$controls.stop(true,true).delay(t1)[dir](base.options.animationTime/2).delay(t2); 
	      }
	      if (base.options.buildArrows && base.options.toggleArrows) {
	        if (!base.hovered && base.playing) { sign = 1; t2 = 0; } // don't animate arrows during slideshow
	        base.$forward.stop(true,true).delay(t1).animate({ right: sign * base.$arrowWidth, opacity: t2 }, base.options.animationTime/2);
	        base.$back.stop(true,true).delay(t1).animate({ left: sign * base.$arrowWidth, opacity: t2 }, base.options.animationTime/2);
	      }
	    };

	    base.clearTimer = function(paused){
	      // Clear the timer only if it is set
	      if (base.timer) { 
	        window.clearInterval(base.timer); 
	        if (!paused) {
	          base.$el.trigger('slideshow_stop', base); 
	        }
	      }
	    };

	    // Handles stopping and playing the slideshow
	    // Pass startStop(false) to stop and startStop(true) to play
	    base.startStop = function(playing, paused) {
	      if (playing !== true) { playing = false; } // Default if not supplied is false

	      if (playing && !paused) {
	        base.$el.trigger('slideshow_start', base);
	      }

	      // Update variable
	      base.playing = playing;

	      // Toggle playing and text
	      if (base.options.autoPlay) {
	        base.$startStop.toggleClass('playing', playing).html( playing ? base.options.stopText : base.options.startText );
	        // add button text to title attribute if it is hidden by text-indent
	        if (parseInt(base.$startStop.css('text-indent'),10) < 0) {
	          base.$startStop.addClass(base.options.tooltipClass).attr('title', playing ? 'Stop' : 'Start');
	        }
	      }

	      if (playing){
	        base.clearTimer(true); // Just in case this was triggered twice in a row
	        base.timer = window.setInterval(function() {
	          // prevent autoplay if video is playing
	          if (!(base.hasEmb && base.checkVideo(playing))) {
	            if (base.options.playRtl) {
	              base.goBack(true);
	            } else {
	              base.goForward(true);
	            }
	          }
	        }, base.options.delay);
	      } else {
	        base.clearTimer();
	      }
	    };

	    base.checkVideo = function(playing){
	      // pause YouTube videos before scrolling?
	      var emb, ps, stopAdvance = false;
	      base.$items.find('object[id*=ytvideo], embed[id*=ytvideo]').each(function(){ // include embed for IE; if not using SWFObject, old detach/append code needs "object embed" here
	        emb = $(this);
	        if (emb.length && $.isFunction(emb[0].getPlayerState)) {
	          // player states: unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5).
	          ps = emb[0].getPlayerState();
	          // if autoplay, video playing, video is in current panel and resume option are true, then don't advance
	          if (playing && (ps == 1 || ps > 2) && base.$items.index(emb.closest('li.panel')) == base.currentPage && base.options.resumeOnVideoEnd) {
	            stopAdvance = true;
	          } else {
	            // pause video if not autoplaying (if already initialized)
	            if (ps > 0) { emb[0].pauseVideo(); }
	          }
	        }
	      });
	      return stopAdvance;
	    };

	    // Trigger the initialization
	    base.init();
	  };

	  $.anythingSlider.defaults = {
	    // Appearance
	    width               : null,      // Override the default CSS width
	    height              : null,      // Override the default CSS height
	    resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
	    tooltipClass        : 'tooltip', // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)
	    theme               : 'default', // Theme name
	    themeDirectory      : 'css/theme-{themeName}.css', // Theme directory & filename {themeName} is replaced by the theme value above

	    // Navigation
	    startPanel          : 1,         // This sets the initial panel
	    hashTags            : false,      // Should links change the hashtag in the URL?
	    enableKeyboard      : false,      // if false, keyboard arrow keys will not work for the current panel.
	    buildArrows         : true,      // If true, builds the forwards and backwards buttons
	    toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
	    buildNavigation     : false,      // If true, builds a list of anchor links to link to each panel
	    enableNavigation    : true,      // if false, navigation links will still be visible, but not clickable.
	    toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
	    appendControlsTo    : null,      // A HTML element (jQuery Object, selector or HTMLNode) to which the controls will be appended if not null
	    navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
	    forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
	    backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)

	    // Slideshow options
	    enablePlay          : true,      // if false, the play/stop button will still be visible, but not clickable.
	    autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
	    autoPlayLocked      : false,     // If true, user changing slides will not stop the slideshow
	    startStopped        : false,     // If autoPlay is on, this can force it to start stopped
	    pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
	    resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video is complete
	    stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
	    playRtl             : false,     // If true, the slideshow will move right-to-left
	    startText           : "Start",   // Start button text
	    stopText            : "Stop",    // Stop button text
	    delay               : 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
	    resumeDelay         : 15000,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
	    animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)
	    easing              : "swing",   // Anything other than "linear" or "swing" requires the easing plugin

	    // Callbacks
	    onBeforeInitialize  : null,      // Callback before the plugin initializes
	    onInitialized       : null,      // Callback when the plugin finished initializing
	    onSWFComplete       : null,      // Callback when SWFObject completes setting up embedded objects
	    onShowStart         : null,      // Callback on slideshow start
	    onShowStop          : null,      // Callback after slideshow stops
	    onShowPause         : null,      // Callback when slideshow pauses
	    onShowUnpause       : null,      // Callback when slideshow unpauses - may not trigger properly if user clicks on any controls
	    onSlideInit         : null,      // Callback when slide initiates, before control animation
	    onSlideBegin        : null,      // Callback before slide animates
	    onSlideComplete     : null,      // Callback when slide completes

	    // Interactivity
	    clickArrows         : "click",         // Event used to activate arrow functionality (e.g. "click" or "mouseenter")
	    clickControls       : "click focusin", // Events used to activate navigation control functionality
	    clickSlideshow      : "click",         // Event used to activate slideshow play/stop button

	    // Misc options
	    addWmodeToObject    : "opaque", // If your slider has an embedded object, the script will automatically add a wmode parameter with this setting
	    maxOverallWidth     : 32766     // Max width (in pixels) of combined sliders (side-to-side); set to 32766 to prevent problems with Opera
	  };

	  $.fn.anythingSlider = function(options, callback) {

	    return this.each(function(i){
	      var anySlide = $(this).data('AnythingSlider');

	      // initialize the slider but prevent multiple initializations
	      if ((typeof(options)).match('object|undefined')){
	        if (!anySlide) {
	          (new $.anythingSlider(this, options));
	        } else {
	          anySlide.updateSlider();
	        }
	      // If options is a number, process as an external link to page #: $(element).anythingSlider(#)
	      } else if (/\d/.test(options) && !isNaN(options) && anySlide) {
	        var page = (typeof(options) == "number") ? options : parseInt($.trim(options),10); // accepts "  2  "
	        // ignore out of bound pages
	        if ( page >= 1 && page <= anySlide.pages ) {
	          anySlide.gotoPage(page, false, callback); // page #, autoplay, one time callback
	        }
	      }
	    });
	  };

	})(jQuery);
	
	/*!
	 * liScroll 1.0
	 * Examples and documentation at: 
	 * http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html
	 * 2007-2010 Gian Carlo Mingati
	 * Version: 1.0.2 (30-MARCH-2009)
	 * Dual licensed under the MIT and GPL licenses:
	 * http://www.opensource.org/licenses/mit-license.php
	 * http://www.gnu.org/licenses/gpl.html
	 * Requires:
	 * jQuery v1.2.x or later
	 * 
	 */


	jQuery.fn.liScroll = function(settings) {
	    settings = jQuery.extend({
	    travelocity: 0.07
	    }, settings);    
	    return this.each(function(){
	        var $strip = jQuery(this);
	        $strip.addClass("newsticker")
	        var stripWidth = 0;
	        var $mask = $strip.wrap("<div class='mask'></div>");
	        var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");                
	        var containerWidth = $strip.parent().parent().width();  //a.k.a. 'mask' width   
	        $strip.find("li").each(function(i){
	        stripWidth += jQuery(this, i).outerWidth(true); // thanks to Michael Haszprunar
	        });
	        $strip.width(stripWidth);      
	        var totalTravel = stripWidth+containerWidth;
	        var defTiming = totalTravel/settings.travelocity;  // thanks to Scott Waye    
	        function scrollnews(spazio, tempo){
	        $strip.animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);});
	        }
	        scrollnews(totalTravel, defTiming);        
	        $strip.hover(function(){
	        jQuery(this).stop();
	        },
	        function(){
	        var offset = jQuery(this).offset();
	        var residualSpace = offset.left + stripWidth;
	        var residualTime = residualSpace/settings.travelocity;
	        scrollnews(residualSpace, residualTime);
	        });      
	    });  
	};
 

})(this.jQuery);
