sincosJsonp([5],{

/***/ 0:
/***/ function(module, exports, __webpack_require__) {

	"use strict";

	__webpack_require__(217);

	__webpack_require__(212);

	__webpack_require__(219);

	__webpack_require__(204);

	__webpack_require__(206);

	__webpack_require__(205);

	__webpack_require__(215);

	__webpack_require__(218);

	__webpack_require__(211);

	__webpack_require__(253);

		__webpack_require__(199);

/***/ },

/***/ 199:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function($) {"use strict";

	$(".accordion-trigger").click(function () {
	    var panel = $(this).siblings('.accordion-panel')[0];
	    if (panel.style.maxHeight) {
	        panel.style.maxHeight = null;
	    } else {
	        panel.style.maxHeight = panel.scrollHeight + "px";
	    }
	});
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 202:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	/* Source: http://osvaldas.info/flexbox-based-responsive-equal-height-blocks-with-javascript-fallback */

	;(function ($, window, document, undefined) {
	    'use strict';

	    var s = document.body || document.documentElement,
	        s = s.style;

	    var $list = $('.equal-height-columns'),
	        $items = $list.find('.equal-height-column'),
	        getMaxHeight = function getMaxHeight(items) {
	        var maxHeight = 0,
	            itemHeight = 0;

	        items.each(function () {
	            itemHeight = parseInt($(this).outerHeight());
	            if (itemHeight > maxHeight) {
	                maxHeight = itemHeight;
	            }
	        });

	        return maxHeight;
	    },
	        setHeights = function setHeights() {
	        $items.css('height', 'auto');

	        var perRow = Math.floor($list.width() / $items.width());

	        if (perRow === null || perRow < 2) {
	            return true;
	        }

	        var maxHeight = null;
	        var $row = null;

	        for (var i = 0, j = $items.length; i < j; i += perRow) {
	            $row = $items.slice(i, i + perRow);
	            maxHeight = getMaxHeight($row);
	            $row.css('height', maxHeight);
	        }
	    };

	    setHeights();
	    $(window).on('resize', setHeights);
	    $list.find('img').on('load', setHeights);
		})(jQuery, window, document);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 204:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	/**
	 * BxSlider v4.1.2 - Fully loaded, responsive content slider
	 * http://bxslider.com
	 *
	 * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
	 * Written while drinking Belgian ales and listening to jazz
	 *
	 * Released under the MIT license - http://opensource.org/licenses/MIT
	 */

	;(function ($) {

		var plugin = {};

		var defaults = {

			// GENERAL
			mode: 'horizontal',
			slideSelector: '',
			infiniteLoop: true,
			hideControlOnEnd: false,
			speed: 500,
			easing: null,
			slideMargin: 0,
			startSlide: 0,
			randomStart: false,
			captions: false,
			ticker: false,
			tickerHover: false,
			adaptiveHeight: false,
			adaptiveHeightSpeed: 500,
			video: false,
			useCSS: true,
			preloadImages: 'visible',
			responsive: true,
			slideZIndex: 50,
			wrapperClass: 'bx-wrapper',

			// TOUCH
			touchEnabled: true,
			swipeThreshold: 50,
			oneToOneTouch: true,
			preventDefaultSwipeX: true,
			preventDefaultSwipeY: false,

			// PAGER
			pager: true,
			pagerType: 'full',
			pagerShortSeparator: ' / ',
			pagerSelector: null,
			buildPager: null,
			pagerCustom: null,

			// CONTROLS
			controls: true,
			nextText: 'Next',
			prevText: 'Prev',
			nextSelector: null,
			prevSelector: null,
			autoControls: false,
			startText: 'Start',
			stopText: 'Stop',
			autoControlsCombine: false,
			autoControlsSelector: null,

			// AUTO
			auto: false,
			pause: 4000,
			autoStart: true,
			autoDirection: 'next',
			autoHover: false,
			autoDelay: 0,
			autoSlideForOnePage: false,

			// CAROUSEL
			minSlides: 1,
			maxSlides: 1,
			moveSlides: 0,
			slideWidth: 0,

			// CALLBACKS
			onSliderLoad: function onSliderLoad() {},
			onSlideBefore: function onSlideBefore() {},
			onSlideAfter: function onSlideAfter() {},
			onSlideNext: function onSlideNext() {},
			onSlidePrev: function onSlidePrev() {},
			onSliderResize: function onSliderResize() {}
		};

		$.fn.bxSlider = function (options) {

			if (this.length == 0) return this;

			// support mutltiple elements
			if (this.length > 1) {
				this.each(function () {
					$(this).bxSlider(options);
				});
				return this;
			}

			// create a namespace to be used throughout the plugin
			var slider = {};
			// set a reference to our slider element
			var el = this;
			plugin.el = this;

			/**
	   * Makes slideshow responsive
	   */
			// first get the original window dimens (thanks alot IE)
			var windowWidth = $(window).width();
			var windowHeight = $(window).height();

			// Strict mode does not allow implicit globals
			var speed;

			/**
	   * ===================================================================================
	   * = PRIVATE FUNCTIONS
	   * ===================================================================================
	   */

			/**
	   * Initializes namespace settings to be used throughout plugin
	   */
			var init = function init() {
				// merge user-supplied options with the defaults
				slider.settings = $.extend({}, defaults, options);
				// parse slideWidth setting
				slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
				// store the original children
				slider.children = el.children(slider.settings.slideSelector);
				// check if actual number of slides is less than minSlides / maxSlides
				if (slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
				if (slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
				// if random start, set the startSlide setting to random number
				if (slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
				// store active slide information
				slider.active = { index: slider.settings.startSlide };
				// store if the slider is in carousel mode (displaying / moving multiple slides)
				slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
				// if carousel, force preloadImages = 'all'
				if (slider.carousel) slider.settings.preloadImages = 'all';
				// calculate the min / max width thresholds based on min / max number of slides
				// used to setup and update carousel slides dimensions
				slider.minThreshold = slider.settings.minSlides * slider.settings.slideWidth + (slider.settings.minSlides - 1) * slider.settings.slideMargin;
				slider.maxThreshold = slider.settings.maxSlides * slider.settings.slideWidth + (slider.settings.maxSlides - 1) * slider.settings.slideMargin;
				// store the current state of the slider (if currently animating, working is true)
				slider.working = false;
				// initialize the controls object
				slider.controls = {};
				// initialize an auto interval
				slider.interval = null;
				// determine which property to use for transitions
				slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
				// determine if hardware acceleration can be used
				slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && function () {
					// create our test div element
					var div = document.createElement('div');
					// css transition properties
					var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
					// test for each property
					for (var i in props) {
						if (div.style[props[i]] !== undefined) {
							slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
							slider.animProp = '-' + slider.cssPrefix + '-transform';
							return true;
						}
					}
					return false;
				}();
				// if vertical mode always make maxSlides and minSlides equal
				if (slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
				// save original style data
				el.data("origStyle", el.attr("style"));
				el.children(slider.settings.slideSelector).each(function () {
					$(this).data("origStyle", $(this).attr("style"));
				});
				// perform all DOM / CSS modifications
				setup();
			};

			/**
	   * Performs all DOM and CSS modifications
	   */
			var setup = function setup() {
				// wrap el in a wrapper
				el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
				// store a namspace reference to .bx-viewport
				slider.viewport = el.parent();
				// add a loading div to display while images are loading
				slider.loader = $('<div class="bx-loading" />');
				slider.viewport.prepend(slider.loader);
				// set el to a massive width, to hold any needed slides
				// also strip any margin and padding from el
				el.css({
					width: slider.settings.mode == 'horizontal' ? slider.children.length * 100 + 215 + '%' : 'auto',
					position: 'relative'
				});
				// if using CSS, add the easing property
				if (slider.usingCSS && slider.settings.easing) {
					el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
					// if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
				} else if (!slider.settings.easing) {
						slider.settings.easing = 'swing';
					}
				var slidesShowing = getNumberSlidesShowing();
				// make modifications to the viewport (.bx-viewport)
				slider.viewport.css({
					width: '100%',
					overflow: 'hidden',
					position: 'relative'
				});
				slider.viewport.parent().css({
					maxWidth: getViewportMaxWidth()
				});
				// make modification to the wrapper (.bx-wrapper)
				if (!slider.settings.pager) {
					slider.viewport.parent().css({
						margin: '0 auto 0px'
					});
				}
				// apply css to all slider children
				slider.children.css({
					'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
					listStyle: 'none',
					position: 'relative'
				});
				// apply the calculated width after the float is applied to prevent scrollbar interference
				slider.children.css('width', getSlideWidth());
				// if slideMargin is supplied, add the css
				if (slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
				if (slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
				// if "fade" mode, add positioning and z-index CSS
				if (slider.settings.mode == 'fade') {
					slider.children.css({
						position: 'absolute',
						zIndex: 0,
						display: 'none'
					});
					// prepare the z-index on the showing element
					slider.children.eq(slider.settings.startSlide).css({ zIndex: slider.settings.slideZIndex, display: 'block' });
				}
				// create an element to contain all slider controls (pager, start / stop, etc)
				slider.controls.el = $('<div class="bx-controls" />');
				// if captions are requested, add them
				if (slider.settings.captions) appendCaptions();
				// check if startSlide is last slide
				slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
				// if video is true, set up the fitVids plugin
				if (slider.settings.video) el.fitVids();
				// set the default preload selector (visible)
				var preloadSelector = slider.children.eq(slider.settings.startSlide);
				if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
				// only check for control addition if not in "ticker" mode
				if (!slider.settings.ticker) {
					// if pager is requested, add it
					if (slider.settings.pager) appendPager();
					// if controls are requested, add them
					if (slider.settings.controls) appendControls();
					// if auto is true, and auto controls are requested, add them
					if (slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
					// if any control option is requested, add the controls wrapper
					if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
					// if ticker mode, do not allow a pager
				} else {
						slider.settings.pager = false;
					}
				// preload all images, then perform final DOM / CSS modifications that depend on images being loaded
				loadElements(preloadSelector, start);
			};

			var loadElements = function loadElements(selector, callback) {
				var total = selector.find('img, iframe').length;
				if (total == 0) {
					callback();
					return;
				}
				var count = 0;
				selector.find('img, iframe').each(function () {
					$(this).one('load', function () {
						if (++count == total) callback();
					}).each(function () {
						if (this.complete) $(this).load();
					});
				});
			};

			/**
	   * Start the slider
	   */
			var start = function start() {
				// if infinite loop, prepare additional slides
				if (slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker) {
					var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
					var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
					var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
					el.append(sliceAppend).prepend(slicePrepend);
				}
				// remove the loading DOM element
				slider.loader.remove();
				// set the left / top position of "el"
				setSlidePosition();
				// if "vertical" mode, always use adaptiveHeight to prevent odd behavior
				if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
				// set the viewport height
				slider.viewport.height(getViewportHeight());
				// make sure everything is positioned just right (same as a window resize)
				el.redrawSlider();
				// onSliderLoad callback
				slider.settings.onSliderLoad(slider.active.index);
				// slider has been fully initialized
				slider.initialized = true;
				// bind the resize call to the window
				if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
				// if auto is true and has more than 1 page, start the show
				if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
				// if ticker is true, start the ticker
				if (slider.settings.ticker) initTicker();
				// if pager is requested, make the appropriate pager link active
				if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
				// check for any updates to the controls (like hideControlOnEnd updates)
				if (slider.settings.controls) updateDirectionControls();
				// if touchEnabled is true, setup the touch events
				if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
			};

			/**
	   * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
	   */
			var getViewportHeight = function getViewportHeight() {
				var height = 0;
				// first determine which children (slides) should be used in our height calculation
				var children = $();
				// if mode is not "vertical" and adaptiveHeight is false, include all children
				if (slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight) {
					children = slider.children;
				} else {
					// if not carousel, return the single active child
					if (!slider.carousel) {
						children = slider.children.eq(slider.active.index);
						// if carousel, return a slice of children
					} else {
							// get the individual slide index
							var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
							// add the current slide to the children
							children = slider.children.eq(currentIndex);
							// cycle through the remaining "showing" slides
							for (var i = 1; i <= slider.settings.maxSlides - 1; i++) {
								// if looped back to the start
								if (currentIndex + i >= slider.children.length) {
									children = children.add(slider.children.eq(i - 1));
								} else {
									children = children.add(slider.children.eq(currentIndex + i));
								}
							}
						}
				}
				// if "vertical" mode, calculate the sum of the heights of the children
				if (slider.settings.mode == 'vertical') {
					children.each(function (index) {
						height += $(this).outerHeight();
					});
					// add user-supplied margins
					if (slider.settings.slideMargin > 0) {
						height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
					}
					// if not "vertical" mode, calculate the max height of the children
				} else {
						height = Math.max.apply(Math, children.map(function () {
							return $(this).outerHeight(false);
						}).get());
					}

				if (slider.viewport.css('box-sizing') == 'border-box') {
					height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) + parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
				} else if (slider.viewport.css('box-sizing') == 'padding-box') {
					height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
				}

				return height;
			};

			/**
	   * Returns the calculated width to be used for the outer wrapper / viewport
	   */
			var getViewportMaxWidth = function getViewportMaxWidth() {
				var width = '100%';
				if (slider.settings.slideWidth > 0) {
					if (slider.settings.mode == 'horizontal') {
						width = slider.settings.maxSlides * slider.settings.slideWidth + (slider.settings.maxSlides - 1) * slider.settings.slideMargin;
					} else {
						width = slider.settings.slideWidth;
					}
				}
				return width;
			};

			/**
	   * Returns the calculated width to be applied to each slide
	   */
			var getSlideWidth = function getSlideWidth() {
				// start with any user-supplied slide width
				var newElWidth = slider.settings.slideWidth;
				// get the current viewport width
				var wrapWidth = slider.viewport.width();
				// if slide width was not supplied, or is larger than the viewport use the viewport width
				if (slider.settings.slideWidth == 0 || slider.settings.slideWidth > wrapWidth && !slider.carousel || slider.settings.mode == 'vertical') {
					newElWidth = wrapWidth;
					// if carousel, use the thresholds to determine the width
				} else if (slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal') {
						if (wrapWidth > slider.maxThreshold) {
							// newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
						} else if (wrapWidth < slider.minThreshold) {
								newElWidth = (wrapWidth - slider.settings.slideMargin * (slider.settings.minSlides - 1)) / slider.settings.minSlides;
							}
					}
				return newElWidth;
			};

			/**
	   * Returns the number of slides currently visible in the viewport (includes partially visible slides)
	   */
			var getNumberSlidesShowing = function getNumberSlidesShowing() {
				var slidesShowing = 1;
				if (slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0) {
					// if viewport is smaller than minThreshold, return minSlides
					if (slider.viewport.width() < slider.minThreshold) {
						slidesShowing = slider.settings.minSlides;
						// if viewport is larger than minThreshold, return maxSlides
					} else if (slider.viewport.width() > slider.maxThreshold) {
							slidesShowing = slider.settings.maxSlides;
							// if viewport is between min / max thresholds, divide viewport width by first child width
						} else {
								var childWidth = slider.children.first().width() + slider.settings.slideMargin;
								slidesShowing = Math.floor((slider.viewport.width() + slider.settings.slideMargin) / childWidth);
							}
					// if "vertical" mode, slides showing will always be minSlides
				} else if (slider.settings.mode == 'vertical') {
						slidesShowing = slider.settings.minSlides;
					}
				return slidesShowing;
			};

			/**
	   * Returns the number of pages (one full viewport of slides is one "page")
	   */
			var getPagerQty = function getPagerQty() {
				var pagerQty = 0;
				// if moveSlides is specified by the user
				if (slider.settings.moveSlides > 0) {
					if (slider.settings.infiniteLoop) {
						pagerQty = Math.ceil(slider.children.length / getMoveBy());
					} else {
						// use a while loop to determine pages
						var breakPoint = 0;
						var counter = 0;
						// when breakpoint goes above children length, counter is the number of pages
						while (breakPoint < slider.children.length) {
							++pagerQty;
							breakPoint = counter + getNumberSlidesShowing();
							counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
						}
					}
					// if moveSlides is 0 (auto) divide children length by sides showing, then round up
				} else {
						pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
					}
				return pagerQty;
			};

			/**
	   * Returns the number of indivual slides by which to shift the slider
	   */
			var getMoveBy = function getMoveBy() {
				// if moveSlides was set by the user and moveSlides is less than number of slides showing
				if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) {
					return slider.settings.moveSlides;
				}
				// if moveSlides is 0 (auto)
				return getNumberSlidesShowing();
			};

			/**
	   * Sets the slider's (el) left or top position
	   */
			var setSlidePosition = function setSlidePosition() {
				// if last slide, not infinite loop, and number of children is larger than specified maxSlides
				if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {
					if (slider.settings.mode == 'horizontal') {
						// get the last child's position
						var lastChild = slider.children.last();
						var position = lastChild.position();
						// set the left position
						setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
					} else if (slider.settings.mode == 'vertical') {
						// get the last showing index's position
						var lastShowingIndex = slider.children.length - slider.settings.minSlides;
						var position = slider.children.eq(lastShowingIndex).position();
						// set the top position
						setPositionProperty(-position.top, 'reset', 0);
					}
					// if not last slide
				} else {
						// get the position of the first showing slide
						var position = slider.children.eq(slider.active.index * getMoveBy()).position();
						// check for last slide
						if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
						// set the repective position
						if (position != undefined) {
							if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
						}
					}
			};

			/**
	   * Sets the el's animating property position (which in turn will sometimes animate el).
	   * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
	   *
	   * @param value (int)
	   *  - the animating property's value
	   *
	   * @param type (string) 'slider', 'reset', 'ticker'
	   *  - the type of instance for which the function is being
	   *
	   * @param duration (int)
	   *  - the amount of time (in ms) the transition should occupy
	   *
	   * @param params (array) optional
	   *  - an optional parameter containing any variables that need to be passed in
	   */
			var setPositionProperty = function setPositionProperty(value, type, duration, params) {
				// use CSS transform
				if (slider.usingCSS) {
					// determine the translate3d value
					var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
					// add the CSS transition-duration
					el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
					if (type == 'slide') {
						// set the property value
						el.css(slider.animProp, propValue);
						// bind a callback method - executes when CSS transition completes
						el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
							// unbind the callback
							el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
							updateAfterSlideTransition();
						});
					} else if (type == 'reset') {
						el.css(slider.animProp, propValue);
					} else if (type == 'ticker') {
						// make the transition use 'linear'
						el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
						el.css(slider.animProp, propValue);
						// bind a callback method - executes when CSS transition completes
						el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
							// unbind the callback
							el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
							// reset the position
							setPositionProperty(params['resetValue'], 'reset', 0);
							// start the loop again
							tickerLoop();
						});
					}
					// use JS animate
				} else {
						var animateObj = {};
						animateObj[slider.animProp] = value;
						if (type == 'slide') {
							el.animate(animateObj, duration, slider.settings.easing, function () {
								updateAfterSlideTransition();
							});
						} else if (type == 'reset') {
							el.css(slider.animProp, value);
						} else if (type == 'ticker') {
							el.animate(animateObj, speed, 'linear', function () {
								setPositionProperty(params['resetValue'], 'reset', 0);
								// run the recursive loop after animation
								tickerLoop();
							});
						}
					}
			};

			/**
	   * Populates the pager with proper amount of pages
	   */
			var populatePager = function populatePager() {
				var pagerHtml = '';
				var pagerQty = getPagerQty();
				// loop through each pager item
				for (var i = 0; i < pagerQty; i++) {
					var linkContent = '';
					// if a buildPager function is supplied, use it to get pager link value, else use index + 1
					if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager)) {
						linkContent = slider.settings.buildPager(i);
						slider.pagerEl.addClass('bx-custom-pager');
					} else {
						linkContent = i + 1;
						slider.pagerEl.addClass('bx-default-pager');
					}
					// var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
					// add the markup to the string
					pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
				}
				// populate the pager element with pager links
				slider.pagerEl.html(pagerHtml);
			};

			/**
	   * Appends the pager to the controls element
	   */
			var appendPager = function appendPager() {
				if (!slider.settings.pagerCustom) {
					// create the pager DOM element
					slider.pagerEl = $('<div class="bx-pager" />');
					// if a pager selector was supplied, populate it with the pager
					if (slider.settings.pagerSelector) {
						$(slider.settings.pagerSelector).html(slider.pagerEl);
						// if no pager selector was supplied, add it after the wrapper
					} else {
							slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
						}
					// populate the pager
					populatePager();
				} else {
					slider.pagerEl = $(slider.settings.pagerCustom);
				}
				// assign the pager click binding
				slider.pagerEl.on('click', 'a', clickPagerBind);
			};

			/**
	   * Appends prev / next controls to the controls element
	   */
			var appendControls = function appendControls() {
				slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
				slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
				// bind click actions to the controls
				slider.controls.next.bind('click', clickNextBind);
				slider.controls.prev.bind('click', clickPrevBind);
				// if nextSlector was supplied, populate it
				if (slider.settings.nextSelector) {
					$(slider.settings.nextSelector).append(slider.controls.next);
				}
				// if prevSlector was supplied, populate it
				if (slider.settings.prevSelector) {
					$(slider.settings.prevSelector).append(slider.controls.prev);
				}
				// if no custom selectors were supplied
				if (!slider.settings.nextSelector && !slider.settings.prevSelector) {
					// add the controls to the DOM
					slider.controls.directionEl = $('<div class="bx-controls-direction" />');
					// add the control elements to the directionEl
					slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
					// slider.viewport.append(slider.controls.directionEl);
					slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
				}
			};

			/**
	   * Appends start / stop auto controls to the controls element
	   */
			var appendControlsAuto = function appendControlsAuto() {
				slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
				slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
				// add the controls to the DOM
				slider.controls.autoEl = $('<div class="bx-controls-auto" />');
				// bind click actions to the controls
				slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
				slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
				// if autoControlsCombine, insert only the "start" control
				if (slider.settings.autoControlsCombine) {
					slider.controls.autoEl.append(slider.controls.start);
					// if autoControlsCombine is false, insert both controls
				} else {
						slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
					}
				// if auto controls selector was supplied, populate it with the controls
				if (slider.settings.autoControlsSelector) {
					$(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
					// if auto controls selector was not supplied, add it after the wrapper
				} else {
						slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
					}
				// update the auto controls
				updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
			};

			/**
	   * Appends image captions to the DOM
	   */
			var appendCaptions = function appendCaptions() {
				// cycle through each child
				slider.children.each(function (index) {
					// get the image title attribute
					var title = $(this).find('img:first').attr('title');
					// append the caption
					if (title != undefined && ('' + title).length) {
						$(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
					}
				});
			};

			/**
	   * Click next binding
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var clickNextBind = function clickNextBind(e) {
				// if auto show is running, stop it
				if (slider.settings.auto) el.stopAuto();
				el.goToNextSlide();
				e.preventDefault();
			};

			/**
	   * Click prev binding
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var clickPrevBind = function clickPrevBind(e) {
				// if auto show is running, stop it
				if (slider.settings.auto) el.stopAuto();
				el.goToPrevSlide();
				e.preventDefault();
			};

			/**
	   * Click start binding
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var clickStartBind = function clickStartBind(e) {
				el.startAuto();
				e.preventDefault();
			};

			/**
	   * Click stop binding
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var clickStopBind = function clickStopBind(e) {
				el.stopAuto();
				e.preventDefault();
			};

			/**
	   * Click pager binding
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var clickPagerBind = function clickPagerBind(e) {
				// if auto show is running, stop it
				if (slider.settings.auto) el.stopAuto();
				var pagerLink = $(e.currentTarget);
				if (pagerLink.attr('data-slide-index') !== undefined) {
					var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
					// if clicked pager link is not active, continue with the goToSlide call
					if (pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
					e.preventDefault();
				}
			};

			/**
	   * Updates the pager links with an active class
	   *
	   * @param slideIndex (int)
	   *  - index of slide to make active
	   */
			var updatePagerActive = function updatePagerActive(slideIndex) {
				// if "short" pager type
				var len = slider.children.length; // nb of children
				if (slider.settings.pagerType == 'short') {
					if (slider.settings.maxSlides > 1) {
						len = Math.ceil(slider.children.length / slider.settings.maxSlides);
					}
					slider.pagerEl.html(slideIndex + 1 + slider.settings.pagerShortSeparator + len);
					return;
				}
				// remove all pager active classes
				slider.pagerEl.find('a').removeClass('active');
				// apply the active class for all pagers
				slider.pagerEl.each(function (i, el) {
					$(el).find('a').eq(slideIndex).addClass('active');
				});
			};

			/**
	   * Performs needed actions after a slide transition
	   */
			var updateAfterSlideTransition = function updateAfterSlideTransition() {
				// if infinte loop is true
				if (slider.settings.infiniteLoop) {
					var position = '';
					// first slide
					if (slider.active.index == 0) {
						// set the new position
						position = slider.children.eq(0).position();
						// carousel, last slide
					} else if (slider.active.index == getPagerQty() - 1 && slider.carousel) {
							position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
							// last slide
						} else if (slider.active.index == slider.children.length - 1) {
								position = slider.children.eq(slider.children.length - 1).position();
							}
					if (position) {
						if (slider.settings.mode == 'horizontal') {
							setPositionProperty(-position.left, 'reset', 0);
						} else if (slider.settings.mode == 'vertical') {
							setPositionProperty(-position.top, 'reset', 0);
						}
					}
				}
				// declare that the transition is complete
				slider.working = false;
				// onSlideAfter callback
				slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
			};

			/**
	   * Updates the auto controls state (either active, or combined switch)
	   *
	   * @param state (string) "start", "stop"
	   *  - the new state of the auto show
	   */
			var updateAutoControls = function updateAutoControls(state) {
				// if autoControlsCombine is true, replace the current control with the new state
				if (slider.settings.autoControlsCombine) {
					slider.controls.autoEl.html(slider.controls[state]);
					// if autoControlsCombine is false, apply the "active" class to the appropriate control
				} else {
						slider.controls.autoEl.find('a').removeClass('active');
						slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
					}
			};

			/**
	   * Updates the direction controls (checks if either should be hidden)
	   */
			var updateDirectionControls = function updateDirectionControls() {
				if (getPagerQty() == 1) {
					slider.controls.prev.addClass('disabled');
					slider.controls.next.addClass('disabled');
				} else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {
					// if first slide
					if (slider.active.index == 0) {
						slider.controls.prev.addClass('disabled');
						slider.controls.next.removeClass('disabled');
						// if last slide
					} else if (slider.active.index == getPagerQty() - 1) {
							slider.controls.next.addClass('disabled');
							slider.controls.prev.removeClass('disabled');
							// if any slide in the middle
						} else {
								slider.controls.prev.removeClass('disabled');
								slider.controls.next.removeClass('disabled');
							}
				}
			};

			/**
	   * Initialzes the auto process
	   */
			var initAuto = function initAuto() {
				// if autoDelay was supplied, launch the auto show using a setTimeout() call
				if (slider.settings.autoDelay > 0) {
					var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
					// if autoDelay was not supplied, start the auto show normally
				} else {
						el.startAuto();
					}
				// if autoHover is requested
				if (slider.settings.autoHover) {
					// on el hover
					el.hover(function () {
						// if the auto show is currently playing (has an active interval)
						if (slider.interval) {
							// stop the auto show and pass true agument which will prevent control update
							el.stopAuto(true);
							// create a new autoPaused value which will be used by the relative "mouseout" event
							slider.autoPaused = true;
						}
					}, function () {
						// if the autoPaused value was created be the prior "mouseover" event
						if (slider.autoPaused) {
							// start the auto show and pass true agument which will prevent control update
							el.startAuto(true);
							// reset the autoPaused value
							slider.autoPaused = null;
						}
					});
				}
			};

			/**
	   * Initialzes the ticker process
	   */
			var initTicker = function initTicker() {
				var startPosition = 0;
				// if autoDirection is "next", append a clone of the entire slider
				if (slider.settings.autoDirection == 'next') {
					el.append(slider.children.clone().addClass('bx-clone'));
					// if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
				} else {
						el.prepend(slider.children.clone().addClass('bx-clone'));
						var position = slider.children.first().position();
						startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
					}
				setPositionProperty(startPosition, 'reset', 0);
				// do not allow controls in ticker mode
				slider.settings.pager = false;
				slider.settings.controls = false;
				slider.settings.autoControls = false;
				// if autoHover is requested
				if (slider.settings.tickerHover && !slider.usingCSS) {
					// on el hover
					slider.viewport.hover(function () {
						el.stop();
					}, function () {
						// calculate the total width of children (used to calculate the speed ratio)
						var totalDimens = 0;
						slider.children.each(function (index) {
							totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
						});
						// calculate the speed ratio (used to determine the new speed to finish the paused animation)
						var ratio = slider.settings.speed / totalDimens;
						// determine which property to use
						var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
						// calculate the new speed
						var newSpeed = ratio * (totalDimens - Math.abs(parseInt(el.css(property))));
						tickerLoop(newSpeed);
					});
				}
				// start the ticker loop
				tickerLoop();
			};

			/**
	   * Runs a continuous loop, news ticker-style
	   */
			var tickerLoop = function tickerLoop(resumeSpeed) {
				speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
				var position = { left: 0, top: 0 };
				var reset = { left: 0, top: 0 };
				// if "next" animate left position to last child, then reset left to 0
				if (slider.settings.autoDirection == 'next') {
					position = el.find('.bx-clone').first().position();
					// if "prev" animate left position to 0, then reset left to first non-clone child
				} else {
						reset = slider.children.first().position();
					}
				var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
				var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
				var params = { resetValue: resetValue };
				setPositionProperty(animateProperty, 'ticker', speed, params);
			};

			/**
	   * Initializes touch events
	   */
			var initTouch = function initTouch() {
				// initialize object to contain all touch values
				slider.touch = {
					start: { x: 0, y: 0 },
					end: { x: 0, y: 0 }
				};
				slider.viewport.bind('touchstart', onTouchStart);
			};

			/**
	   * Event handler for "touchstart"
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var onTouchStart = function onTouchStart(e) {
				if (slider.working) {
					e.preventDefault();
				} else {
					// record the original position when touch starts
					slider.touch.originalPos = el.position();
					var orig = e.originalEvent;
					// record the starting touch x, y coordinates
					slider.touch.start.x = orig.changedTouches[0].pageX;
					slider.touch.start.y = orig.changedTouches[0].pageY;
					// bind a "touchmove" event to the viewport
					slider.viewport.bind('touchmove', onTouchMove);
					// bind a "touchend" event to the viewport
					slider.viewport.bind('touchend', onTouchEnd);
				}
			};

			/**
	   * Event handler for "touchmove"
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var onTouchMove = function onTouchMove(e) {
				var orig = e.originalEvent;
				// if scrolling on y axis, do not prevent default
				var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
				var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
				// x axis swipe
				if (xMovement * 3 > yMovement && slider.settings.preventDefaultSwipeX) {
					e.preventDefault();
					// y axis swipe
				} else if (yMovement * 3 > xMovement && slider.settings.preventDefaultSwipeY) {
						e.preventDefault();
					}
				if (slider.settings.mode != 'fade' && slider.settings.oneToOneTouch) {
					var value = 0;
					// if horizontal, drag along x axis
					if (slider.settings.mode == 'horizontal') {
						var change = orig.changedTouches[0].pageX - slider.touch.start.x;
						value = slider.touch.originalPos.left + change;
						// if vertical, drag along y axis
					} else {
							var change = orig.changedTouches[0].pageY - slider.touch.start.y;
							value = slider.touch.originalPos.top + change;
						}
					setPositionProperty(value, 'reset', 0);
				}
			};

			/**
	   * Event handler for "touchend"
	   *
	   * @param e (event)
	   *  - DOM event object
	   */
			var onTouchEnd = function onTouchEnd(e) {
				slider.viewport.unbind('touchmove', onTouchMove);
				var orig = e.originalEvent;
				var value = 0;
				// record end x, y positions
				slider.touch.end.x = orig.changedTouches[0].pageX;
				slider.touch.end.y = orig.changedTouches[0].pageY;
				// if fade mode, check if absolute x distance clears the threshold
				if (slider.settings.mode == 'fade') {
					var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
					if (distance >= slider.settings.swipeThreshold) {
						slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
						el.stopAuto();
					}
					// not fade mode
				} else {
						var distance = 0;
						// calculate distance and el's animate property
						if (slider.settings.mode == 'horizontal') {
							distance = slider.touch.end.x - slider.touch.start.x;
							value = slider.touch.originalPos.left;
						} else {
							distance = slider.touch.end.y - slider.touch.start.y;
							value = slider.touch.originalPos.top;
						}
						// if not infinite loop and first / last slide, do not attempt a slide transition
						if (!slider.settings.infiniteLoop && (slider.active.index == 0 && distance > 0 || slider.active.last && distance < 0)) {
							setPositionProperty(value, 'reset', 200);
						} else {
							// check if distance clears threshold
							if (Math.abs(distance) >= slider.settings.swipeThreshold) {
								distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
								el.stopAuto();
							} else {
								// el.animate(property, 200);
								setPositionProperty(value, 'reset', 200);
							}
						}
					}
				slider.viewport.unbind('touchend', onTouchEnd);
			};

			/**
	   * Window resize event callback
	   */
			var resizeWindow = function resizeWindow(e) {
				// don't do anything if slider isn't initialized.
				if (!slider.initialized) return;
				// get the new window dimens (again, thank you IE)
				var windowWidthNew = $(window).width();
				var windowHeightNew = $(window).height();
				// make sure that it is a true window resize
				// *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
				// are resized. Can you just die already?*
				if (windowWidth != windowWidthNew || windowHeight != windowHeightNew) {
					// set the new window dimens
					windowWidth = windowWidthNew;
					windowHeight = windowHeightNew;
					// update all dynamic elements
					el.redrawSlider();
					// Call user resize handler
					slider.settings.onSliderResize.call(el, slider.active.index);
				}
			};

			/**
	   * ===================================================================================
	   * = PUBLIC FUNCTIONS
	   * ===================================================================================
	   */

			/**
	   * Performs slide transition to the specified slide
	   *
	   * @param slideIndex (int)
	   *  - the destination slide's index (zero-based)
	   *
	   * @param direction (string)
	   *  - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
	   */
			el.goToSlide = function (slideIndex, direction) {
				// if plugin is currently in motion, ignore request
				if (slider.working || slider.active.index == slideIndex) return;
				// declare that plugin is in motion
				slider.working = true;
				// store the old index
				slider.oldIndex = slider.active.index;
				// if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
				if (slideIndex < 0) {
					slider.active.index = getPagerQty() - 1;
					// if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
				} else if (slideIndex >= getPagerQty()) {
						slider.active.index = 0;
						// set active index to requested slide
					} else {
							slider.active.index = slideIndex;
						}
				// onSlideBefore, onSlideNext, onSlidePrev callbacks
				slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
				if (direction == 'next') {
					slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
				} else if (direction == 'prev') {
					slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
				}
				// check if last slide
				slider.active.last = slider.active.index >= getPagerQty() - 1;
				// update the pager with active class
				if (slider.settings.pager) updatePagerActive(slider.active.index);
				// // check for direction control update
				if (slider.settings.controls) updateDirectionControls();
				// if slider is set to mode: "fade"
				if (slider.settings.mode == 'fade') {
					// if adaptiveHeight is true and next height is different from current height, animate to the new height
					if (slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()) {
						slider.viewport.animate({ height: getViewportHeight() }, slider.settings.adaptiveHeightSpeed);
					}
					// fade out the visible child and reset its z-index value
					slider.children.filter(':visible').fadeOut(slider.settings.speed).css({ zIndex: 0 });
					// fade in the newly requested slide
					slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function () {
						$(this).css('zIndex', slider.settings.slideZIndex);
						updateAfterSlideTransition();
					});
					// slider mode is not "fade"
				} else {
						// if adaptiveHeight is true and next height is different from current height, animate to the new height
						if (slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()) {
							slider.viewport.animate({ height: getViewportHeight() }, slider.settings.adaptiveHeightSpeed);
						}
						var moveBy = 0;
						var position = { left: 0, top: 0 };
						// if carousel and not infinite loop
						if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {
							if (slider.settings.mode == 'horizontal') {
								// get the last child position
								var lastChild = slider.children.eq(slider.children.length - 1);
								position = lastChild.position();
								// calculate the position of the last slide
								moveBy = slider.viewport.width() - lastChild.outerWidth();
							} else {
								// get last showing index position
								var lastShowingIndex = slider.children.length - slider.settings.minSlides;
								position = slider.children.eq(lastShowingIndex).position();
							}
							// horizontal carousel, going previous while on first slide (infiniteLoop mode)
						} else if (slider.carousel && slider.active.last && direction == 'prev') {
								// get the last child position
								var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : (getPagerQty() - 1) * getMoveBy() - (slider.children.length - slider.settings.maxSlides);
								var lastChild = el.children('.bx-clone').eq(eq);
								position = lastChild.position();
								// if infinite loop and "Next" is clicked on the last slide
							} else if (direction == 'next' && slider.active.index == 0) {
									// get the last clone position
									position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
									slider.active.last = false;
									// normal non-zero requests
								} else if (slideIndex >= 0) {
										var requestEl = slideIndex * getMoveBy();
										position = slider.children.eq(requestEl).position();
									}

						/* If the position doesn't exist
	      * (e.g. if you destroy the slider on a next click),
	      * it doesn't throw an error.
	      */
						if ("undefined" !== typeof position) {
							var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
							// plugin values to be animated
							setPositionProperty(value, 'slide', slider.settings.speed);
						}
					}
			};

			/**
	   * Transitions to the next slide in the show
	   */
			el.goToNextSlide = function () {
				// if infiniteLoop is false and last page is showing, disregard call
				if (!slider.settings.infiniteLoop && slider.active.last) return;
				var pagerIndex = parseInt(slider.active.index) + 1;
				el.goToSlide(pagerIndex, 'next');
			};

			/**
	   * Transitions to the prev slide in the show
	   */
			el.goToPrevSlide = function () {
				// if infiniteLoop is false and last page is showing, disregard call
				if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
				var pagerIndex = parseInt(slider.active.index) - 1;
				el.goToSlide(pagerIndex, 'prev');
			};

			/**
	   * Starts the auto show
	   *
	   * @param preventControlUpdate (boolean)
	   *  - if true, auto controls state will not be updated
	   */
			el.startAuto = function (preventControlUpdate) {
				// if an interval already exists, disregard call
				if (slider.interval) return;
				// create an interval
				slider.interval = setInterval(function () {
					slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
				}, slider.settings.pause);
				// if auto controls are displayed and preventControlUpdate is not true
				if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
			};

			/**
	   * Stops the auto show
	   *
	   * @param preventControlUpdate (boolean)
	   *  - if true, auto controls state will not be updated
	   */
			el.stopAuto = function (preventControlUpdate) {
				// if no interval exists, disregard call
				if (!slider.interval) return;
				// clear the interval
				clearInterval(slider.interval);
				slider.interval = null;
				// if auto controls are displayed and preventControlUpdate is not true
				if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
			};

			/**
	   * Returns current slide index (zero-based)
	   */
			el.getCurrentSlide = function () {
				return slider.active.index;
			};

			/**
	   * Returns current slide element
	   */
			el.getCurrentSlideElement = function () {
				return slider.children.eq(slider.active.index);
			};

			/**
	   * Returns number of slides in show
	   */
			el.getSlideCount = function () {
				return slider.children.length;
			};

			/**
	   * Update all dynamic slider elements
	   */
			el.redrawSlider = function () {
				// resize all children in ratio to new screen size
				slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
				// adjust the height
				slider.viewport.css('height', getViewportHeight());
				// update the slide position
				if (!slider.settings.ticker) setSlidePosition();
				// if active.last was true before the screen resize, we want
				// to keep it last no matter what screen size we end on
				if (slider.active.last) slider.active.index = getPagerQty() - 1;
				// if the active index (page) no longer exists due to the resize, simply set the index as last
				if (slider.active.index >= getPagerQty()) slider.active.last = true;
				// if a pager is being displayed and a custom pager is not being used, update it
				if (slider.settings.pager && !slider.settings.pagerCustom) {
					populatePager();
					updatePagerActive(slider.active.index);
				}
			};

			/**
	   * Destroy the current instance of the slider (revert everything back to original state)
	   */
			el.destroySlider = function () {
				// don't do anything if slider has already been destroyed
				if (!slider.initialized) return;
				slider.initialized = false;
				$('.bx-clone', this).remove();
				slider.children.each(function () {
					$(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
				});
				$(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
				$(this).unwrap().unwrap();
				if (slider.controls.el) slider.controls.el.remove();
				if (slider.controls.next) slider.controls.next.remove();
				if (slider.controls.prev) slider.controls.prev.remove();
				if (slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
				$('.bx-caption', this).remove();
				if (slider.controls.autoEl) slider.controls.autoEl.remove();
				clearInterval(slider.interval);
				if (slider.settings.responsive) $(window).unbind('resize', resizeWindow);
			};

			/**
	   * Reload the slider (revert all DOM changes, and re-initialize)
	   */
			el.reloadSlider = function (settings) {
				if (settings != undefined) options = settings;
				el.destroySlider();
				init();
			};

			init();

			// returns the current jQuery object
			return this;
		};
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 205:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	(function ($) {
	    $.cart = function (element, options) {
	        var cart = this;
	        var $cart_btn = $(element);

	        cart.settings = {};

	        // Merge options with defaults
	        cart.settings = $.extend({
	            buyButtonSelector: '.js-product__buy-button',
	            buyBundleButtonSelector: '.js-bundle__buy-button',
	            cartHighlightClass: 'cart-button--highlighted',
	            productFormSelector: '.product__form',
	            quantitySelector: '.cart-button__quantity',
	            sumSelector: '.cart-button__sum'
	        }, options);

	        // Init the cart plugin
	        var init = function init() {
	            cart.quantityContainer = $(cart.settings.quantitySelector);
	            cart.sumContainer = $(cart.settings.sumSelector);
	            cart.messageContainer = $(cart.settings.messageBoxSelector);
	            if ($cart_btn.length === 1) {
	                setupBuyButtons();
	            }
	        };

	        // Get data for ajax submission
	        var getProductData = function getProductData(productId, caller) {
	            // If quickbuy, we need to compose product data
	            var productData = '';
	            var productForm = $(cart.settings.productFormSelector);

	            if (productForm.length === 1 && productForm.children('input[name="id"]').val() === productId) {
	                // We are on the product page
	                productData = productForm.serialize();
	            } else if (productForm.hasClass('bundle__form')) {
	                // we're on a bundle form, may contain multiple products with attributes
	                productData = $(caller).serialize();
	            } else {
	                // we're on a "quick buy" page, like a category or the frontpage
	                productData = getProductQuickbuyData(productId);
	            }

	            return productData;
	        };

	        // Update the shopping cart
	        var update = function update(newQuantity, newSum) {
	            if (newQuantity !== getQuantity()) {
	                highlightCart();
	            }
	            cart.setQuantity(newQuantity);
	            cart.setSum(newSum);
	        };

	        var setupBuyButtons = function setupBuyButtons() {
	            // Buy button event
	            var buyButtons = $(cart.settings.buyButtonSelector);
	            var buyBundleButtons = $(cart.settings.buyBundleButtonSelector);

	            buyButtons.off('click').click(function (event) {
	                event.preventDefault();
	                var form = $(this).closest('form')[0];
	                var productId = $(this).attr('data-product-id');
	                $.post('/handlevogn/leggtil/ajax', getProductData(productId, form), function (data) {
	                    update(data.contents.length, data.total_pricified.total);
	                    if (data.msg !== '' && data.msg !== undefined) {
	                        $.growl({ message: data.msg, type: 'warning' });
	                    } else {
	                        if (window.FEATURES.get('modal_cart')) {
	                            window.CART_INIT_DATA = data;
	                            window.showCart();
	                        } else {
	                            $.growl({ message: $(event.target).data('success-msg'), template_selector: '#cart-notify' });
	                        }
	                    }
	                }, 'json');
	            });

	            buyBundleButtons.off('click').click(function (event) {
	                event.preventDefault();
	                var form = $(this).closest('form')[0];
	                var formData = $(form).serialize();
	                $.post('/handlevogn/addBundle', formData, function (data) {
	                    console.log(data);
	                    update(data.items, data.total);
	                    if (data.msg !== '') {
	                        $.growl({ message: data.msg, type: 'warning' });
	                    } else {
	                        if (window.FEATURES.get('modal_cart')) {
	                            window.CART_INIT_DATA = data;
	                            window.showCart();
	                        } else {
	                            $.growl({ message: $(event.target).data('success-msg'), template_selector: '#cart-notify' });
	                        }
	                    }
	                }, 'json');
	            });
	        };

	        // Get quickbuy data for ajax submission
	        var getProductQuickbuyData = function getProductQuickbuyData(productId) {
	            return 'id=' + productId + '&path=' + encodeURIComponent(window.location.pathname.split('?')[0]) + // return path, in case of errors
	            '&' + encodeURI("attributt[][0]") + '=' + '&antall=1' + '&ekstra_tekst=' + '&ekstra_velg=0';
	        };

	        // Set cart quantity
	        cart.setQuantity = function (quantity) {
	            if (parseInt(quantity, 10) > 99) {
	                cart.quantityContainer.html('<i class="icon-larger-than"></i>99');
	            } else {
	                cart.quantityContainer.text(quantity);
	            }

	            if (quantity > 0) {
	                $cart_btn.removeClass('cart-button--empty');
	            } else {
	                $cart_btn.addClass('cart-button--empty');
	            }
	        };

	        // Find quantity
	        var getQuantity = function getQuantity() {
	            var quantity = cart.quantityContainer.html().replace('<i class="icon-larger-than"></i>', ''); // Strip > if number is ">99"
	            return parseInt(quantity, 10);
	        };

	        // Set cart sum
	        cart.setSum = function (sum) {
	            cart.sumContainer.html(sum);
	        };

	        // Highlight the cart
	        var highlightCart = function highlightCart() {
	            $cart_btn.addClass(cart.settings.cartHighlightClass);
	            setTimeout(function () {
	                $cart_btn.removeClass(cart.settings.cartHighlightClass);
	            }, 200);
	        };

	        init();
	    };

	    $.fn.cart = function (options) {
	        return this.each(function () {
	            if (undefined === $(this).data('cart')) {
	                var plugin = new $.cart(this, options);
	                $(this).data('cart', plugin);
	            }
	        });
	    };
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 206:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {"use strict";

	/*!
	 * fancyBox - jQuery Plugin
	 * version: 2.1.5 (Fri, 14 Jun 2013)
	 * @requires jQuery v1.6 or later
	 *
	 * Examples at http://fancyapps.com/fancybox/
	 * License: www.fancyapps.com/fancybox/#license
	 *
	 * Copyright 2012 Janis Skarnelis - janis@fancyapps.com
	 *
	 */

	(function (window, document, $, undefined) {
		"use strict";

		var H = $("html"),
		    W = $(window),
		    D = $(document),
		    F = $.fancybox = function () {
			F.open.apply(this, arguments);
		},
		    IE = navigator.userAgent.match(/msie/i),
		    didUpdate = null,
		    isTouch = document.createTouch !== undefined,
		    isQuery = function isQuery(obj) {
			return obj && obj.hasOwnProperty && obj instanceof $;
		},
		    isString = function isString(str) {
			return str && $.type(str) === "string";
		},
		    isPercentage = function isPercentage(str) {
			return isString(str) && str.indexOf('%') > 0;
		},
		    isScrollable = function isScrollable(el) {
			return el && !(el.style.overflow && el.style.overflow === 'hidden') && (el.clientWidth && el.scrollWidth > el.clientWidth || el.clientHeight && el.scrollHeight > el.clientHeight);
		},
		    getScalar = function getScalar(orig, dim) {
			var value = parseInt(orig, 10) || 0;

			if (dim && isPercentage(orig)) {
				value = F.getViewport()[dim] / 100 * value;
			}

			return Math.ceil(value);
		},
		    getValue = function getValue(value, dim) {
			return getScalar(value, dim) + 'px';
		};

		$.extend(F, {
			// The current version of fancyBox
			version: '2.1.5',

			defaults: {
				padding: 15,
				margin: 20,

				width: 800,
				height: 600,
				minWidth: 100,
				minHeight: 100,
				maxWidth: 9999,
				maxHeight: 9999,
				pixelRatio: 1, // Set to 2 for retina display support

				autoSize: true,
				autoHeight: false,
				autoWidth: false,

				autoResize: true,
				autoCenter: !isTouch,
				fitToView: true,
				aspectRatio: false,
				topRatio: 0.5,
				leftRatio: 0.5,

				scrolling: 'auto', // 'auto', 'yes' or 'no'
				wrapCSS: '',

				arrows: true,
				closeBtn: true,
				closeClick: false,
				nextClick: false,
				mouseWheel: true,
				autoPlay: false,
				playSpeed: 3000,
				preload: 3,
				modal: false,
				loop: true,

				ajax: {
					dataType: 'html',
					headers: { 'X-fancyBox': true }
				},
				iframe: {
					scrolling: 'auto',
					preload: true
				},
				swf: {
					wmode: 'transparent',
					allowfullscreen: 'true',
					allowscriptaccess: 'always'
				},

				keys: {
					next: {
						13: 'left', // enter
						34: 'up', // page down
						39: 'left', // right arrow
						40: 'up' // down arrow
					},
					prev: {
						8: 'right', // backspace
						33: 'down', // page up
						37: 'right', // left arrow
						38: 'down' // up arrow
					},
					close: [27], // escape key
					play: [32], // space - start/stop slideshow
					toggle: [70] // letter "f" - toggle fullscreen
				},

				direction: {
					next: 'left',
					prev: 'right'
				},

				scrollOutside: true,

				// Override some properties
				index: 0,
				type: null,
				href: null,
				content: null,
				title: null,

				// HTML templates
				tpl: {
					wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
					image: '<img class="fancybox-image" src="{href}" alt="" />',
					iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
					error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
					closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
					next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
					prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
				},

				// Properties for each animation type
				// Opening fancyBox
				openEffect: 'fade', // 'elastic', 'fade' or 'none'
				openSpeed: 250,
				openEasing: 'swing',
				openOpacity: true,
				openMethod: 'zoomIn',

				// Closing fancyBox
				closeEffect: 'fade', // 'elastic', 'fade' or 'none'
				closeSpeed: 250,
				closeEasing: 'swing',
				closeOpacity: true,
				closeMethod: 'zoomOut',

				// Changing next gallery item
				nextEffect: 'elastic', // 'elastic', 'fade' or 'none'
				nextSpeed: 250,
				nextEasing: 'swing',
				nextMethod: 'changeIn',

				// Changing previous gallery item
				prevEffect: 'elastic', // 'elastic', 'fade' or 'none'
				prevSpeed: 250,
				prevEasing: 'swing',
				prevMethod: 'changeOut',

				// Enable default helpers
				helpers: {
					overlay: true,
					title: true
				},

				// Callbacks
				onCancel: $.noop, // If canceling
				beforeLoad: $.noop, // Before loading
				afterLoad: $.noop, // After loading
				beforeShow: $.noop, // Before changing in current item
				afterShow: $.noop, // After opening
				beforeChange: $.noop, // Before changing gallery item
				beforeClose: $.noop, // Before closing
				afterClose: $.noop // After closing
			},

			//Current state
			group: {}, // Selected group
			opts: {}, // Group options
			previous: null, // Previous element
			coming: null, // Element being loaded
			current: null, // Currently loaded element
			isActive: false, // Is activated
			isOpen: false, // Is currently open
			isOpened: false, // Have been fully opened at least once

			wrap: null,
			skin: null,
			outer: null,
			inner: null,

			player: {
				timer: null,
				isActive: false
			},

			// Loaders
			ajaxLoad: null,
			imgPreload: null,

			// Some collections
			transitions: {},
			helpers: {},

			/*
	   *	Static methods
	   */

			open: function open(group, opts) {
				if (!group) {
					return;
				}

				if (!$.isPlainObject(opts)) {
					opts = {};
				}

				// Close if already active
				if (false === F.close(true)) {
					return;
				}

				// Normalize group
				if (!$.isArray(group)) {
					group = isQuery(group) ? $(group).get() : [group];
				}

				// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
				$.each(group, function (i, element) {
					var obj = {},
					    href,
					    title,
					    content,
					    type,
					    rez,
					    hrefParts,
					    selector;

					if ($.type(element) === "object") {
						// Check if is DOM element
						if (element.nodeType) {
							element = $(element);
						}

						if (isQuery(element)) {
							obj = {
								href: element.data('fancybox-href') || element.attr('href'),
								title: element.data('fancybox-title') || element.attr('title'),
								isDom: true,
								element: element
							};

							if ($.metadata) {
								$.extend(true, obj, element.metadata());
							}
						} else {
							obj = element;
						}
					}

					href = opts.href || obj.href || (isString(element) ? element : null);
					title = opts.title !== undefined ? opts.title : obj.title || '';

					content = opts.content || obj.content;
					type = content ? 'html' : opts.type || obj.type;

					if (!type && obj.isDom) {
						type = element.data('fancybox-type');

						if (!type) {
							rez = element.prop('class').match(/fancybox\.(\w+)/);
							type = rez ? rez[1] : null;
						}
					}

					if (isString(href)) {
						// Try to guess the content type
						if (!type) {
							if (F.isImage(href)) {
								type = 'image';
							} else if (F.isSWF(href)) {
								type = 'swf';
							} else if (href.charAt(0) === '#') {
								type = 'inline';
							} else if (isString(element)) {
								type = 'html';
								content = element;
							}
						}

						// Split url into two pieces with source url and content selector, e.g,
						// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
						if (type === 'ajax') {
							hrefParts = href.split(/\s+/, 2);
							href = hrefParts.shift();
							selector = hrefParts.shift();
						}
					}

					if (!content) {
						if (type === 'inline') {
							if (href) {
								content = $(isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href); //strip for ie7
							} else if (obj.isDom) {
									content = element;
								}
						} else if (type === 'html') {
							content = href;
						} else if (!type && !href && obj.isDom) {
							type = 'inline';
							content = element;
						}
					}

					$.extend(obj, {
						href: href,
						type: type,
						content: content,
						title: title,
						selector: selector
					});

					group[i] = obj;
				});

				// Extend the defaults
				F.opts = $.extend(true, {}, F.defaults, opts);

				// All options are merged recursive except keys
				if (opts.keys !== undefined) {
					F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
				}

				F.group = group;

				return F._start(F.opts.index);
			},

			// Cancel image loading or abort ajax request
			cancel: function cancel() {
				var coming = F.coming;

				if (!coming || false === F.trigger('onCancel')) {
					return;
				}

				F.hideLoading();

				if (F.ajaxLoad) {
					F.ajaxLoad.abort();
				}

				F.ajaxLoad = null;

				if (F.imgPreload) {
					F.imgPreload.onload = F.imgPreload.onerror = null;
				}

				if (coming.wrap) {
					coming.wrap.stop(true, true).trigger('onReset').remove();
				}

				F.coming = null;

				// If the first item has been canceled, then clear everything
				if (!F.current) {
					F._afterZoomOut(coming);
				}
			},

			// Start closing animation if is open; remove immediately if opening/closing
			close: function close(event) {
				F.cancel();

				if (false === F.trigger('beforeClose')) {
					return;
				}

				F.unbindEvents();

				if (!F.isActive) {
					return;
				}

				if (!F.isOpen || event === true) {
					$('.fancybox-wrap').stop(true).trigger('onReset').remove();

					F._afterZoomOut();
				} else {
					F.isOpen = F.isOpened = false;
					F.isClosing = true;

					$('.fancybox-item, .fancybox-nav').remove();

					F.wrap.stop(true, true).removeClass('fancybox-opened');

					F.transitions[F.current.closeMethod]();
				}
			},

			// Manage slideshow:
			//   $.fancybox.play(); - toggle slideshow
			//   $.fancybox.play( true ); - start
			//   $.fancybox.play( false ); - stop
			play: function play(action) {
				var clear = function clear() {
					clearTimeout(F.player.timer);
				},
				    set = function set() {
					clear();

					if (F.current && F.player.isActive) {
						F.player.timer = setTimeout(F.next, F.current.playSpeed);
					}
				},
				    stop = function stop() {
					clear();

					D.unbind('.player');

					F.player.isActive = false;

					F.trigger('onPlayEnd');
				},
				    start = function start() {
					if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
						F.player.isActive = true;

						D.bind({
							'onCancel.player beforeClose.player': stop,
							'onUpdate.player': set,
							'beforeLoad.player': clear
						});

						set();

						F.trigger('onPlayStart');
					}
				};

				if (action === true || !F.player.isActive && action !== false) {
					start();
				} else {
					stop();
				}
			},

			// Navigate to next gallery item
			next: function next(direction) {
				var current = F.current;

				if (current) {
					if (!isString(direction)) {
						direction = current.direction.next;
					}

					F.jumpto(current.index + 1, direction, 'next');
				}
			},

			// Navigate to previous gallery item
			prev: function prev(direction) {
				var current = F.current;

				if (current) {
					if (!isString(direction)) {
						direction = current.direction.prev;
					}

					F.jumpto(current.index - 1, direction, 'prev');
				}
			},

			// Navigate to gallery item by index
			jumpto: function jumpto(index, direction, router) {
				var current = F.current;

				if (!current) {
					return;
				}

				index = getScalar(index);

				F.direction = direction || current.direction[index >= current.index ? 'next' : 'prev'];
				F.router = router || 'jumpto';

				if (current.loop) {
					if (index < 0) {
						index = current.group.length + index % current.group.length;
					}

					index = index % current.group.length;
				}

				if (current.group[index] !== undefined) {
					F.cancel();

					F._start(index);
				}
			},

			// Center inside viewport and toggle position type to fixed or absolute if needed
			reposition: function reposition(e, onlyAbsolute) {
				var current = F.current,
				    wrap = current ? current.wrap : null,
				    pos;

				if (wrap) {
					pos = F._getPosition(onlyAbsolute);

					if (e && e.type === 'scroll') {
						delete pos.position;

						wrap.stop(true, true).animate(pos, 200);
					} else {
						wrap.css(pos);

						current.pos = $.extend({}, current.dim, pos);
					}
				}
			},

			update: function update(e) {
				var type = e && e.type,
				    anyway = !type || type === 'orientationchange';

				if (anyway) {
					clearTimeout(didUpdate);

					didUpdate = null;
				}

				if (!F.isOpen || didUpdate) {
					return;
				}

				didUpdate = setTimeout(function () {
					var current = F.current;

					if (!current || F.isClosing) {
						return;
					}

					F.wrap.removeClass('fancybox-tmp');

					if (anyway || type === 'load' || type === 'resize' && current.autoResize) {
						F._setDimension();
					}

					if (!(type === 'scroll' && current.canShrink)) {
						F.reposition(e);
					}

					F.trigger('onUpdate');

					didUpdate = null;
				}, anyway && !isTouch ? 0 : 300);
			},

			// Shrink content to fit inside viewport or restore if resized
			toggle: function toggle(action) {
				if (F.isOpen) {
					F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;

					// Help browser to restore document dimensions
					if (isTouch) {
						F.wrap.removeAttr('style').addClass('fancybox-tmp');

						F.trigger('onUpdate');
					}

					F.update();
				}
			},

			hideLoading: function hideLoading() {
				D.unbind('.loading');

				$('#fancybox-loading').remove();
			},

			showLoading: function showLoading() {
				var el, viewport;

				F.hideLoading();

				el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');

				// If user will press the escape-button, the request will be canceled
				D.bind('keydown.loading', function (e) {
					if ((e.which || e.keyCode) === 27) {
						e.preventDefault();

						F.cancel();
					}
				});

				if (!F.defaults.fixed) {
					viewport = F.getViewport();

					el.css({
						position: 'absolute',
						top: viewport.h * 0.5 + viewport.y,
						left: viewport.w * 0.5 + viewport.x
					});
				}
			},

			getViewport: function getViewport() {
				var locked = F.current && F.current.locked || false,
				    rez = {
					x: W.scrollLeft(),
					y: W.scrollTop()
				};

				if (locked) {
					rez.w = locked[0].clientWidth;
					rez.h = locked[0].clientHeight;
				} else {
					// See http://bugs.jquery.com/ticket/6724
					rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
					rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
				}

				return rez;
			},

			// Unbind the keyboard / clicking actions
			unbindEvents: function unbindEvents() {
				if (F.wrap && isQuery(F.wrap)) {
					F.wrap.unbind('.fb');
				}

				D.unbind('.fb');
				W.unbind('.fb');
			},

			bindEvents: function bindEvents() {
				var current = F.current,
				    keys;

				if (!current) {
					return;
				}

				// Changing document height on iOS devices triggers a 'resize' event,
				// that can change document height... repeating infinitely
				W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);

				keys = current.keys;

				if (keys) {
					D.bind('keydown.fb', function (e) {
						var code = e.which || e.keyCode,
						    target = e.target || e.srcElement;

						// Skip esc key if loading, because showLoading will cancel preloading
						if (code === 27 && F.coming) {
							return false;
						}

						// Ignore key combinations and key events within form elements
						if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
							$.each(keys, function (i, val) {
								if (current.group.length > 1 && val[code] !== undefined) {
									F[i](val[code]);

									e.preventDefault();
									return false;
								}

								if ($.inArray(code, val) > -1) {
									F[i]();

									e.preventDefault();
									return false;
								}
							});
						}
					});
				}

				if ($.fn.mousewheel && current.mouseWheel) {
					F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
						var target = e.target || null,
						    parent = $(target),
						    canScroll = false;

						while (parent.length) {
							if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
								break;
							}

							canScroll = isScrollable(parent[0]);
							parent = $(parent).parent();
						}

						if (delta !== 0 && !canScroll) {
							if (F.group.length > 1 && !current.canShrink) {
								if (deltaY > 0 || deltaX > 0) {
									F.prev(deltaY > 0 ? 'down' : 'left');
								} else if (deltaY < 0 || deltaX < 0) {
									F.next(deltaY < 0 ? 'up' : 'right');
								}

								e.preventDefault();
							}
						}
					});
				}
			},

			trigger: function trigger(event, o) {
				var ret,
				    obj = o || F.coming || F.current;

				if (!obj) {
					return;
				}

				if ($.isFunction(obj[event])) {
					ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
				}

				if (ret === false) {
					return false;
				}

				if (obj.helpers) {
					$.each(obj.helpers, function (helper, opts) {
						if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
							F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
						}
					});
				}

				D.trigger(event);
			},

			isImage: function isImage(str) {
				return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
			},

			isSWF: function isSWF(str) {
				return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
			},

			_start: function _start(index) {
				var coming = {},
				    obj,
				    href,
				    type,
				    margin,
				    padding;

				index = getScalar(index);
				obj = F.group[index] || null;

				if (!obj) {
					return false;
				}

				coming = $.extend(true, {}, F.opts, obj);

				// Convert margin and padding properties to array - top, right, bottom, left
				margin = coming.margin;
				padding = coming.padding;

				if ($.type(margin) === 'number') {
					coming.margin = [margin, margin, margin, margin];
				}

				if ($.type(padding) === 'number') {
					coming.padding = [padding, padding, padding, padding];
				}

				// 'modal' propery is just a shortcut
				if (coming.modal) {
					$.extend(true, coming, {
						closeBtn: false,
						closeClick: false,
						nextClick: false,
						arrows: false,
						mouseWheel: false,
						keys: null,
						helpers: {
							overlay: {
								closeClick: false
							}
						}
					});
				}

				// 'autoSize' property is a shortcut, too
				if (coming.autoSize) {
					coming.autoWidth = coming.autoHeight = true;
				}

				if (coming.width === 'auto') {
					coming.autoWidth = true;
				}

				if (coming.height === 'auto') {
					coming.autoHeight = true;
				}

				/*
	    * Add reference to the group, so it`s possible to access from callbacks, example:
	    * afterLoad : function() {
	    *     this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
	    * }
	    */

				coming.group = F.group;
				coming.index = index;

				// Give a chance for callback or helpers to update coming item (type, title, etc)
				F.coming = coming;

				if (false === F.trigger('beforeLoad')) {
					F.coming = null;

					return;
				}

				type = coming.type;
				href = coming.href;

				if (!type) {
					F.coming = null;

					//If we can not determine content type then drop silently or display next/prev item if looping through gallery
					if (F.current && F.router && F.router !== 'jumpto') {
						F.current.index = index;

						return F[F.router](F.direction);
					}

					return false;
				}

				F.isActive = true;

				if (type === 'image' || type === 'swf') {
					coming.autoHeight = coming.autoWidth = false;
					coming.scrolling = 'visible';
				}

				if (type === 'image') {
					coming.aspectRatio = true;
				}

				if (type === 'iframe' && isTouch) {
					coming.scrolling = 'scroll';
				}

				// Build the neccessary markup
				coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo(coming.parent || 'body');

				$.extend(coming, {
					skin: $('.fancybox-skin', coming.wrap),
					outer: $('.fancybox-outer', coming.wrap),
					inner: $('.fancybox-inner', coming.wrap)
				});

				$.each(["Top", "Right", "Bottom", "Left"], function (i, v) {
					coming.skin.css('padding' + v, getValue(coming.padding[i]));
				});

				F.trigger('onReady');

				// Check before try to load; 'inline' and 'html' types need content, others - href
				if (type === 'inline' || type === 'html') {
					if (!coming.content || !coming.content.length) {
						return F._error('content');
					}
				} else if (!href) {
					return F._error('href');
				}

				if (type === 'image') {
					F._loadImage();
				} else if (type === 'ajax') {
					F._loadAjax();
				} else if (type === 'iframe') {
					F._loadIframe();
				} else {
					F._afterLoad();
				}
			},

			_error: function _error(type) {
				$.extend(F.coming, {
					type: 'html',
					autoWidth: true,
					autoHeight: true,
					minWidth: 0,
					minHeight: 0,
					scrolling: 'no',
					hasError: type,
					content: F.coming.tpl.error
				});

				F._afterLoad();
			},

			_loadImage: function _loadImage() {
				// Reset preload image so it is later possible to check "complete" property
				var img = F.imgPreload = new Image();

				img.onload = function () {
					this.onload = this.onerror = null;

					F.coming.width = this.width / F.opts.pixelRatio;
					F.coming.height = this.height / F.opts.pixelRatio;

					F._afterLoad();
				};

				img.onerror = function () {
					this.onload = this.onerror = null;

					F._error('image');
				};

				img.src = F.coming.href;

				if (img.complete !== true) {
					F.showLoading();
				}
			},

			_loadAjax: function _loadAjax() {
				var coming = F.coming;

				F.showLoading();

				F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
					url: coming.href,
					error: function error(jqXHR, textStatus) {
						if (F.coming && textStatus !== 'abort') {
							F._error('ajax', jqXHR);
						} else {
							F.hideLoading();
						}
					},
					success: function success(data, textStatus) {
						if (textStatus === 'success') {
							coming.content = data;

							F._afterLoad();
						}
					}
				}));
			},

			_loadIframe: function _loadIframe() {
				var coming = F.coming,
				    iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())).attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling).attr('src', coming.href);

				// This helps IE
				$(coming.wrap).bind('onReset', function () {
					try {
						$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
					} catch (e) {}
				});

				if (coming.iframe.preload) {
					F.showLoading();

					iframe.one('load', function () {
						$(this).data('ready', 1);

						// iOS will lose scrolling if we resize
						if (!isTouch) {
							$(this).bind('load.fb', F.update);
						}

						// Without this trick:
						//   - iframe won't scroll on iOS devices
						//   - IE7 sometimes displays empty iframe
						$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();

						F._afterLoad();
					});
				}

				coming.content = iframe.appendTo(coming.inner);

				if (!coming.iframe.preload) {
					F._afterLoad();
				}
			},

			_preloadImages: function _preloadImages() {
				var group = F.group,
				    current = F.current,
				    len = group.length,
				    cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
				    item,
				    i;

				for (i = 1; i <= cnt; i += 1) {
					item = group[(current.index + i) % len];

					if (item.type === 'image' && item.href) {
						new Image().src = item.href;
					}
				}
			},

			_afterLoad: function _afterLoad() {
				var coming = F.coming,
				    previous = F.current,
				    placeholder = 'fancybox-placeholder',
				    current,
				    content,
				    type,
				    scrolling,
				    href,
				    embed;

				F.hideLoading();

				if (!coming || F.isActive === false) {
					return;
				}

				if (false === F.trigger('afterLoad', coming, previous)) {
					coming.wrap.stop(true).trigger('onReset').remove();

					F.coming = null;

					return;
				}

				if (previous) {
					F.trigger('beforeChange', previous);

					previous.wrap.stop(true).removeClass('fancybox-opened').find('.fancybox-item, .fancybox-nav').remove();
				}

				F.unbindEvents();

				current = coming;
				content = coming.content;
				type = coming.type;
				scrolling = coming.scrolling;

				$.extend(F, {
					wrap: current.wrap,
					skin: current.skin,
					outer: current.outer,
					inner: current.inner,
					current: current,
					previous: previous
				});

				href = current.href;

				switch (type) {
					case 'inline':
					case 'ajax':
					case 'html':
						if (current.selector) {
							content = $('<div>').html(content).find(current.selector);
						} else if (isQuery(content)) {
							if (!content.data(placeholder)) {
								content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter(content).hide());
							}

							content = content.show().detach();

							current.wrap.bind('onReset', function () {
								if ($(this).find(content).length) {
									content.hide().replaceAll(content.data(placeholder)).data(placeholder, false);
								}
							});
						}
						break;

					case 'image':
						content = current.tpl.image.replace('{href}', href);
						break;

					case 'swf':
						content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
						embed = '';

						$.each(current.swf, function (name, val) {
							content += '<param name="' + name + '" value="' + val + '"></param>';
							embed += ' ' + name + '="' + val + '"';
						});

						content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
						break;
				}

				if (!(isQuery(content) && content.parent().is(current.inner))) {
					current.inner.append(content);
				}

				// Give a chance for helpers or callbacks to update elements
				F.trigger('beforeShow');

				// Set scrolling before calculating dimensions
				current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : scrolling === 'no' ? 'hidden' : scrolling);

				// Set initial dimensions and start position
				F._setDimension();

				F.reposition();

				F.isOpen = false;
				F.coming = null;

				F.bindEvents();

				if (!F.isOpened) {
					$('.fancybox-wrap').not(current.wrap).stop(true).trigger('onReset').remove();
				} else if (previous.prevMethod) {
					F.transitions[previous.prevMethod]();
				}

				F.transitions[F.isOpened ? current.nextMethod : current.openMethod]();

				F._preloadImages();
			},

			_setDimension: function _setDimension() {
				var viewport = F.getViewport(),
				    steps = 0,
				    canShrink = false,
				    canExpand = false,
				    wrap = F.wrap,
				    skin = F.skin,
				    inner = F.inner,
				    current = F.current,
				    width = current.width,
				    height = current.height,
				    minWidth = current.minWidth,
				    minHeight = current.minHeight,
				    maxWidth = current.maxWidth,
				    maxHeight = current.maxHeight,
				    scrolling = current.scrolling,
				    scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
				    margin = current.margin,
				    wMargin = getScalar(margin[1] + margin[3]),
				    hMargin = getScalar(margin[0] + margin[2]),
				    wPadding,
				    hPadding,
				    wSpace,
				    hSpace,
				    origWidth,
				    origHeight,
				    origMaxWidth,
				    origMaxHeight,
				    ratio,
				    width_,
				    height_,
				    maxWidth_,
				    maxHeight_,
				    iframe,
				    body;

				// Reset dimensions so we could re-check actual size
				wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');

				wPadding = getScalar(skin.outerWidth(true) - skin.width());
				hPadding = getScalar(skin.outerHeight(true) - skin.height());

				// Any space between content and viewport (margin, padding, border, title)
				wSpace = wMargin + wPadding;
				hSpace = hMargin + hPadding;

				origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
				origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;

				if (current.type === 'iframe') {
					iframe = current.content;

					if (current.autoHeight && iframe.data('ready') === 1) {
						try {
							if (iframe[0].contentWindow.document.location) {
								inner.width(origWidth).height(9999);

								body = iframe.contents().find('body');

								if (scrollOut) {
									body.css('overflow-x', 'hidden');
								}

								origHeight = body.outerHeight(true);
							}
						} catch (e) {}
					}
				} else if (current.autoWidth || current.autoHeight) {
					inner.addClass('fancybox-tmp');

					// Set width or height in case we need to calculate only one dimension
					if (!current.autoWidth) {
						inner.width(origWidth);
					}

					if (!current.autoHeight) {
						inner.height(origHeight);
					}

					if (current.autoWidth) {
						origWidth = inner.width();
					}

					if (current.autoHeight) {
						origHeight = inner.height();
					}

					inner.removeClass('fancybox-tmp');
				}

				width = getScalar(origWidth);
				height = getScalar(origHeight);

				ratio = origWidth / origHeight;

				// Calculations for the content
				minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
				maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);

				minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
				maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);

				// These will be used to determine if wrap can fit in the viewport
				origMaxWidth = maxWidth;
				origMaxHeight = maxHeight;

				if (current.fitToView) {
					maxWidth = Math.min(viewport.w - wSpace, maxWidth);
					maxHeight = Math.min(viewport.h - hSpace, maxHeight);
				}

				maxWidth_ = viewport.w - wMargin;
				maxHeight_ = viewport.h - hMargin;

				if (current.aspectRatio) {
					if (width > maxWidth) {
						width = maxWidth;
						height = getScalar(width / ratio);
					}

					if (height > maxHeight) {
						height = maxHeight;
						width = getScalar(height * ratio);
					}

					if (width < minWidth) {
						width = minWidth;
						height = getScalar(width / ratio);
					}

					if (height < minHeight) {
						height = minHeight;
						width = getScalar(height * ratio);
					}
				} else {
					width = Math.max(minWidth, Math.min(width, maxWidth));

					if (current.autoHeight && current.type !== 'iframe') {
						inner.width(width);

						height = inner.height();
					}

					height = Math.max(minHeight, Math.min(height, maxHeight));
				}

				// Try to fit inside viewport (including the title)
				if (current.fitToView) {
					inner.width(width).height(height);

					wrap.width(width + wPadding);

					// Real wrap dimensions
					width_ = wrap.width();
					height_ = wrap.height();

					if (current.aspectRatio) {
						while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
							if (steps++ > 19) {
								break;
							}

							height = Math.max(minHeight, Math.min(maxHeight, height - 10));
							width = getScalar(height * ratio);

							if (width < minWidth) {
								width = minWidth;
								height = getScalar(width / ratio);
							}

							if (width > maxWidth) {
								width = maxWidth;
								height = getScalar(width / ratio);
							}

							inner.width(width).height(height);

							wrap.width(width + wPadding);

							width_ = wrap.width();
							height_ = wrap.height();
						}
					} else {
						width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
						height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
					}
				}

				if (scrollOut && scrolling === 'auto' && height < origHeight && width + wPadding + scrollOut < maxWidth_) {
					width += scrollOut;
				}

				inner.width(width).height(height);

				wrap.width(width + wPadding);

				width_ = wrap.width();
				height_ = wrap.height();

				canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
				canExpand = current.aspectRatio ? width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight : (width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight);

				$.extend(current, {
					dim: {
						width: getValue(width_),
						height: getValue(height_)
					},
					origWidth: origWidth,
					origHeight: origHeight,
					canShrink: canShrink,
					canExpand: canExpand,
					wPadding: wPadding,
					hPadding: hPadding,
					wrapSpace: height_ - skin.outerHeight(true),
					skinSpace: skin.height() - height
				});

				if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
					inner.height('auto');
				}
			},

			_getPosition: function _getPosition(onlyAbsolute) {
				var current = F.current,
				    viewport = F.getViewport(),
				    margin = current.margin,
				    width = F.wrap.width() + margin[1] + margin[3],
				    height = F.wrap.height() + margin[0] + margin[2],
				    rez = {
					position: 'absolute',
					top: margin[0],
					left: margin[3]
				};

				if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
					rez.position = 'fixed';
				} else if (!current.locked) {
					rez.top += viewport.y;
					rez.left += viewport.x;
				}

				rez.top = getValue(Math.max(rez.top, rez.top + (viewport.h - height) * current.topRatio));
				rez.left = getValue(Math.max(rez.left, rez.left + (viewport.w - width) * current.leftRatio));

				return rez;
			},

			_afterZoomIn: function _afterZoomIn() {
				var current = F.current;

				if (!current) {
					return;
				}

				F.isOpen = F.isOpened = true;

				F.wrap.css('overflow', 'visible').addClass('fancybox-opened');

				F.update();

				// Assign a click event
				if (current.closeClick || current.nextClick && F.group.length > 1) {
					F.inner.css('cursor', 'pointer').bind('click.fb', function (e) {
						if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
							e.preventDefault();

							F[current.closeClick ? 'close' : 'next']();
						}
					});
				}

				// Create a close button
				if (current.closeBtn) {
					$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function (e) {
						e.preventDefault();

						F.close();
					});
				}

				// Create navigation arrows
				if (current.arrows && F.group.length > 1) {
					if (current.loop || current.index > 0) {
						$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
					}

					if (current.loop || current.index < F.group.length - 1) {
						$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
					}
				}

				F.trigger('afterShow');

				// Stop the slideshow if this is the last item
				if (!current.loop && current.index === current.group.length - 1) {
					F.play(false);
				} else if (F.opts.autoPlay && !F.player.isActive) {
					F.opts.autoPlay = false;

					F.play();
				}
			},

			_afterZoomOut: function _afterZoomOut(obj) {
				obj = obj || F.current;

				$('.fancybox-wrap').trigger('onReset').remove();

				$.extend(F, {
					group: {},
					opts: {},
					router: false,
					current: null,
					isActive: false,
					isOpened: false,
					isOpen: false,
					isClosing: false,
					wrap: null,
					skin: null,
					outer: null,
					inner: null
				});

				F.trigger('afterClose', obj);
			}
		});

		/*
	  *	Default transitions
	  */

		F.transitions = {
			getOrigPosition: function getOrigPosition() {
				var current = F.current,
				    element = current.element,
				    orig = current.orig,
				    pos = {},
				    width = 50,
				    height = 50,
				    hPadding = current.hPadding,
				    wPadding = current.wPadding,
				    viewport = F.getViewport();

				if (!orig && current.isDom && element.is(':visible')) {
					orig = element.find('img:first');

					if (!orig.length) {
						orig = element;
					}
				}

				if (isQuery(orig)) {
					pos = orig.offset();

					if (orig.is('img')) {
						width = orig.outerWidth();
						height = orig.outerHeight();
					}
				} else {
					pos.top = viewport.y + (viewport.h - height) * current.topRatio;
					pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
				}

				if (F.wrap.css('position') === 'fixed' || current.locked) {
					pos.top -= viewport.y;
					pos.left -= viewport.x;
				}

				pos = {
					top: getValue(pos.top - hPadding * current.topRatio),
					left: getValue(pos.left - wPadding * current.leftRatio),
					width: getValue(width + wPadding),
					height: getValue(height + hPadding)
				};

				return pos;
			},

			step: function step(now, fx) {
				var ratio,
				    padding,
				    value,
				    prop = fx.prop,
				    current = F.current,
				    wrapSpace = current.wrapSpace,
				    skinSpace = current.skinSpace;

				if (prop === 'width' || prop === 'height') {
					ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);

					if (F.isClosing) {
						ratio = 1 - ratio;
					}

					padding = prop === 'width' ? current.wPadding : current.hPadding;
					value = now - padding;

					F.skin[prop](getScalar(prop === 'width' ? value : value - wrapSpace * ratio));
					F.inner[prop](getScalar(prop === 'width' ? value : value - wrapSpace * ratio - skinSpace * ratio));
				}
			},

			zoomIn: function zoomIn() {
				var current = F.current,
				    startPos = current.pos,
				    effect = current.openEffect,
				    elastic = effect === 'elastic',
				    endPos = $.extend({ opacity: 1 }, startPos);

				// Remove "position" property that breaks older IE
				delete endPos.position;

				if (elastic) {
					startPos = this.getOrigPosition();

					if (current.openOpacity) {
						startPos.opacity = 0.1;
					}
				} else if (effect === 'fade') {
					startPos.opacity = 0.1;
				}

				F.wrap.css(startPos).animate(endPos, {
					duration: effect === 'none' ? 0 : current.openSpeed,
					easing: current.openEasing,
					step: elastic ? this.step : null,
					complete: F._afterZoomIn
				});
			},

			zoomOut: function zoomOut() {
				var current = F.current,
				    effect = current.closeEffect,
				    elastic = effect === 'elastic',
				    endPos = { opacity: 0.1 };

				if (elastic) {
					endPos = this.getOrigPosition();

					if (current.closeOpacity) {
						endPos.opacity = 0.1;
					}
				}

				F.wrap.animate(endPos, {
					duration: effect === 'none' ? 0 : current.closeSpeed,
					easing: current.closeEasing,
					step: elastic ? this.step : null,
					complete: F._afterZoomOut
				});
			},

			changeIn: function changeIn() {
				var current = F.current,
				    effect = current.nextEffect,
				    startPos = current.pos,
				    endPos = { opacity: 1 },
				    direction = F.direction,
				    distance = 200,
				    field;

				startPos.opacity = 0.1;

				if (effect === 'elastic') {
					field = direction === 'down' || direction === 'up' ? 'top' : 'left';

					if (direction === 'down' || direction === 'right') {
						startPos[field] = getValue(getScalar(startPos[field]) - distance);
						endPos[field] = '+=' + distance + 'px';
					} else {
						startPos[field] = getValue(getScalar(startPos[field]) + distance);
						endPos[field] = '-=' + distance + 'px';
					}
				}

				// Workaround for http://bugs.jquery.com/ticket/12273
				if (effect === 'none') {
					F._afterZoomIn();
				} else {
					F.wrap.css(startPos).animate(endPos, {
						duration: current.nextSpeed,
						easing: current.nextEasing,
						complete: F._afterZoomIn
					});
				}
			},

			changeOut: function changeOut() {
				var previous = F.previous,
				    effect = previous.prevEffect,
				    endPos = { opacity: 0.1 },
				    direction = F.direction,
				    distance = 200;

				if (effect === 'elastic') {
					endPos[direction === 'down' || direction === 'up' ? 'top' : 'left'] = (direction === 'up' || direction === 'left' ? '-' : '+') + '=' + distance + 'px';
				}

				previous.wrap.animate(endPos, {
					duration: effect === 'none' ? 0 : previous.prevSpeed,
					easing: previous.prevEasing,
					complete: function complete() {
						$(this).trigger('onReset').remove();
					}
				});
			}
		};

		/*
	  *	Overlay helper
	  */

		F.helpers.overlay = {
			defaults: {
				closeClick: true, // if true, fancyBox will be closed when user clicks on the overlay
				speedOut: 200, // duration of fadeOut animation
				showEarly: true, // indicates if should be opened immediately or wait until the content is ready
				css: {}, // custom CSS properties
				locked: !isTouch, // if true, the content will be locked into overlay
				fixed: true // if false, the overlay CSS position property will not be set to "fixed"
			},

			overlay: null, // current handle
			fixed: false, // indicates if the overlay has position "fixed"
			el: $('html'), // element that contains "the lock"

			// Public methods
			create: function create(opts) {
				opts = $.extend({}, this.defaults, opts);

				if (this.overlay) {
					this.close();
				}

				this.overlay = $('<div class="fancybox-overlay"></div>').appendTo(F.coming ? F.coming.parent : opts.parent);
				this.fixed = false;

				if (opts.fixed && F.defaults.fixed) {
					this.overlay.addClass('fancybox-overlay-fixed');

					this.fixed = true;
				}
			},

			open: function open(opts) {
				var that = this;

				opts = $.extend({}, this.defaults, opts);

				if (this.overlay) {
					this.overlay.unbind('.overlay').width('auto').height('auto');
				} else {
					this.create(opts);
				}

				if (!this.fixed) {
					W.bind('resize.overlay', $.proxy(this.update, this));

					this.update();
				}

				if (opts.closeClick) {
					this.overlay.bind('click.overlay', function (e) {
						if ($(e.target).hasClass('fancybox-overlay')) {
							if (F.isActive) {
								F.close();
							} else {
								that.close();
							}

							return false;
						}
					});
				}

				this.overlay.css(opts.css).show();
			},

			close: function close() {
				var scrollV, scrollH;

				W.unbind('resize.overlay');

				if (this.el.hasClass('fancybox-lock')) {
					$('.fancybox-margin').removeClass('fancybox-margin');

					scrollV = W.scrollTop();
					scrollH = W.scrollLeft();

					this.el.removeClass('fancybox-lock');

					W.scrollTop(scrollV).scrollLeft(scrollH);
				}

				$('.fancybox-overlay').remove().hide();

				$.extend(this, {
					overlay: null,
					fixed: false
				});
			},

			// Private, callbacks

			update: function update() {
				var width = '100%',
				    offsetWidth;

				// Reset width/height so it will not mess
				this.overlay.width(width).height('100%');

				// jQuery does not return reliable result for IE
				if (IE) {
					offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);

					if (D.width() > offsetWidth) {
						width = D.width();
					}
				} else if (D.width() > W.width()) {
					width = D.width();
				}

				this.overlay.width(width).height(D.height());
			},

			// This is where we can manipulate DOM, because later it would cause iframes to reload
			onReady: function onReady(opts, obj) {
				var overlay = this.overlay;

				$('.fancybox-overlay').stop(true, true);

				if (!overlay) {
					this.create(opts);
				}

				if (opts.locked && this.fixed && obj.fixed) {
					if (!overlay) {
						this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
					}

					obj.locked = this.overlay.append(obj.wrap);
					obj.fixed = false;
				}

				if (opts.showEarly === true) {
					this.beforeShow.apply(this, arguments);
				}
			},

			beforeShow: function beforeShow(opts, obj) {
				var scrollV, scrollH;

				if (obj.locked) {
					if (this.margin !== false) {
						$('*').filter(function () {
							return $(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap");
						}).addClass('fancybox-margin');

						this.el.addClass('fancybox-margin');
					}

					scrollV = W.scrollTop();
					scrollH = W.scrollLeft();

					this.el.addClass('fancybox-lock');

					W.scrollTop(scrollV).scrollLeft(scrollH);
				}

				this.open(opts);
			},

			onUpdate: function onUpdate() {
				if (!this.fixed) {
					this.update();
				}
			},

			afterClose: function afterClose(opts) {
				// Remove overlay if exists and fancyBox is not opening
				// (e.g., it is not being open using afterClose callback)
				//if (this.overlay && !F.isActive) {
				if (this.overlay && !F.coming) {
					this.overlay.fadeOut(opts.speedOut, $.proxy(this.close, this));
				}
			}
		};

		/*
	  *	Title helper
	  */

		F.helpers.title = {
			defaults: {
				type: 'float', // 'float', 'inside', 'outside' or 'over',
				position: 'bottom' // 'top' or 'bottom'
			},

			beforeShow: function beforeShow(opts) {
				var current = F.current,
				    text = current.title,
				    type = opts.type,
				    title,
				    target;

				if ($.isFunction(text)) {
					text = text.call(current.element, current);
				}

				if (!isString(text) || $.trim(text) === '') {
					return;
				}

				title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');

				switch (type) {
					case 'inside':
						target = F.skin;
						break;

					case 'outside':
						target = F.wrap;
						break;

					case 'over':
						target = F.inner;
						break;

					default:
						// 'float'
						target = F.skin;

						title.appendTo('body');

						if (IE) {
							title.width(title.width());
						}

						title.wrapInner('<span class="child"></span>');

						//Increase bottom margin so this title will also fit into viewport
						F.current.margin[2] += Math.abs(getScalar(title.css('margin-bottom')));
						break;
				}

				title[opts.position === 'top' ? 'prependTo' : 'appendTo'](target);
			}
		};

		// jQuery plugin initialization
		$.fn.fancybox = function (options) {
			var index,
			    that = $(this),
			    selector = this.selector || '',
			    run = function run(e) {
				var what = $(this).blur(),
				    idx = index,
				    relType,
				    relVal;

				if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
					relType = options.groupAttr || 'data-fancybox-group';
					relVal = what.attr(relType);

					if (!relVal) {
						relType = 'rel';
						relVal = what.get(0)[relType];
					}

					if (relVal && relVal !== '' && relVal !== 'nofollow') {
						what = selector.length ? $(selector) : that;
						what = what.filter('[' + relType + '="' + relVal + '"]');
						idx = what.index(this);
					}

					options.index = idx;

					// Stop an event from bubbling if everything is fine
					if (F.open(what, options) !== false) {
						e.preventDefault();
					}
				}
			};

			options = options || {};
			index = options.index || 0;

			if (!selector || options.live === false) {
				that.unbind('click.fb-start').bind('click.fb-start', run);
			} else {
				D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
			}

			this.filter('[data-fancybox-start=1]').trigger('click');

			return this;
		};

		// Tests that need a body at doc ready
		D.ready(function () {
			var w1, w2;

			if ($.scrollbarWidth === undefined) {
				// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
				$.scrollbarWidth = function () {
					var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
					    child = parent.children(),
					    width = child.innerWidth() - child.height(99).innerWidth();

					parent.remove();

					return width;
				};
			}

			if ($.support.fixedPosition === undefined) {
				$.support.fixedPosition = function () {
					var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
					    fixed = elem[0].offsetTop === 20 || elem[0].offsetTop === 15;

					elem.remove();

					return fixed;
				}();
			}

			$.extend(F.defaults, {
				scrollbarWidth: $.scrollbarWidth(),
				fixed: $.support.fixedPosition,
				parent: $('body')
			});

			//Get real width of page scroll-bar
			w1 = $(window).width();

			H.addClass('fancybox-lock-test');

			w2 = $(window).width();

			H.removeClass('fancybox-lock-test');

			$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
		});
		})(window, document, jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 211:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	/* global sincos, jQuery */

	(function ($) {

	    $.productsearch = function (element, options) {

	        var productsearch = this;

	        var $productsearch_input = $(element);

	        productsearch.settings = {};

	        // Merge options with defaults
	        productsearch.settings = $.extend({
	            searchSubmitSelector: '.js-product-search-submit',
	            lastSearchString: '',
	            resultsWrapper: 'ul',
	            resultsWrapperClass: 'product-search__output',
	            resultElementWrapper: 'li',
	            resultElementWrapperClass: 'product-search__element',
	            outputContainerSelector: '.js-product-search__container',
	            outputWrapper: '.js-product-search-results',
	            extraHitsSelector: '.js-product-search__extra-hits',
	            numHitsSelector: '.js-product-search__num-extra-hits',
	            noHitsSelector: '.js-product-search__no-hits',
	            linkClass: 'themed-nav',
	            minQueryLength: 3
	        }, options);

	        // Init the plugin
	        var init = function init() {
	            productsearch.output_container = $(productsearch.settings.outputContainerSelector);
	            productsearch.output_wrapper = $(productsearch.settings.outputWrapper);
	            productsearch.no_hits = $(productsearch.settings.noHitsSelector);
	            productsearch.extra_hits = $(productsearch.settings.extraHitsSelector);
	            productsearch.num_extra_hits = $(productsearch.settings.numHitsSelector);
	            setupListeners();
	        };

	        // Which events should we listen for
	        var setupListeners = function setupListeners() {
	            $productsearch_input.on('keydown', function (event) {
	                // Blur the field if 'esc' is pressed
	                if (event.keyCode == 27) {
	                    return $(this).blur();
	                }

	                // Cannot cache this selector as new search results load async
	                var links = productsearch.output_container.find('a.themed-nav:visible'),
	                    active = links.filter('.active'),
	                    index = $.inArray(active[0] || active, links);

	                //Can't do shit with no links
	                if (links.length) {
	                    //Down/tab 40/9
	                    if (event.keyCode == 40 || event.keyCode == 9) {
	                        event.preventDefault();

	                        var next = Math.min(index + 1, links.length - 1);
	                        links.removeClass('active');
	                        $(links[next]).addClass('active');
	                    }
	                    //Up/shift+tab 38/9+
	                    if (event.keyCode == 38 || event.keyCode == 9 && event.shiftKey === true) {
	                        event.preventDefault();

	                        var prev = Math.max(index - 1, -1);
	                        links.removeClass('active');
	                        //Allow user to deselect results instead of force selecting the first result
	                        if (prev > -1) $(links[prev]).addClass('active');
	                    }
	                    //Return/enter 10/13, if no result is .active then allow user to see search results page when hitting enter
	                    if (event.keyCode == 10 || event.keyCode == 13 && active.length) {
	                        event.preventDefault();

	                        active[0].click(); //Emulate native browser click
	                    }
	                }
	            });
	            $productsearch_input.on('change keyup', sincos.functions.debounce(search, 300));
	            $productsearch_input.on('focus', focusSearch);
	            $productsearch_input.on('blur', sincos.functions.debounce(hideResults, 500));
	            productsearch.extra_hits.click(function (event) {
	                event.preventDefault();
	                $(productsearch.settings.searchSubmitSelector).trigger('click');
	            });
	        };

	        var focusSearch = function focusSearch() {
	            if (hasResults()) {
	                showResults();
	            }
	        };

	        var setActivityIndicator = function setActivityIndicator() {
	            $productsearch_input.closest('form').addClass('search-box--loading');
	        },
	            resetActivityIndicator = function resetActivityIndicator() {
	            $productsearch_input.closest('form').removeClass('search-box--loading');
	        };

	        var search = function search() {
	            var query = getSearchString();

	            // Prevent querying the server for the same stuff twice
	            // Prevent searching for short search terms
	            if (query != productsearch.settings.lastSearchString && query.length >= productsearch.settings.minQueryLength) {
	                productsearch.settings.lastSearchString = query;

	                setActivityIndicator();
	                $.ajax({
	                    url: '/search',
	                    data: $productsearch_input.serialize(),
	                    dataType: 'json'
	                }).done(function (data) {
	                    outputResults(data);
	                }).always(resetActivityIndicator).error(clearResults);
	            } else if (query.length < productsearch.settings.minQueryLength) {
	                clearResults();
	                productsearch.settings.lastSearchString = query;
	                resetActivityIndicator();
	            }
	        };

	        var getSearchString = function getSearchString() {
	            return $productsearch_input.val().trim();
	        };

	        var hasValidSearchString = function hasValidSearchString() {
	            var query = getSearchString();
	            return query.length >= productsearch.settings.minQueryLength;
	        };

	        var outputResults = function outputResults(results) {
	            productsearch.output_container.removeClass('is-hidden');
	            $productsearch_input.addClass('is-results');

	            var output = $(document.createElement(productsearch.settings.resultsWrapper)).addClass(productsearch.settings.resultsWrapperClass);
	            var row = $(document.createElement(productsearch.settings.resultElementWrapper)).addClass(productsearch.settings.resultElementWrapperClass);
	            var i = 0;

	            $.each(results.produkter, function (index, elem) {
	                output.append(row.clone().attr('id', 'prod-' + elem.id).html('<a class="' + productsearch.settings.linkClass + '" href="/produkt/' + elem.sti + '/' + elem.navn + '">' + elem.overskrift + '</a>').on('focusout', sincos.functions.debounce(hideResults, 500)));
	                i++;
	            });

	            // If large number of hits, display number of extra hits
	            productsearch.num_extra_hits.text(results.antall - i);

	            productsearch.output_container.html(output);

	            showResults();

	            trackPageView();
	        };

	        var hasResults = function hasResults() {
	            return productsearch.output_container.find(productsearch.settings.resultElementWrapper).length > 0;
	        };

	        var hasExtraResults = function hasExtraResults() {
	            return parseInt(productsearch.num_extra_hits.text(), 10) > 0;
	        };

	        var showResults = function showResults() {
	            if (hasResults()) {
	                productsearch.no_hits.addClass('is-hidden');
	                productsearch.output_wrapper.removeClass('is-hidden');
	                productsearch.output_container.removeClass('is-hidden');
	                $productsearch_input.addClass('is-results');

	                if (hasExtraResults()) {
	                    productsearch.extra_hits.removeClass('is-hidden');
	                } else {
	                    productsearch.extra_hits.addClass('is-hidden');
	                }
	            } else if (hasValidSearchString()) {
	                displayEmptyResults();
	            }
	        };

	        var trackPageView = function trackPageView() {
	            if ('ga' in window) {
	                window.ga('send', 'pageview', 'search/?q=' + getSearchString());
	            }
	        };

	        var hideResults = function hideResults() {
	            // If focus is not in the resultset, hide the resultset
	            if (!$.contains(productsearch.output_wrapper.get(0), document.activeElement)) {
	                productsearch.output_wrapper.addClass('is-hidden');
	                productsearch.extra_hits.addClass('is-hidden');
	                productsearch.output_container.addClass('is-hidden');
	                $productsearch_input.removeClass('is-results');
	            }
	        };

	        var clearResults = function clearResults() {
	            productsearch.output_container.empty().addClass('is-hidden');
	            $productsearch_input.removeClass('is-results');
	            productsearch.output_wrapper.addClass('is-hidden');
	            productsearch.extra_hits.addClass('is-hidden');
	            productsearch.no_hits.addClass('is-hidden');
	        };

	        var displayEmptyResults = function displayEmptyResults() {
	            productsearch.no_hits.removeClass('is-hidden');
	            productsearch.extra_hits.addClass('is-hidden');
	            productsearch.output_wrapper.removeClass('is-hidden');
	        };

	        init();
	    };

	    $.fn.productsearch = function (options) {
	        return this.each(function () {
	            if (undefined === $(this).data('productsearch')) {
	                var plugin = new $.productsearch(this, options);
	                $(this).data('productsearch', plugin);
	            }
	        });
	    };
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 212:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	/*!
	 * SmartMenus jQuery Plugin - v0.9.7 - August 25, 2014
	 * http://www.smartmenus.org/
	 *
	 * Copyright 2014 Vasil Dinkov, Vadikom Web Ltd.
	 * http://vadikom.com
	 *
	 * Licensed MIT
	 */

	(function ($) {

		var menuTrees = [],
		    IE = !!window.createPopup,
		    // detect it for the iframe shim
		mouse = false,
		    // optimize for touch by default - we will detect for mouse input
		mouseDetectionEnabled = false;

		// Handle detection for mouse input (i.e. desktop browsers, tablets with a mouse, etc.)
		function initMouseDetection(disable) {
			var eNS = '.smartmenus_mouse';
			if (!mouseDetectionEnabled && !disable) {
				// if we get two consecutive mousemoves within 2 pixels from each other and within 300ms, we assume a real mouse/cursor is present
				// in practice, this seems like impossible to trick unintentianally with a real mouse and a pretty safe detection on touch devices (even with older browsers that do not support touch events)
				var firstTime = true,
				    lastMove = null;
				$(document).bind(getEventsNS([['mousemove', function (e) {
					var thisMove = { x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() };
					if (lastMove) {
						var deltaX = Math.abs(lastMove.x - thisMove.x),
						    deltaY = Math.abs(lastMove.y - thisMove.y);
						if ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp - lastMove.timeStamp <= 300) {
							mouse = true;
							// if this is the first check after page load, check if we are not over some item by chance and call the mouseenter handler if yes
							if (firstTime) {
								var $a = $(e.target).closest('a');
								if ($a.is('a')) {
									$.each(menuTrees, function () {
										if ($.contains(this.$root[0], $a[0])) {
											this.itemEnter({ currentTarget: $a[0] });
											return false;
										}
									});
								}
								firstTime = false;
							}
						}
					}
					lastMove = thisMove;
				}], [touchEvents() ? 'touchstart' : 'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut', function (e) {
					if (isTouchEvent(e.originalEvent)) {
						mouse = false;
					}
				}]], eNS));
				mouseDetectionEnabled = true;
			} else if (mouseDetectionEnabled && disable) {
				$(document).unbind(eNS);
				mouseDetectionEnabled = false;
			}
		}

		function isTouchEvent(e) {
			return !/^(4|mouse)$/.test(e.pointerType);
		}

		// we use this just to choose between toucn and pointer events when we need to, not for touch screen detection
		function touchEvents() {
			return 'ontouchstart' in window;
		}

		// returns a jQuery bind() ready object
		function getEventsNS(defArr, eNS) {
			if (!eNS) {
				eNS = '';
			}
			var obj = {};
			$.each(defArr, function (index, value) {
				obj[value[0].split(' ').join(eNS + ' ') + eNS] = value[1];
			});
			return obj;
		}

		$.SmartMenus = function (elm, options) {
			this.$root = $(elm);
			this.opts = options;
			this.rootId = ''; // internal
			this.$subArrow = null;
			this.subMenus = []; // all sub menus in the tree (UL elms) in no particular order (only real - e.g. UL's in mega sub menus won't be counted)
			this.activatedItems = []; // stores last activated A's for each level
			this.visibleSubMenus = []; // stores visible sub menus UL's
			this.showTimeout = 0;
			this.hideTimeout = 0;
			this.scrollTimeout = 0;
			this.clickActivated = false;
			this.zIndexInc = 0;
			this.$firstLink = null; // we'll use these for some tests
			this.$firstSub = null; // at runtime so we'll cache them
			this.disabled = false;
			this.$disableOverlay = null;
			this.isTouchScrolling = false;
			this.init();
		};

		$.extend($.SmartMenus, {
			hideAll: function hideAll() {
				$.each(menuTrees, function () {
					this.menuHideAll();
				});
			},
			destroy: function destroy() {
				while (menuTrees.length) {
					menuTrees[0].destroy();
				}
				initMouseDetection(true);
			},
			prototype: {
				init: function init(refresh) {
					var self = this;

					if (!refresh) {
						menuTrees.push(this);

						this.rootId = (new Date().getTime() + Math.random() + '').replace(/\D/g, '');

						if (this.$root.hasClass('sm-rtl')) {
							this.opts.rightToLeftSubMenus = true;
						}

						// init root (main menu)
						var eNS = '.smartmenus';
						this.$root.data('smartmenus', this).attr('data-smartmenus-id', this.rootId).dataSM('level', 1).bind(getEventsNS([['mouseover focusin', $.proxy(this.rootOver, this)], ['mouseout focusout', $.proxy(this.rootOut, this)]], eNS)).delegate('a', getEventsNS([['mouseenter', $.proxy(this.itemEnter, this)], ['mouseleave', $.proxy(this.itemLeave, this)], ['mousedown', $.proxy(this.itemDown, this)], ['focus', $.proxy(this.itemFocus, this)], ['blur', $.proxy(this.itemBlur, this)], ['click', $.proxy(this.itemClick, this)], ['touchend', $.proxy(this.itemTouchEnd, this)]], eNS));

						// hide menus on tap or click outside the root UL
						eNS += this.rootId;
						if (this.opts.hideOnClick) {
							$(document).bind(getEventsNS([['touchstart', $.proxy(this.docTouchStart, this)], ['touchmove', $.proxy(this.docTouchMove, this)], ['touchend', $.proxy(this.docTouchEnd, this)],
							// for Opera Mobile < 11.5, webOS browser, etc. we'll check click too
							['click', $.proxy(this.docClick, this)]], eNS));
						}
						// hide sub menus on resize
						$(window).bind(getEventsNS([['resize orientationchange', $.proxy(this.winResize, this)]], eNS));

						if (this.opts.subIndicators) {
							this.$subArrow = $('<span/>').addClass('sub-arrow');
							if (this.opts.subIndicatorsText) {
								this.$subArrow.html(this.opts.subIndicatorsText);
							}
						}

						// make sure mouse detection is enabled
						initMouseDetection();
					}

					// init sub menus
					this.$firstSub = this.$root.find('ul').each(function () {
						self.menuInit($(this));
					}).eq(0);

					this.$firstLink = this.$root.find('a').eq(0);

					// find current item
					if (this.opts.markCurrentItem) {
						var reDefaultDoc = /(index|default)\.[^#\?\/]*/i,
						    reHash = /#.*/,
						    locHref = window.location.href.replace(reDefaultDoc, ''),
						    locHrefNoHash = locHref.replace(reHash, '');
						this.$root.find('a').each(function () {
							var href = this.href.replace(reDefaultDoc, ''),
							    $this = $(this);
							if (href == locHref || href == locHrefNoHash) {
								$this.addClass('current');
								if (self.opts.markCurrentTree) {
									$this.parent().parentsUntil('[data-smartmenus-id]', 'li').children('a').addClass('current');
								}
							}
						});
					}
				},
				destroy: function destroy() {
					this.menuHideAll();
					var eNS = '.smartmenus';
					this.$root.removeData('smartmenus').removeAttr('data-smartmenus-id').removeDataSM('level').unbind(eNS).undelegate(eNS);
					eNS += this.rootId;
					$(document).unbind(eNS);
					$(window).unbind(eNS);
					if (this.opts.subIndicators) {
						this.$subArrow = null;
					}
					var self = this;
					$.each(this.subMenus, function () {
						if (this.hasClass('mega-menu')) {
							this.find('ul').removeDataSM('in-mega');
						}
						if (this.dataSM('shown-before')) {
							if (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth) {
								this.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap');
							}
							if (this.dataSM('scroll-arrows')) {
								this.dataSM('scroll-arrows').remove();
							}
							this.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' });
						}
						if (self.opts.subIndicators) {
							this.dataSM('parent-a').removeClass('has-submenu').children('span.sub-arrow').remove();
						}
						this.removeDataSM('shown-before').removeDataSM('ie-shim').removeDataSM('scroll-arrows').removeDataSM('parent-a').removeDataSM('level').removeDataSM('beforefirstshowfired').parent().removeDataSM('sub');
					});
					if (this.opts.markCurrentItem) {
						this.$root.find('a.current').removeClass('current');
					}
					this.$root = null;
					this.$firstLink = null;
					this.$firstSub = null;
					if (this.$disableOverlay) {
						this.$disableOverlay.remove();
						this.$disableOverlay = null;
					}
					menuTrees.splice($.inArray(this, menuTrees), 1);
				},
				disable: function disable(noOverlay) {
					if (!this.disabled) {
						this.menuHideAll();
						// display overlay over the menu to prevent interaction
						if (!noOverlay && !this.opts.isPopup && this.$root.is(':visible')) {
							var pos = this.$root.offset();
							this.$disableOverlay = $('<div class="sm-jquery-disable-overlay"/>').css({
								position: 'absolute',
								top: pos.top,
								left: pos.left,
								width: this.$root.outerWidth(),
								height: this.$root.outerHeight(),
								zIndex: this.getStartZIndex(true),
								opacity: 0
							}).appendTo(document.body);
						}
						this.disabled = true;
					}
				},
				docClick: function docClick(e) {
					if (this.isTouchScrolling) {
						this.isTouchScrolling = false;
						return;
					}
					// hide on any click outside the menu or on a menu link
					if (this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).is('a')) {
						this.menuHideAll();
					}
				},
				docTouchEnd: function docTouchEnd(e) {
					if (!this.lastTouch) {
						return;
					}
					if (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) {
						if (this.hideTimeout) {
							clearTimeout(this.hideTimeout);
							this.hideTimeout = 0;
						}
						// hide with a delay to prevent triggering accidental unwanted click on some page element
						var self = this;
						this.hideTimeout = setTimeout(function () {
							self.menuHideAll();
						}, 350);
					}
					this.lastTouch = null;
				},
				docTouchMove: function docTouchMove(e) {
					if (!this.lastTouch) {
						return;
					}
					var touchPoint = e.originalEvent.touches[0];
					this.lastTouch.x2 = touchPoint.pageX;
					this.lastTouch.y2 = touchPoint.pageY;
				},
				docTouchStart: function docTouchStart(e) {
					var touchPoint = e.originalEvent.touches[0];
					this.lastTouch = { x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target };
				},
				enable: function enable() {
					if (this.disabled) {
						if (this.$disableOverlay) {
							this.$disableOverlay.remove();
							this.$disableOverlay = null;
						}
						this.disabled = false;
					}
				},
				getClosestMenu: function getClosestMenu(elm) {
					var $closestMenu = $(elm).closest('ul');
					while ($closestMenu.dataSM('in-mega')) {
						$closestMenu = $closestMenu.parent().closest('ul');
					}
					return $closestMenu[0] || null;
				},
				getHeight: function getHeight($elm) {
					return this.getOffset($elm, true);
				},
				// returns precise width/height float values
				getOffset: function getOffset($elm, height) {
					var old;
					if ($elm.css('display') == 'none') {
						old = { position: $elm[0].style.position, visibility: $elm[0].style.visibility };
						$elm.css({ position: 'absolute', visibility: 'hidden' }).show();
					}
					var box = $elm[0].getBoundingClientRect && $elm[0].getBoundingClientRect(),
					    val = box && (height ? box.height || box.bottom - box.top : box.width || box.right - box.left);
					if (!val && val !== 0) {
						val = height ? $elm[0].offsetHeight : $elm[0].offsetWidth;
					}
					if (old) {
						$elm.hide().css(old);
					}
					return val;
				},
				getStartZIndex: function getStartZIndex(root) {
					var zIndex = parseInt(this[root ? '$root' : '$firstSub'].css('z-index'));
					if (!root && isNaN(zIndex)) {
						zIndex = parseInt(this.$root.css('z-index'));
					}
					return !isNaN(zIndex) ? zIndex : 1;
				},
				getTouchPoint: function getTouchPoint(e) {
					return e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e;
				},
				getViewport: function getViewport(height) {
					var name = height ? 'Height' : 'Width',
					    val = document.documentElement['client' + name],
					    val2 = window['inner' + name];
					if (val2) {
						val = Math.min(val, val2);
					}
					return val;
				},
				getViewportHeight: function getViewportHeight() {
					return this.getViewport(true);
				},
				getViewportWidth: function getViewportWidth() {
					return this.getViewport();
				},
				getWidth: function getWidth($elm) {
					return this.getOffset($elm);
				},
				handleEvents: function handleEvents() {
					return !this.disabled && this.isCSSOn();
				},
				handleItemEvents: function handleItemEvents($a) {
					return this.handleEvents() && !this.isLinkInMegaMenu($a);
				},
				isCollapsible: function isCollapsible() {
					return this.$firstSub.css('position') == 'static';
				},
				isCSSOn: function isCSSOn() {
					return this.$firstLink.css('display') == 'block';
				},
				isFixed: function isFixed() {
					var isFixed = this.$root.css('position') == 'fixed';
					if (!isFixed) {
						this.$root.parentsUntil('body').each(function () {
							if ($(this).css('position') == 'fixed') {
								isFixed = true;
								return false;
							}
						});
					}
					return isFixed;
				},
				isLinkInMegaMenu: function isLinkInMegaMenu($a) {
					return !$a.parent().parent().dataSM('level');
				},
				isTouchMode: function isTouchMode() {
					return !mouse || this.isCollapsible();
				},
				itemActivate: function itemActivate($a) {
					var $li = $a.parent(),
					    $ul = $li.parent(),
					    level = $ul.dataSM('level');
					// if for some reason the parent item is not activated (e.g. this is an API call to activate the item), activate all parent items first
					if (level > 1 && (!this.activatedItems[level - 2] || this.activatedItems[level - 2][0] != $ul.dataSM('parent-a')[0])) {
						var self = this;
						$($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function () {
							self.itemActivate($(this).dataSM('parent-a'));
						});
					}
					// hide any visible deeper level sub menus
					if (this.visibleSubMenus.length > level) {
						this.menuHideSubMenus(!this.activatedItems[level - 1] || this.activatedItems[level - 1][0] != $a[0] ? level - 1 : level);
					}
					// save new active item and sub menu for this level
					this.activatedItems[level - 1] = $a;
					this.visibleSubMenus[level - 1] = $ul;
					if (this.$root.triggerHandler('activate.smapi', $a[0]) === false) {
						return;
					}
					// show the sub menu if this item has one
					var $sub = $li.dataSM('sub');
					if ($sub && (this.isTouchMode() || !this.opts.showOnClick || this.clickActivated)) {
						this.menuShow($sub);
					}
				},
				itemBlur: function itemBlur(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					this.$root.triggerHandler('blur.smapi', $a[0]);
				},
				itemClick: function itemClick(e) {
					if (this.isTouchScrolling) {
						this.isTouchScrolling = false;
						e.stopPropagation();
						return false;
					}
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					$a.removeDataSM('mousedown');
					if (this.$root.triggerHandler('click.smapi', $a[0]) === false) {
						return false;
					}
					var $sub = $a.parent().dataSM('sub');
					if (this.isTouchMode()) {
						// undo fix: prevent the address bar on iPhone from sliding down when expanding a sub menu
						if ($a.dataSM('href')) {
							$a.attr('href', $a.dataSM('href')).removeDataSM('href');
						}
						// if the sub is not visible
						if ($sub && (!$sub.dataSM('shown-before') || !$sub.is(':visible'))) {
							// try to activate the item and show the sub
							this.itemActivate($a);
							// if "itemActivate" showed the sub, prevent the click so that the link is not loaded
							// if it couldn't show it, then the sub menus are disabled with an !important declaration (e.g. via mobile styles) so let the link get loaded
							if ($sub.is(':visible')) {
								return false;
							}
						}
					} else if (this.opts.showOnClick && $a.parent().parent().dataSM('level') == 1 && $sub) {
						this.clickActivated = true;
						this.menuShow($sub);
						return false;
					}
					if ($a.hasClass('disabled')) {
						return false;
					}
					if (this.$root.triggerHandler('select.smapi', $a[0]) === false) {
						return false;
					}
				},
				itemDown: function itemDown(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					$a.dataSM('mousedown', true);
				},
				itemEnter: function itemEnter(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					if (!this.isTouchMode()) {
						if (this.showTimeout) {
							clearTimeout(this.showTimeout);
							this.showTimeout = 0;
						}
						var self = this;
						this.showTimeout = setTimeout(function () {
							self.itemActivate($a);
						}, this.opts.showOnClick && $a.parent().parent().dataSM('level') == 1 ? 1 : this.opts.showTimeout);
					}
					this.$root.triggerHandler('mouseenter.smapi', $a[0]);
				},
				itemFocus: function itemFocus(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					// fix (the mousedown check): in some browsers a tap/click produces consecutive focus + click events so we don't need to activate the item on focus
					if ((!this.isTouchMode() || !$a.dataSM('mousedown')) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length - 1][0] != $a[0])) {
						this.itemActivate($a);
					}
					this.$root.triggerHandler('focus.smapi', $a[0]);
				},
				itemLeave: function itemLeave(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					if (!this.isTouchMode()) {
						if ($a[0].blur) {
							$a[0].blur();
						}
						if (this.showTimeout) {
							clearTimeout(this.showTimeout);
							this.showTimeout = 0;
						}
					}
					$a.removeDataSM('mousedown');
					this.$root.triggerHandler('mouseleave.smapi', $a[0]);
				},
				itemTouchEnd: function itemTouchEnd(e) {
					var $a = $(e.currentTarget);
					if (!this.handleItemEvents($a)) {
						return;
					}
					// prevent the address bar on iPhone from sliding down when expanding a sub menu
					var $sub = $a.parent().dataSM('sub');
					if ($a.attr('href').charAt(0) !== '#' && $sub && (!$sub.dataSM('shown-before') || !$sub.is(':visible'))) {
						$a.dataSM('href', $a.attr('href'));
						$a.attr('href', '#');
					}
				},
				menuFixLayout: function menuFixLayout($ul) {
					// fixes a menu that is being shown for the first time
					if (!$ul.dataSM('shown-before')) {
						$ul.hide().dataSM('shown-before', true);
					}
				},
				menuHide: function menuHide($sub) {
					if (this.$root.triggerHandler('beforehide.smapi', $sub[0]) === false) {
						return;
					}
					$sub.stop(true, true);
					if ($sub.is(':visible')) {
						var complete = function complete() {
							// unset z-index
							$sub.css('z-index', '');
						};
						// if sub is collapsible (mobile view)
						if (this.isCollapsible()) {
							if (this.opts.collapsibleHideFunction) {
								this.opts.collapsibleHideFunction.call(this, $sub, complete);
							} else {
								$sub.hide(this.opts.collapsibleHideDuration, complete);
							}
						} else {
							if (this.opts.hideFunction) {
								this.opts.hideFunction.call(this, $sub, complete);
							} else {
								$sub.hide(this.opts.hideDuration, complete);
							}
						}
						// remove IE iframe shim
						if ($sub.dataSM('ie-shim')) {
							$sub.dataSM('ie-shim').remove();
						}
						// deactivate scrolling if it is activated for this sub
						if ($sub.dataSM('scroll')) {
							this.menuScrollStop($sub);
							$sub.css({ 'touch-action': '', '-ms-touch-action': '' }).unbind('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide();
						}
						// unhighlight parent item
						$sub.dataSM('parent-a').removeClass('highlighted');
						var level = $sub.dataSM('level');
						this.activatedItems.splice(level - 1, 1);
						this.visibleSubMenus.splice(level - 1, 1);
						this.$root.triggerHandler('hide.smapi', $sub[0]);
					}
				},
				menuHideAll: function menuHideAll() {
					if (this.showTimeout) {
						clearTimeout(this.showTimeout);
						this.showTimeout = 0;
					}
					// hide all subs
					this.menuHideSubMenus();
					// hide root if it's popup
					if (this.opts.isPopup) {
						this.$root.stop(true, true);
						if (this.$root.is(':visible')) {
							if (this.opts.hideFunction) {
								this.opts.hideFunction.call(this, this.$root);
							} else {
								this.$root.hide(this.opts.hideDuration);
							}
							// remove IE iframe shim
							if (this.$root.dataSM('ie-shim')) {
								this.$root.dataSM('ie-shim').remove();
							}
						}
					}
					this.activatedItems = [];
					this.visibleSubMenus = [];
					this.clickActivated = false;
					// reset z-index increment
					this.zIndexInc = 0;
				},
				menuHideSubMenus: function menuHideSubMenus(level) {
					if (!level) level = 0;
					for (var i = this.visibleSubMenus.length - 1; i > level; i--) {
						this.menuHide(this.visibleSubMenus[i]);
					}
				},
				menuIframeShim: function menuIframeShim($ul) {
					// create iframe shim for the menu
					if (IE && this.opts.overlapControlsInIE && !$ul.dataSM('ie-shim')) {
						$ul.dataSM('ie-shim', $('<iframe/>').attr({ src: 'javascript:0', tabindex: -9 }).css({ position: 'absolute', top: 'auto', left: '0', opacity: 0, border: '0' }));
					}
				},
				menuInit: function menuInit($ul) {
					if (!$ul.dataSM('in-mega')) {
						this.subMenus.push($ul);
						// mark UL's in mega drop downs (if any) so we can neglect them
						if ($ul.hasClass('mega-menu')) {
							$ul.find('ul').dataSM('in-mega', true);
						}
						// get level (much faster than, for example, using parentsUntil)
						var level = 2,
						    par = $ul[0];
						while ((par = par.parentNode.parentNode) != this.$root[0]) {
							level++;
						}
						// cache stuff
						$ul.dataSM('parent-a', $ul.prevAll('a').eq(-1)).dataSM('level', level).parent().dataSM('sub', $ul);
						// add sub indicator to parent item
						if (this.opts.subIndicators) {
							$ul.dataSM('parent-a').addClass('has-submenu')[this.opts.subIndicatorsPos](this.$subArrow.clone());
						}
					}
				},
				menuPosition: function menuPosition($sub) {
					var $a = $sub.dataSM('parent-a'),
					    $ul = $sub.parent().parent(),
					    level = $sub.dataSM('level'),
					    subW = this.getWidth($sub),
					    subH = this.getHeight($sub),
					    itemOffset = $a.offset(),
					    itemX = itemOffset.left,
					    itemY = itemOffset.top,
					    itemW = this.getWidth($a),
					    itemH = this.getHeight($a),
					    $win = $(window),
					    winX = $win.scrollLeft(),
					    winY = $win.scrollTop(),
					    winW = this.getViewportWidth(),
					    winH = this.getViewportHeight(),
					    horizontalParent = $ul.hasClass('sm') && !$ul.hasClass('sm-vertical'),
					    subOffsetX = level == 2 ? this.opts.mainMenuSubOffsetX : this.opts.subMenusSubOffsetX,
					    subOffsetY = level == 2 ? this.opts.mainMenuSubOffsetY : this.opts.subMenusSubOffsetY,
					    x,
					    y;
					if (horizontalParent) {
						x = this.opts.rightToLeftSubMenus ? itemW - subW - subOffsetX : subOffsetX;
						y = this.opts.bottomToTopSubMenus ? -subH - subOffsetY : itemH + subOffsetY;
					} else {
						x = this.opts.rightToLeftSubMenus ? subOffsetX - subW : itemW - subOffsetX;
						y = this.opts.bottomToTopSubMenus ? itemH - subOffsetY - subH : subOffsetY;
					}
					if (this.opts.keepInViewport && !this.isCollapsible()) {
						var absX = itemX + x,
						    absY = itemY + y;
						if (this.opts.rightToLeftSubMenus && absX < winX) {
							x = horizontalParent ? winX - absX + x : itemW - subOffsetX;
						} else if (!this.opts.rightToLeftSubMenus && absX + subW > winX + winW) {
							x = horizontalParent ? winX + winW - subW - absX + x : subOffsetX - subW;
						}
						if (!horizontalParent) {
							if (subH < winH && absY + subH > winY + winH) {
								y += winY + winH - subH - absY;
							} else if (subH >= winH || absY < winY) {
								y += winY - absY;
							}
						}
						// do we need scrolling?
						// 0.49 used for better precision when dealing with float values
						if (horizontalParent && (absY + subH > winY + winH + 0.49 || absY < winY) || !horizontalParent && subH > winH + 0.49) {
							var self = this;
							if (!$sub.dataSM('scroll-arrows')) {
								$sub.dataSM('scroll-arrows', $([$('<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0], $('<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]]).bind({
									mouseenter: function mouseenter() {
										$sub.dataSM('scroll').up = $(this).hasClass('scroll-up');
										self.menuScroll($sub);
									},
									mouseleave: function mouseleave(e) {
										self.menuScrollStop($sub);
										self.menuScrollOut($sub, e);
									},
									'mousewheel DOMMouseScroll': function mousewheelDOMMouseScroll(e) {
										e.preventDefault();
									}
								}).insertAfter($sub));
							}
							// bind scroll events and save scroll data for this sub
							var eNS = '.smartmenus_scroll';
							$sub.dataSM('scroll', {
								step: 1,
								// cache stuff for faster recalcs later
								itemH: itemH,
								subH: subH,
								arrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1))
							}).bind(getEventsNS([['mouseover', function (e) {
								self.menuScrollOver($sub, e);
							}], ['mouseout', function (e) {
								self.menuScrollOut($sub, e);
							}], ['mousewheel DOMMouseScroll', function (e) {
								self.menuScrollMousewheel($sub, e);
							}]], eNS)).dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width')) || 0), width: subW - (parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0), zIndex: $sub.css('z-index') }).eq(horizontalParent && this.opts.bottomToTopSubMenus ? 0 : 1).show();
							// when a menu tree is fixed positioned we allow scrolling via touch too
							// since there is no other way to access such long sub menus if no mouse is present
							if (this.isFixed()) {
								$sub.css({ 'touch-action': 'none', '-ms-touch-action': 'none' }).bind(getEventsNS([[touchEvents() ? 'touchstart touchmove touchend' : 'pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp', function (e) {
									self.menuScrollTouch($sub, e);
								}]], eNS));
							}
						}
					}
					$sub.css({ top: 'auto', left: '0', marginLeft: x, marginTop: y - itemH });
					// IE iframe shim
					this.menuIframeShim($sub);
					if ($sub.dataSM('ie-shim')) {
						$sub.dataSM('ie-shim').css({ zIndex: $sub.css('z-index'), width: subW, height: subH, marginLeft: x, marginTop: y - itemH });
					}
				},
				menuScroll: function menuScroll($sub, once, step) {
					var data = $sub.dataSM('scroll'),
					    $arrows = $sub.dataSM('scroll-arrows'),
					    y = parseFloat($sub.css('margin-top')),
					    end = data.up ? data.upEnd : data.downEnd,
					    diff;
					if (!once && data.velocity) {
						data.velocity *= 0.9;
						diff = data.velocity;
						if (diff < 0.5) {
							this.menuScrollStop($sub);
							return;
						}
					} else {
						diff = step || (once || !this.opts.scrollAccelerate ? this.opts.scrollStep : Math.floor(data.step));
					}
					// hide any visible deeper level sub menus
					var level = $sub.dataSM('level');
					if (this.visibleSubMenus.length > level) {
						this.menuHideSubMenus(level - 1);
					}
					var newY = data.up && end <= y || !data.up && end >= y ? y : Math.abs(end - y) > diff ? y + (data.up ? diff : -diff) : end;
					$sub.add($sub.dataSM('ie-shim')).css('margin-top', newY);
					// show opposite arrow if appropriate
					if (mouse && (data.up && newY > data.downEnd || !data.up && newY < data.upEnd)) {
						$arrows.eq(data.up ? 1 : 0).show();
					}
					// if we've reached the end
					if (newY == end) {
						if (mouse) {
							$arrows.eq(data.up ? 0 : 1).hide();
						}
						this.menuScrollStop($sub);
					} else if (!once) {
						if (this.opts.scrollAccelerate && data.step < this.opts.scrollStep) {
							data.step += 0.5;
						}
						var self = this;
						this.scrollTimeout = setTimeout(function () {
							self.menuScroll($sub);
						}, this.opts.scrollInterval);
					}
				},
				menuScrollMousewheel: function menuScrollMousewheel($sub, e) {
					if (this.getClosestMenu(e.target) == $sub[0]) {
						e = e.originalEvent;
						var up = (e.wheelDelta || -e.detail) > 0;
						if ($sub.dataSM('scroll-arrows').eq(up ? 0 : 1).is(':visible')) {
							$sub.dataSM('scroll').up = up;
							this.menuScroll($sub, true);
						}
					}
					e.preventDefault();
				},
				menuScrollOut: function menuScrollOut($sub, e) {
					if (mouse) {
						if (!/^scroll-(up|down)/.test((e.relatedTarget || '').className) && ($sub[0] != e.relatedTarget && !$.contains($sub[0], e.relatedTarget) || this.getClosestMenu(e.relatedTarget) != $sub[0])) {
							$sub.dataSM('scroll-arrows').css('visibility', 'hidden');
						}
					}
				},
				menuScrollOver: function menuScrollOver($sub, e) {
					if (mouse) {
						if (!/^scroll-(up|down)/.test(e.target.className) && this.getClosestMenu(e.target) == $sub[0]) {
							this.menuScrollRefreshData($sub);
							var data = $sub.dataSM('scroll');
							$sub.dataSM('scroll-arrows').eq(0).css('margin-top', data.upEnd).end().eq(1).css('margin-top', data.downEnd + data.subH - data.arrowDownH).end().css('visibility', 'visible');
						}
					}
				},
				menuScrollRefreshData: function menuScrollRefreshData($sub) {
					var data = $sub.dataSM('scroll'),
					    $win = $(window),
					    vportY = $win.scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;
					$.extend(data, {
						upEnd: vportY,
						downEnd: vportY + this.getViewportHeight() - data.subH
					});
				},
				menuScrollStop: function menuScrollStop($sub) {
					if (this.scrollTimeout) {
						clearTimeout(this.scrollTimeout);
						this.scrollTimeout = 0;
						$.extend($sub.dataSM('scroll'), {
							step: 1,
							velocity: 0
						});
						return true;
					}
				},
				menuScrollTouch: function menuScrollTouch($sub, e) {
					e = e.originalEvent;
					if (isTouchEvent(e)) {
						var touchPoint = this.getTouchPoint(e);
						// neglect event if we touched a visible deeper level sub menu
						if (this.getClosestMenu(touchPoint.target) == $sub[0]) {
							var data = $sub.dataSM('scroll');
							if (/(start|down)$/i.test(e.type)) {
								if (this.menuScrollStop($sub)) {
									// if we were scrolling, just stop and don't activate any link on the first touch
									e.preventDefault();
									this.isTouchScrolling = true;
								} else {
									this.isTouchScrolling = false;
								}
								// update scroll data since the user might have zoomed, etc.
								this.menuScrollRefreshData($sub);
								// extend it with the touch properties
								$.extend(data, {
									touchY: touchPoint.pageY,
									touchTimestamp: e.timeStamp,
									velocity: 0
								});
							} else if (/move$/i.test(e.type)) {
								var prevY = data.touchY;
								if (prevY !== undefined && prevY != touchPoint.pageY) {
									this.isTouchScrolling = true;
									$.extend(data, {
										up: prevY < touchPoint.pageY,
										touchY: touchPoint.pageY,
										touchTimestamp: e.timeStamp,
										velocity: data.velocity + Math.abs(touchPoint.pageY - prevY) * 0.5
									});
									this.menuScroll($sub, true, Math.abs(data.touchY - prevY));
								}
								e.preventDefault();
							} else {
								// touchend/pointerup
								if (data.touchY !== undefined) {
									// check if we need to scroll
									if (e.timeStamp - data.touchTimestamp < 120 && data.velocity > 0) {
										data.velocity *= 0.5;
										this.menuScrollStop($sub);
										this.menuScroll($sub);
										e.preventDefault();
									}
									delete data.touchY;
								}
							}
						}
					}
				},
				menuShow: function menuShow($sub) {
					if (!$sub.dataSM('beforefirstshowfired')) {
						$sub.dataSM('beforefirstshowfired', true);
						if (this.$root.triggerHandler('beforefirstshow.smapi', $sub[0]) === false) {
							return;
						}
					}
					if (this.$root.triggerHandler('beforeshow.smapi', $sub[0]) === false) {
						return;
					}
					this.menuFixLayout($sub);
					$sub.stop(true, true);
					if (!$sub.is(':visible')) {
						// set z-index
						$sub.css('z-index', this.zIndexInc = (this.zIndexInc || this.getStartZIndex()) + 1);
						// highlight parent item
						if (this.opts.keepHighlighted || this.isCollapsible()) {
							$sub.dataSM('parent-a').addClass('highlighted');
						}
						// min/max-width fix - no way to rely purely on CSS as all UL's are nested
						if (this.opts.subMenusMinWidth || this.opts.subMenusMaxWidth) {
							$sub.css({ width: 'auto', minWidth: '', maxWidth: '' }).addClass('sm-nowrap');
							if (this.opts.subMenusMinWidth) {
								$sub.css('min-width', this.opts.subMenusMinWidth);
							}
							if (this.opts.subMenusMaxWidth) {
								var noMaxWidth = this.getWidth($sub);
								$sub.css('max-width', this.opts.subMenusMaxWidth);
								if (noMaxWidth > this.getWidth($sub)) {
									$sub.removeClass('sm-nowrap').css('width', this.opts.subMenusMaxWidth);
								}
							}
						}
						this.menuPosition($sub);
						// insert IE iframe shim
						if ($sub.dataSM('ie-shim')) {
							$sub.dataSM('ie-shim').insertBefore($sub);
						}
						var complete = function complete() {
							// fix: "overflow: hidden;" is not reset on animation complete in jQuery < 1.9.0 in Chrome when global "box-sizing: border-box;" is used
							$sub.css('overflow', '');
						};
						// if sub is collapsible (mobile view)
						if (this.isCollapsible()) {
							if (this.opts.collapsibleShowFunction) {
								this.opts.collapsibleShowFunction.call(this, $sub, complete);
							} else {
								$sub.show(this.opts.collapsibleShowDuration, complete);
							}
						} else {
							if (this.opts.showFunction) {
								this.opts.showFunction.call(this, $sub, complete);
							} else {
								$sub.show(this.opts.showDuration, complete);
							}
						}
						// save new sub menu for this level
						this.visibleSubMenus[$sub.dataSM('level') - 1] = $sub;
						this.$root.triggerHandler('show.smapi', $sub[0]);
					}
				},
				popupHide: function popupHide(noHideTimeout) {
					if (this.hideTimeout) {
						clearTimeout(this.hideTimeout);
						this.hideTimeout = 0;
					}
					var self = this;
					this.hideTimeout = setTimeout(function () {
						self.menuHideAll();
					}, noHideTimeout ? 1 : this.opts.hideTimeout);
				},
				popupShow: function popupShow(left, top) {
					if (!this.opts.isPopup) {
						alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.');
						return;
					}
					if (this.hideTimeout) {
						clearTimeout(this.hideTimeout);
						this.hideTimeout = 0;
					}
					this.menuFixLayout(this.$root);
					this.$root.stop(true, true);
					if (!this.$root.is(':visible')) {
						this.$root.css({ left: left, top: top });
						// IE iframe shim
						this.menuIframeShim(this.$root);
						if (this.$root.dataSM('ie-shim')) {
							this.$root.dataSM('ie-shim').css({ zIndex: this.$root.css('z-index'), width: this.getWidth(this.$root), height: this.getHeight(this.$root), left: left, top: top }).insertBefore(this.$root);
						}
						// show menu
						var self = this,
						    complete = function complete() {
							self.$root.css('overflow', '');
						};
						if (this.opts.showFunction) {
							this.opts.showFunction.call(this, this.$root, complete);
						} else {
							this.$root.show(this.opts.showDuration, complete);
						}
						this.visibleSubMenus[0] = this.$root;
					}
				},
				refresh: function refresh() {
					this.menuHideAll();
					this.$root.find('ul').each(function () {
						var $this = $(this);
						if ($this.dataSM('scroll-arrows')) {
							$this.dataSM('scroll-arrows').remove();
						}
					}).removeDataSM('in-mega').removeDataSM('shown-before').removeDataSM('ie-shim').removeDataSM('scroll-arrows').removeDataSM('parent-a').removeDataSM('level').removeDataSM('beforefirstshowfired');
					this.$root.find('a.has-submenu').removeClass('has-submenu').parent().removeDataSM('sub');
					if (this.opts.subIndicators) {
						this.$root.find('span.sub-arrow').remove();
					}
					if (this.opts.markCurrentItem) {
						this.$root.find('a.current').removeClass('current');
					}
					this.subMenus = [];
					this.init(true);
				},
				rootOut: function rootOut(e) {
					if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {
						return;
					}
					if (this.hideTimeout) {
						clearTimeout(this.hideTimeout);
						this.hideTimeout = 0;
					}
					if (!this.opts.showOnClick || !this.opts.hideOnClick) {
						var self = this;
						this.hideTimeout = setTimeout(function () {
							self.menuHideAll();
						}, this.opts.hideTimeout);
					}
				},
				rootOver: function rootOver(e) {
					if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {
						return;
					}
					if (this.hideTimeout) {
						clearTimeout(this.hideTimeout);
						this.hideTimeout = 0;
					}
				},
				winResize: function winResize(e) {
					if (!this.handleEvents()) {
						// we still need to resize the disable overlay if it's visible
						if (this.$disableOverlay) {
							var pos = this.$root.offset();
							this.$disableOverlay.css({
								top: pos.top,
								left: pos.left,
								width: this.$root.outerWidth(),
								height: this.$root.outerHeight()
							});
						}
						return;
					}
					// hide sub menus on resize - on mobile do it only on orientation change
					if (!this.isCollapsible() && (!('onorientationchange' in window) || e.type == 'orientationchange')) {
						if (this.activatedItems.length) {
							this.activatedItems[this.activatedItems.length - 1][0].blur();
						}
						this.menuHideAll();
					}
				}
			}
		});

		$.fn.dataSM = function (key, val) {
			if (val) {
				return this.data(key + '_smartmenus', val);
			}
			return this.data(key + '_smartmenus');
		};

		$.fn.removeDataSM = function (key) {
			return this.removeData(key + '_smartmenus');
		};

		$.fn.smartmenus = function (options) {
			if (typeof options == 'string') {
				var args = arguments,
				    method = options;
				Array.prototype.shift.call(args);
				return this.each(function () {
					var smartmenus = $(this).data('smartmenus');
					if (smartmenus && smartmenus[method]) {
						smartmenus[method].apply(smartmenus, args);
					}
				});
			}
			var opts = $.extend({}, $.fn.smartmenus.defaults, options);
			return this.each(function () {
				new $.SmartMenus(this, opts);
			});
		};

		// default settings
		$.fn.smartmenus.defaults = {
			isPopup: false, // is this a popup menu (can be shown via the popupShow/popupHide methods) or a permanent menu bar
			mainMenuSubOffsetX: 0, // pixels offset from default position
			mainMenuSubOffsetY: 0, // pixels offset from default position
			subMenusSubOffsetX: 0, // pixels offset from default position
			subMenusSubOffsetY: 0, // pixels offset from default position
			subMenusMinWidth: '10em', // min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored
			subMenusMaxWidth: '20em', // max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored
			subIndicators: true, // create sub menu indicators - creates a SPAN and inserts it in the A
			subIndicatorsPos: 'prepend', // position of the SPAN relative to the menu item content ('prepend', 'append')
			subIndicatorsText: '+', // [optionally] add text in the SPAN (e.g. '+') (you may want to check the CSS for the sub indicators too)
			scrollStep: 30, // pixels step when scrolling long sub menus that do not fit in the viewport height
			scrollInterval: 30, // interval between each scrolling step
			scrollAccelerate: true, // accelerate scrolling or use a fixed step
			showTimeout: 250, // timeout before showing the sub menus
			hideTimeout: 500, // timeout before hiding the sub menus
			showDuration: 0, // duration for show animation - set to 0 for no animation - matters only if showFunction:null
			showFunction: null, // custom function to use when showing a sub menu (the default is the jQuery 'show')
			// don't forget to call complete() at the end of whatever you do
			// e.g.: function($ul, complete) { $ul.fadeIn(250, complete); }
			hideDuration: 0, // duration for hide animation - set to 0 for no animation - matters only if hideFunction:null
			hideFunction: function hideFunction($ul, complete) {
				$ul.fadeOut(200, complete);
			}, // custom function to use when hiding a sub menu (the default is the jQuery 'hide')
			// don't forget to call complete() at the end of whatever you do
			// e.g.: function($ul, complete) { $ul.fadeOut(250, complete); }
			collapsibleShowDuration: 0, // duration for show animation for collapsible sub menus - matters only if collapsibleShowFunction:null
			collapsibleShowFunction: function collapsibleShowFunction($ul, complete) {
				$ul.slideDown(200, complete);
			}, // custom function to use when showing a collapsible sub menu
			// (i.e. when mobile styles are used to make the sub menus collapsible)
			collapsibleHideDuration: 0, // duration for hide animation for collapsible sub menus - matters only if collapsibleHideFunction:null
			collapsibleHideFunction: function collapsibleHideFunction($ul, complete) {
				$ul.slideUp(200, complete);
			}, // custom function to use when hiding a collapsible sub menu
			// (i.e. when mobile styles are used to make the sub menus collapsible)
			showOnClick: false, // show the first-level sub menus onclick instead of onmouseover (matters only for mouse input)
			hideOnClick: true, // hide the sub menus on click/tap anywhere on the page
			keepInViewport: true, // reposition the sub menus if needed to make sure they always appear inside the viewport
			keepHighlighted: true, // keep all ancestor items of the current sub menu highlighted (adds the 'highlighted' class to the A's)
			markCurrentItem: false, // automatically add the 'current' class to the A element of the item linking to the current URL
			markCurrentTree: true, // add the 'current' class also to the A elements of all ancestor items of the current item
			rightToLeftSubMenus: false, // right to left display of the sub menus (check the CSS for the sub indicators' position)
			bottomToTopSubMenus: false, // bottom to top display of the sub menus
			overlapControlsInIE: true // make sure sub menus appear on top of special OS controls in IE (i.e. SELECT, OBJECT, EMBED, etc.)
		};
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 213:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	/*!
	 * SmartMenus jQuery Plugin Keyboard Addon - v0.1.0 - August 25, 2014
	 * http://www.smartmenus.org/
	 *
	 * Copyright 2014 Vasil Dinkov, Vadikom Web Ltd.
	 * http://vadikom.com
	 *
	 * Licensed MIT
	 */

	(function ($) {

		function getFirstItemLink($ul) {
			return $ul.find('> li > a:not(.disabled)').eq(0);
		}
		function getLastItemLink($ul) {
			return $ul.find('> li > a:not(.disabled)').eq(-1);
		}
		function getNextItemLink($li, noLoop) {
			var $a = $li.nextAll('li').children('a:not(.disabled)').eq(0);
			return noLoop || $a.length ? $a : getFirstItemLink($li.parent());
		}
		function getPreviousItemLink($li, noLoop) {
			var $a = $li.prevAll('li').children('a:not(.disabled)').eq(0);
			return noLoop || $a.length ? $a : getLastItemLink($li.parent());
		}

		// jQuery's .focus() is unreliable in some versions, so we're going to call the links' native JS focus method
		$.fn.focusSM = function () {
			if (this.length && this[0].focus) {
				this[0].focus();
			}
			return this;
		};

		$.extend($.SmartMenus.Keyboard = {}, {
			docKeydown: function docKeydown(e) {
				var keyCode = e.keyCode;
				if (!/(27|37|38|39|40)/.test(keyCode)) {
					return;
				}
				var $root = $(this),
				    obj = $root.data('smartmenus'),
				    $target = $(e.target);
				if (!obj || !$target.is('a')) {
					return;
				}
				var $li = $target.parent(),
				    $ul = $li.parent(),
				    level = $ul.dataSM('level');
				// exit it if this is an A inside a mega drop-down
				if (!level) {
					return;
				}
				// swap left & right keys
				if (obj.opts.rightToLeftSubMenus) {
					if (keyCode == 37) {
						keyCode = 39;
					} else if (keyCode == 39) {
						keyCode = 37;
					}
				}
				switch (keyCode) {
					case 27:
						// Esc
						if (obj.visibleSubMenus[level]) {
							obj.menuHide(obj.visibleSubMenus[level]);
						} else if (level == 1) {
							if (obj.opts.isPopup) {
								obj.menuHideAll();
							}
							if (obj.opts.keyboardEscapeFocus) {
								try {
									obj.opts.keyboardEscapeFocus.focusSM();
								} catch (e) {};
								// focus next focusable page element
							} else {
									var $lastMenuFocusable = $root.find('a, input, select, button, textarea').eq(-1),
									    $allFocusables = $('a, input, select, button, textarea'),
									    nextFocusableIndex = $allFocusables.index($lastMenuFocusable[0]) + 1;
									$allFocusables.eq(nextFocusableIndex).focusSM();
								}
						} else {
							$ul.dataSM('parent-a').focusSM();
							obj.menuHide(obj.visibleSubMenus[level - 1]);
						}
						break;
					case 37:
						// Left
						if (obj.isCollapsible()) {
							break;
						}
						if (level > 2 || level == 2 && $root.hasClass('sm-vertical')) {
							obj.activatedItems[level - 2].focusSM();
							// move to previous non-disabled parent item (make sure we cycle so it might be the last item)
						} else if (!$root.hasClass('sm-vertical')) {
								getPreviousItemLink(obj.activatedItems[0].parent()).focusSM();
							}
						break;
					case 38:
						// Up
						if (obj.isCollapsible()) {
							var $firstItem;
							// if this is the first item of a sub menu, move to the parent item
							if (level > 1 && ($firstItem = getFirstItemLink($ul)).length && $target[0] == $firstItem[0]) {
								obj.activatedItems[level - 2].focusSM();
							} else {
								getPreviousItemLink($li).focusSM();
							}
						} else {
							if (level == 1 && !$root.hasClass('sm-vertical') && obj.visibleSubMenus[level] && obj.opts.bottomToTopSubMenus) {
								getLastItemLink(obj.visibleSubMenus[level]).focusSM();
							} else if (level > 1 || $root.hasClass('sm-vertical')) {
								getPreviousItemLink($li).focusSM();
							}
						}
						break;
					case 39:
						// Right
						if (obj.isCollapsible()) {
							break;
						}
						// move to next non-disabled parent item (make sure we cycle so it might be the last item)
						if ((level == 1 || !obj.visibleSubMenus[level]) && !$root.hasClass('sm-vertical')) {
							getNextItemLink(obj.activatedItems[0].parent()).focusSM();
						} else if (obj.visibleSubMenus[level] && !obj.visibleSubMenus[level].hasClass('mega-menu')) {
							getFirstItemLink(obj.visibleSubMenus[level]).focusSM();
						}
						break;
					case 40:
						// Down
						if (obj.isCollapsible()) {
							var $firstSubItem, $lastItem;
							// move to sub menu if appropriate
							if (obj.visibleSubMenus[level] && !obj.visibleSubMenus[level].hasClass('mega-menu') && ($firstSubItem = getFirstItemLink(obj.visibleSubMenus[level])).length) {
								$firstSubItem.focusSM();
								// if this is the last item of a sub menu, move to the next parent item
							} else if (level > 1 && ($lastItem = getLastItemLink($ul)).length && $target[0] == $lastItem[0]) {
									var $parentItem = obj.activatedItems[level - 2].parent(),
									    $nextParentItem = null;
									while ($parentItem.is('li')) {
										if (($nextParentItem = getNextItemLink($parentItem, true)).length) {
											break;
										}
										$parentItem = $parentItem.parent().parent();
									}
									$nextParentItem.focusSM();
								} else {
									getNextItemLink($li).focusSM();
								}
						} else {
							if (level == 1 && !$root.hasClass('sm-vertical') && obj.visibleSubMenus[level] && !obj.opts.bottomToTopSubMenus) {
								getFirstItemLink(obj.visibleSubMenus[level]).focusSM();
							} else if (level > 1 || $root.hasClass('sm-vertical')) {
								getNextItemLink($li).focusSM();
							}
						}
						break;
				}
				e.stopPropagation();
				e.preventDefault();
			}
		});

		// hook it
		$(document).delegate('ul.sm', 'keydown.smartmenus', $.SmartMenus.Keyboard.docKeydown);

		$.extend($.SmartMenus.prototype, {
			keyboardSetEscapeFocus: function keyboardSetEscapeFocus($elm) {
				this.opts.keyboardEscapeFocus = $elm;
			},
			keyboardSetHotkey: function keyboardSetHotkey(keyCode, modifiers) {
				var self = this;
				$(document).bind('keydown.smartmenus' + this.rootId, function (e) {
					if (keyCode == e.keyCode) {
						var procede = true;
						if (modifiers) {
							if (typeof modifiers == 'string') {
								modifiers = [modifiers];
							}
							$.each(['ctrlKey', 'shiftKey', 'altKey', 'metaKey'], function (index, value) {
								if ($.inArray(value, modifiers) >= 0 && !e[value] || $.inArray(value, modifiers) < 0 && e[value]) {
									procede = false;
									return false;
								}
							});
						}
						if (procede) {
							getFirstItemLink(self.$root).focusSM();
							e.stopPropagation();
							e.preventDefault();
						}
					}
				});
			}
		});
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 215:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	(function ($) {

	    $.fn.wishlistButton = function (options) {

	        var wishlistBtn = this;
	        wishlistBtn.settings = {};

	        // Merge options with defaults
	        wishlistBtn.settings = $.extend({
	            productFormSelector: '.product__form'
	        }, options);

	        // Init the cart plugin
	        var init = function init() {

	            wishlistBtn.click(function () {
	                if (wishlistBtn.hasClass('disabled')) {
	                    $.growl({ message: wishlistBtn.data('disabled-msg'), type: 'info' });
	                } else {
	                    $.post("/ajax/onskeliste", $(wishlistBtn.settings.productFormSelector).serialize(), function () {
	                        $.growl({ message: wishlistBtn.data('success') });
	                        trackAddToWishlist();
	                    });
	                    return false;
	                }
	            });
	        };

	        var trackAddToWishlist = function trackAddToWishlist() {
	            if ('ga' in window) {
	                window.ga('send', 'event', {
	                    eventCategory: 'Wishlist',
	                    eventAction: 'Added product to wishlist',
	                    eventLabel: $('.product__title').text() + ', id ' + $('input[name="id"]').val()
	                });
	            }
	        };

	        init();
	    };
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 217:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function($) {'use strict';

	$(function () {
	    var navOpenButton = $('#nav-open-btn');
	    var navOpenCheckbox = $('#nav-open-checkbox');
	    var html = $('html');
	    var navClass = 'js-nav';

	    html.addClass('js-ready');

	    if (navOpenButton.length > 0) {
	        navOpenButton.click(function (event) {
	            event.preventDefault();
	            html.toggleClass(navClass);
	        });
	    } else {
	        if (navOpenCheckbox.length > 0) {
	            navOpenCheckbox.change(function () {
	                html.toggleClass(navClass);
	            });
	        }
	    }

	    $('#nav-close-btn').click(function (event) {
	        event.preventDefault();
	        html.toggleClass(navClass);

	        if (navOpenCheckbox.length > 0) {
	            navOpenCheckbox.prop('checked', false);
	        }
	    });
	});
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 218:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery, $) {'use strict';

	// Version three of the sincos script collection
	/* jshint esversion: 6 */
	/* global Foundation, Modernizr, jQuery, $ */

	if (!window.sincos) window.sincos = { 'settings': {}, 'functions': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
	var sincos = window.sincos;
	sincos.jsEnabled = true;

	sincos.attachBehaviors = function (context) {
	    context = context || document;
	    jQuery.each(sincos.behaviors, function () {
	        this(context);
	    });
	};

	// Slider
	sincos.behaviors.bxslider = function () {
	    var slider_selector = '.js-product-image-slider';
	    var prod_img_slider = $(slider_selector).bxSlider({
	        captions: true,
	        adaptiveHeight: true,
	        adaptiveHeightSpeed: 200,
	        speed: 300,
	        pagerCustom: '#js-product-image-slider-thumbs',
	        onSliderLoad: function onSliderLoad(currentIndex) {
	            // set tabindex=0 for the current slide
	            $(slider_selector + ' > :not(.bx-clone):eq(' + currentIndex + ') > .bx-slide').attr('tabindex', 0);
	            $('.product__images').addClass('slider-loaded');
	        },
	        onSlideAfter: function onSlideAfter(elem) {
	            // set tabindex=0 for active slide, -1 for others
	            elem.find('.bx-slide').attr('tabindex', 0);
	            elem.siblings().find('.bx-slide').attr('tabindex', -1);
	        }
	    });

	    // Add keybord navigation if we have only one slider on the page
	    // and if focus is not in another item that uses arrow key navigation
	    if (prod_img_slider.length === 1) {
	        $('html').keydown(function (e) {
	            if (e.keyCode === 39 || e.keyCode === 37) {
	                if ($(':focus').parents('.js-arrow-key-nav').length === 0 && $(':focus').parents('form').length === 0 && !$('.fancybox-wrap').is(':visible')) {
	                    if (e.keyCode === 39) {
	                        prod_img_slider.goToNextSlide();
	                    } else if (e.keyCode === 37) {
	                        prod_img_slider.goToPrevSlide();
	                    }
	                }
	            }
	        });
	    }
	};

	// See jquery.cart.js
	sincos.behaviors.cart = function () {
	    var cart_btn = $('.cart-button');
	    cart_btn.cart();
	    sincos.cart = cart_btn.data('cart');
	};

	sincos.behaviors.addToCart = function () {
	    $('.js-product__buy-button').one("click", function (e) {
	        var parent = $(this).parents('[itemtype="http://schema.org/Product"]');
	        var productId = parent.find("[data-product-id]").data("product-id");
	        var price = parent.find('meta[itemprop="price"]').attr("content");
	        var currency = parent.find('.offers').find('meta[itemprop="priceCurrency"]').attr("content");

	        $(document).trigger("productAddedToCart", [productId, price, currency]);
	    });
	};

	sincos.behaviors.addBundleToCartOne = function () {
	    $('.js-bundle__buy-button').one("click", function (e) {
	        var parent = $(this).parents('[itemtype="http://schema.org/Product"]');
	        var productId = parent.find("[data-product-id]").data("product-id");
	        var price = parent.find('meta[itemprop="price"]').attr("content");
	        var currency = parent.find('.offers').find('meta[itemprop="priceCurrency"]').attr("content");

	        $(document).trigger("productAddedToCart", [productId, price, currency]);
	    });
	};

	// Init smartmenus
	if (typeof $.fn.smartmenus == "function") {
	    sincos.behaviors.smartmenus = function () {
	        var context = arguments.length <= 0 || arguments[0] === undefined ? document : arguments[0];
	        var selector = arguments.length <= 1 || arguments[1] === undefined ? '#main-menu' : arguments[1];
	        var dynamic = arguments[2];
	        var mediumUp = arguments[3];

	        //@TODO rewrite to use $menu.smartmenus('refresh'); instead of dom cloning toggling display
	        if (dynamic !== false) {
	            var label = $(selector).data('mer') || 'Mer';
	            var submenu = $('<li class="main-nav__item parent level-0 main-nav__item--more"><a href="#">' + label + '</a><ul class="main-nav__submenu level-1"></ul></li>');
	            var clones = $(selector + ' > li').clone();
	            submenu.find('.main-nav__submenu.level-1').append(clones);
	            submenu.find('li').each(function (key, el) {
	                var $el = $(el);
	                var level = $(el).parents('ul').length;

	                $el.removeClass('level-' + (level - 1)).addClass('level-' + level);
	                $el.children('ul').removeClass('level-' + level).addClass('level-' + (level + 1));
	            });
	            $(selector).append(submenu);
	        }

	        $(selector).smartmenus({
	            'subIndicators': false,
	            'subMenusMinWidth': false,
	            'subMenusMaxWidth': false,
	            'keepInViewport': true,
	            'hideDuration': 300,
	            'hideTimeout': 600,
	            'hideOnClick': false //Only needed when menus are shown on click, not :hover
	        });
	        // Prevent crash edge cases on slower iOS devices
	        $(document).off('touchstart.smartmenus_mouse');

	        var refreshThrottle,
	            menu = $(selector),
	            section = menu.parent(),
	            lastChild = menu.children().not('.main-nav__item--more').filter(':last').addClass('main-nav__item--last-child'),
	            handleResize = function handleResize(e) {
	            // Only do this when we're not in tablet mode or mobile
	            if (window.Foundation && !Foundation.utils[mediumUp ? 'is_medium_up' : 'is_large_up']()) {
	                menu.children().css('display', '');
	                menu.find('.main-nav__item--more').hide();

	                return e;
	            }

	            var getOuterWidth = function getOuterWidth(el) {
	                return el[0] && el.outerWidth(true) || 0;
	            };

	            var moreMenuWidth = getOuterWidth(menu.find('.main-nav__item--more'));
	            var offsetPadding = getOuterWidth(menu.find('li:visible > .main-nav__frontpage-link'));
	            var availableWidth = menu.innerWidth();

	            var growing = 0;

	            var startedHiding = false;
	            menu.children().each(function (key, el) {
	                var $el = $(el);
	                if ($el.is('.main-nav__item--more')) return;

	                var width = $el.is(':first-child:not(:visible)') ? 0 : getOuterWidth($el);
	                growing += width;
	                // Add a 5px margin of error
	                if (growing + 5 >= availableWidth) {
	                    $el.hide();
	                    menu.find('.main-nav__item--more > ul').children(':eq(' + key + ')').css('display', '');

	                    // Check if there is not enough room to render the More button
	                    if (availableWidth < growing + 5 - width + moreMenuWidth && !startedHiding) {
	                        $el.prev().hide();
	                        menu.find('.main-nav__item--more > ul').children(':eq(' + (key - 1) + ')').css('display', '');
	                        startedHiding = true;
	                    }
	                } else {
	                    $el.css('display', '');
	                    menu.find('.main-nav__item--more > ul').children(':eq(' + key + ')').hide();
	                }
	            });

	            menu.find('.main-nav__item--more').css({
	                'display': menu.find('.main-nav__item--more > ul').children(':not([style*="display: none"])').length === 0 ? 'none' : ''
	            }).toggleClass('selected', menu.find('.main-nav__item--more .selected:not([style*="display: none"])').length > 0);

	            // Refresh throttle
	            clearTimeout(refreshThrottle);
	            refreshThrottle = setTimeout(function () {
	                menu.smartmenus('refresh');
	            }, 3000);
	        };

	        if (dynamic !== false) {
	            $(window).on('resize load sticky_nav_change', handleResize);
	            handleResize();
	        }
	    };
	}

	// Ajax product search - Disabled for now
	sincos.behaviors.productsearch = function () {
	    var product_search_field = $('.js-product-search');
	    product_search_field.productsearch();
	    sincos.productsearch = product_search_field.data('productsearch');
	};

	// Easier styling of search inputs with focus states than pure css :focus
	sincos.behaviors.searchsugar = function () {
	    $('input.search-box__input').on({
	        focus: function focus() {
	            $(this).addClass('active');
	        },
	        blur: function blur() {
	            var value = this.value.trim();
	            if (!value.length || value === this.defaultValue) $(this).removeClass('active');
	        }
	    });
	};

	sincos.behaviors.fancybox = function () {
	    // Use fancybox for product image popup big medium screens and up
	    if (window.Modernizr && window.Foundation && Modernizr.mq(Foundation.media_queries.medium)) {
	        // Avoid including clones in the gallery, which are created by the bxslider
	        $('.js-fancybox-gallery > li:not(.bx-clone) > .product__main-images__link').fancybox();
	    } else {
	        $('.product__main-images__link').click(function (event) {
	            event.preventDefault();
	        });
	    }

	    // Use fancybox for the login popup in the checkout
	    $(".js-login-popup").fancybox({
	        padding: 20,
	        minWidth: 250,
	        maxWidth: 400,
	        fitToView: true,
	        autoSize: true,
	        closeClick: false,
	        scrolling: 'no',
	        openEffect: 'none',
	        closeEffect: 'none'
	    });

	    $('.js-checkout-login-close').click(function () {
	        $.fancybox.close();
	    });
	};

	// Initialize tabs
	sincos.behaviors.tabs = function () {
	    $('.js-tabs').easyResponsiveTabs();
	};

	// See jquery.wishlist.js
	sincos.behaviors.onskeliste = function () {
	    $('.product__wishlist-button').wishlistButton();
	};

	// Handle ajax submissions on product review forms
	sincos.behaviors.review_form = function (context) {
	    $('.js-review-form .button', context).each(function () {
	        $(this).click(function () {
	            $.post("/ajax/produktanmeldelse", $(".js-review-form").serialize(), function (data) {
	                $('.js-review-form').html(data);
	                $('#produkt_anmeldelser_form_validert').each(function () {
	                    $('.js-review-form .button').hide();
	                    $('.comments-guidelines').hide();
	                });
	            });
	            return false;
	        });
	    });
	};

	// Close the parent element when clicking .close buttons
	sincos.behaviors.close = function () {
	    $('body').on('click', '.close', function () {
	        $(this).parent().slideUp('fast');
	    });
	};

	/**
	 * Toggle visibility of element(s)
	 * @return {void} [description]
	 */
	sincos.behaviors.showHide = function () {
	    $('.js-toggle-visibility').click(function (event) {
	        var btn = $(this);
	        if (btn.prop('tagName') === 'A') {
	            event.preventDefault();
	        }

	        var toggle_toggler_class = btn.data('toggle-toggler-class') || 'toggled';

	        if (btn.data('close') !== 'undefined') {
	            $(btn.data('close')).slideUp('fast');
	        }

	        sincos.functions.showHide(btn.data('toggle'));
	        btn.toggleClass(toggle_toggler_class);

	        if (btn.data('toggle-close-label') !== 'undefined') {
	            var temp = btn.html();
	            btn.html(btn.data('toggle-close-label'));
	            btn.data('toggle-close-label', temp);
	        }
	    });
	};

	sincos.behaviors.stateful = function () {
	    var stateful_forms = $('.js-stateful');

	    $.each(stateful_forms, function (index, value) {
	        var form = $(value);
	        var form_submit = form.find('[type="submit"]');
	        var form_state = form.serialize();
	        form_submit.attr('disabled', true);

	        form.find('select, input, textarea').on('change keyup', function () {
	            if (form.serialize() !== form_state) {
	                form_submit.attr('disabled', false);
	            } else {
	                form_submit.attr('disabled', true);
	            }
	        });
	    });
	};

	sincos.behaviors.byttmva = function (context) {
	    $('.bytt_mva').click(function (event) {
	        event.preventDefault();
	        $("#bytt_mva_form").submit();
	    });
	};

	sincos.behaviors.cookie_notice = function () {
	    $('#cookie_notice_remove').click(function () {
	        document.cookie = 'cookie_notice=0; path=/; max-age=' + 60 * 60 * 24 * 365;
	        $('.cookie_notice').hide();
	        return false;
	    });
	};

	document.cookie = 'javascript=1; path=/';

	sincos.functions.showHide = function (selector) {
	    $(selector).animate({
	        height: 'toggle',
	        opacity: 'toggle'
	    }, 200).toggleClass('toggled');
	};

	sincos.functions.cancel_login = function () {
	    $('.kasse_one_logginn_cancel').click(function () {
	        $.fancybox.close();
	    });
	};

	/**
	 * Debounce, for throttling function calls
	 * @param  {object} fn    function oblect
	 * @param  {int}       delay ms delay
	 * @return {object}       function
	 */
	sincos.functions.debounce = function (fn, delay_input) {
	    var timer = null;
	    var delay = delay_input || 500;
	    return function () {
	        var context = this,
	            args = arguments;
	        clearTimeout(timer);
	        timer = setTimeout(function () {
	            fn.apply(context, args);
	        }, delay);
	    };
	};

	// Attach all behaviors.
	$(function () {
	    sincos.attachBehaviors(window);
	});
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(2)))

/***/ },

/***/ 219:
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';

	// Easy Responsive Tabs Plugin
	// Author: Samson.Onna <Email : samson3d@gmail.com>
	// https://github.com/samsono/Easy-Responsive-Tabs-to-Accordion/
	(function ($) {
	    $.fn.extend({
	        easyResponsiveTabs: function easyResponsiveTabs(options) {
	            //Set the default values, use comma to separate the settings, example:
	            var defaults = {
	                type: 'default', //default, vertical, accordion;
	                width: 'auto',
	                fit: true,
	                closed: false,
	                activate: function activate() {}
	            };

	            //Variables
	            var options = $.extend(defaults, options);
	            var opt = options,
	                jtype = opt.type,
	                jfit = opt.fit,
	                jwidth = opt.width,
	                vtabs = 'vertical',
	                accord = 'accordion';
	            var hash = window.location.hash;
	            var historyApi = !!(window.history && history.replaceState);

	            //Events
	            $(this).bind('tabactivate', function (e, currentTab) {
	                if (typeof options.activate === 'function') {
	                    options.activate.call(currentTab, e);
	                }
	            });

	            //Main function
	            this.each(function () {
	                var $respTabs = $(this);
	                var $respTabsList = $respTabs.find('ul.resp-tabs-list');
	                var respTabsId = $respTabs.attr('id');
	                $respTabs.find('ul.resp-tabs-list li').addClass('resp-tab-item');
	                $respTabs.css({
	                    'display': 'block',
	                    'width': jwidth
	                });

	                $respTabs.find('.resp-tabs-container > div').addClass('resp-tab-content');
	                jtab_options();
	                //Properties Function
	                function jtab_options() {
	                    if (jtype == vtabs) {
	                        $respTabs.addClass('resp-vtabs');
	                    }
	                    if (jfit == true) {
	                        $respTabs.css({ width: '100%', margin: '0px' });
	                    }
	                    if (jtype == accord) {
	                        $respTabs.addClass('resp-easy-accordion');
	                        $respTabs.find('.resp-tabs-list').css('display', 'none');
	                    }
	                }

	                //Assigning the h2 markup to accordion title
	                var $tabItemh2;
	                $respTabs.find('.resp-tab-content').before("<h2 class='resp-accordion' tabindex='0' role='tab'><span class='resp-arrow'></span></h2>");

	                var itemCount = 0;
	                $respTabs.find('.resp-accordion').each(function () {
	                    $tabItemh2 = $(this);
	                    var $tabItem = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')');
	                    var $accItem = $respTabs.find('.resp-accordion:eq(' + itemCount + ')');
	                    $accItem.append($tabItem.html());
	                    $accItem.data($tabItem.data());
	                    $tabItemh2.attr('aria-controls', 'tab_item-' + itemCount);
	                    itemCount++;
	                });

	                //Assigning the 'aria-controls' to Tab items
	                var count = 0;
	                $respTabs.find('.resp-tab-item').each(function () {
	                    var $tabItem = $(this);
	                    $tabItem.attr('aria-controls', 'tab_item-' + count);
	                    $tabItem.attr('role', 'tab');

	                    //Assigning the 'aria-labelledby' attr to tab-content
	                    var tabcount = 0;
	                    $respTabs.find('.resp-tab-content').each(function () {
	                        var $tabContent = $(this);
	                        $tabContent.attr('aria-labelledby', 'tab_item-' + tabcount);
	                        tabcount++;
	                    });
	                    count++;
	                });

	                // Show correct content area
	                var tabNum = 0;
	                if (hash != '') {
	                    var matches = hash.match(new RegExp(respTabsId + "([0-9]+)"));
	                    if (matches !== null && matches.length === 2) {
	                        tabNum = parseInt(matches[1], 10) - 1;
	                        if (tabNum > count) {
	                            tabNum = 0;
	                        }
	                    }
	                }

	                //Active correct tab
	                $($respTabs.find('.resp-tab-item')[tabNum]).addClass('resp-tab-active');

	                //keep closed if option = 'closed' or option is 'accordion' and the element is in accordion mode
	                if (options.closed !== true && !(options.closed === 'accordion' && !$respTabsList.is(':visible')) && !(options.closed === 'tabs' && $respTabsList.is(':visible'))) {
	                    $($respTabs.find('.resp-accordion')[tabNum]).addClass('resp-tab-active');
	                    $($respTabs.find('.resp-tab-content')[tabNum]).addClass('resp-tab-content-active').attr('style', 'display:block');
	                }
	                //assign proper classes for when tabs mode is activated before making a selection in accordion mode
	                else {
	                        $($respTabs.find('.resp-tab-content')[tabNum]).addClass('resp-tab-content-active resp-accordion-closed');
	                    }

	                //Tab Click action function
	                $respTabs.find("[role=tab]").each(function () {

	                    var $currentTab = $(this);

	                    $currentTab.keypress(function (e) {
	                        if (e.keyCode == 13 || e.keyCode == 32) {
	                            $currentTab.click();
	                        }
	                    });

	                    $currentTab.click(function () {

	                        var $currentTab = $(this);
	                        var $tabAria = $currentTab.attr('aria-controls');

	                        if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-active')) {
	                            $respTabs.find('.resp-tab-content-active').slideUp('', function () {
	                                $(this).addClass('resp-accordion-closed');
	                            });
	                            $currentTab.removeClass('resp-tab-active');
	                            return false;
	                        }
	                        if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-accordion')) {
	                            $respTabs.find('.resp-tab-active').removeClass('resp-tab-active');
	                            $respTabs.find('.resp-tab-content-active').slideUp().removeClass('resp-tab-content-active resp-accordion-closed');
	                            $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active');

	                            $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + ']').slideDown().addClass('resp-tab-content-active');
	                        } else {
	                            $respTabs.find('.resp-tab-active').removeClass('resp-tab-active');
	                            $respTabs.find('.resp-tab-content-active').removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-accordion-closed');
	                            $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active');
	                            $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + ']').addClass('resp-tab-content-active').attr('style', 'display:block');
	                        }
	                        //Trigger tab activation event
	                        $currentTab.trigger('tabactivate', $currentTab);

	                        //Update Browser History
	                        if (historyApi) {
	                            var currentHash = window.location.hash;
	                            var newHash = respTabsId + (parseInt($tabAria.substring(9), 10) + 1).toString();
	                            if (currentHash != "") {
	                                var re = new RegExp(respTabsId + "[0-9]+");
	                                if (currentHash.match(re) != null) {
	                                    newHash = currentHash.replace(re, newHash);
	                                } else {
	                                    newHash = currentHash + "|" + newHash;
	                                }
	                            } else {
	                                newHash = '#' + newHash;
	                            }

	                            history.replaceState(null, null, newHash);
	                        }
	                    });
	                });

	                //Window resize function                  
	                $(window).resize(function () {
	                    $respTabs.find('.resp-accordion-closed').removeAttr('style');
	                });
	            });
	        }
	    });
		})(jQuery);
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))

/***/ },

/***/ 253:
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	// Keyboard navigation for the menu on large screens
	if (window.Modernizr && window.Foundation && Modernizr.mq(Foundation.media_queries.large)) {
	    // Load the smartmenus keyboard only when needed, keeping the main theme.checkout.js small
	    //require.ensure([], function(){
	    __webpack_require__(213);
	    //}, 'jquery.smartmenus_keyboard');
	}

	// Polyfill for equal height column grid
	if (window.Modernizr && !Modernizr.flexbox) {
	    // Load the smartmenus keyboard only when needed, keeping the main theme.checkout.js small
	    //require.ensure([], function(){
	    __webpack_require__(202);
	    //}, 'equal_height_columns');
	}

	// If on product page, load thumb connector script
	if (document.location.pathname.indexOf("/produkt/") === 0 && window.FEATURES.get('thumb_attribute_connection')) {
	    __webpack_require__.e/* nsure */(3, function () {
	        __webpack_require__(123);
	    });
	}

	// Load RCT tag tracking
	if (window.FEATURES.get('abandoncart_email')) {
	    __webpack_require__.e/* nsure */(1, function () {
	        __webpack_require__(474);
	    });
	}

	if (window.FEATURES.get('facebook_dpa')) {
	    __webpack_require__.e/* nsure */(2, function () {
	        __webpack_require__(473);
	    });
	}

	// Fastclick for touch screens
	/* Deactivated until we can prevent double click events from happening
	if(Modernizr.touch) {
	    require.ensure([], function(){
	        var FastClick = require('assets/fastclick');
	        jQuery(function() {
	             FastClick.attach(document.body);
	         });
	    }, 'fastclick');
	}
	//*/

/***/ }

});
//# sourceMappingURL=theme.js.map