');\r\n\t\t\t\t}\r\n\r\n\t\t\t\titem.inlineElement = el;\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\r\n\t\t\tmfp.updateStatus('ready');\r\n\t\t\tmfp._parseMarkup(template, {}, item);\r\n\t\t\treturn template;\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/*>>inline*/\r\n\r\n/*>>ajax*/\r\nvar AJAX_NS = 'ajax',\r\n\t_ajaxCur,\r\n\t_removeAjaxCursor = function() {\r\n\t\tif(_ajaxCur) {\r\n\t\t\t_body.removeClass(_ajaxCur);\r\n\t\t}\r\n\t},\r\n\t_destroyAjaxRequest = function() {\r\n\t\t_removeAjaxCursor();\r\n\t\tif(mfp.req) {\r\n\t\t\tmfp.req.abort();\r\n\t\t}\r\n\t};\r\n\r\n$.magnificPopup.registerModule(AJAX_NS, {\r\n\r\n\toptions: {\r\n\t\tsettings: null,\r\n\t\tcursor: 'mfp-ajax-cur',\r\n\t\ttError: '
The content could not be loaded.'\r\n\t},\r\n\r\n\tproto: {\r\n\t\tinitAjax: function() {\r\n\t\t\tmfp.types.push(AJAX_NS);\r\n\t\t\t_ajaxCur = mfp.st.ajax.cursor;\r\n\r\n\t\t\t_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);\r\n\t\t\t_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);\r\n\t\t},\r\n\t\tgetAjax: function(item) {\r\n\r\n\t\t\tif(_ajaxCur)\r\n\t\t\t\t_body.addClass(_ajaxCur);\r\n\r\n\t\t\tmfp.updateStatus('loading');\r\n\r\n\t\t\tvar opts = $.extend({\r\n\t\t\t\turl: item.src,\r\n\t\t\t\tsuccess: function(data, textStatus, jqXHR) {\r\n\t\t\t\t\tvar temp = {\r\n\t\t\t\t\t\tdata:data,\r\n\t\t\t\t\t\txhr:jqXHR\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\t_mfpTrigger('ParseAjax', temp);\r\n\r\n\t\t\t\t\tmfp.appendContent( $(temp.data), AJAX_NS );\r\n\r\n\t\t\t\t\titem.finished = true;\r\n\r\n\t\t\t\t\t_removeAjaxCursor();\r\n\r\n\t\t\t\t\t_setFocus();\r\n\r\n\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\tmfp.wrap.addClass(READY_CLASS);\r\n\t\t\t\t\t}, 16);\r\n\r\n\t\t\t\t\tmfp.updateStatus('ready');\r\n\r\n\t\t\t\t\t_mfpTrigger('AjaxContentAdded');\r\n\t\t\t\t},\r\n\t\t\t\terror: function() {\r\n\t\t\t\t\t_removeAjaxCursor();\r\n\t\t\t\t\titem.finished = item.loadError = true;\r\n\t\t\t\t\tmfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));\r\n\t\t\t\t}\r\n\t\t\t}, mfp.st.ajax.settings);\r\n\r\n\t\t\tmfp.req = $.ajax(opts);\r\n\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n/*>>ajax*/\r\n\r\n/*>>image*/\r\nvar _imgInterval,\r\n\t_getTitle = function(item) {\r\n\t\tif(item.data && item.data.title !== undefined) \r\n\t\t\treturn item.data.title;\r\n\r\n\t\tvar src = mfp.st.image.titleSrc;\r\n\r\n\t\tif(src) {\r\n\t\t\tif($.isFunction(src)) {\r\n\t\t\t\treturn src.call(mfp, item);\r\n\t\t\t} else if(item.el) {\r\n\t\t\t\treturn item.el.attr(src) || '';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn '';\r\n\t};\r\n\r\n$.magnificPopup.registerModule('image', {\r\n\r\n\toptions: {\r\n\t\tmarkup: '
',\r\n\t\tcursor: 'mfp-zoom-out-cur',\r\n\t\ttitleSrc: 'title', \r\n\t\tverticalFit: true,\r\n\t\ttError: '
The image could not be loaded.'\r\n\t},\r\n\r\n\tproto: {\r\n\t\tinitImage: function() {\r\n\t\t\tvar imgSt = mfp.st.image,\r\n\t\t\t\tns = '.image';\r\n\r\n\t\t\tmfp.types.push('image');\r\n\r\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\r\n\t\t\t\tif(mfp.currItem.type === 'image' && imgSt.cursor) {\r\n\t\t\t\t\t_body.addClass(imgSt.cursor);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\r\n\t\t\t\tif(imgSt.cursor) {\r\n\t\t\t\t\t_body.removeClass(imgSt.cursor);\r\n\t\t\t\t}\r\n\t\t\t\t_window.off('resize' + EVENT_NS);\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn('Resize'+ns, mfp.resizeImage);\r\n\t\t\tif(mfp.isLowIE) {\r\n\t\t\t\t_mfpOn('AfterChange', mfp.resizeImage);\r\n\t\t\t}\r\n\t\t},\r\n\t\tresizeImage: function() {\r\n\t\t\tvar item = mfp.currItem;\r\n\t\t\tif(!item || !item.img) return;\r\n\r\n\t\t\tif(mfp.st.image.verticalFit) {\r\n\t\t\t\tvar decr = 0;\r\n\t\t\t\t// fix box-sizing in ie7/8\r\n\t\t\t\tif(mfp.isLowIE) {\r\n\t\t\t\t\tdecr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);\r\n\t\t\t\t}\r\n\t\t\t\titem.img.css('max-height', mfp.wH-decr);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_onImageHasSize: function(item) {\r\n\t\t\tif(item.img) {\r\n\t\t\t\t\r\n\t\t\t\titem.hasSize = true;\r\n\r\n\t\t\t\tif(_imgInterval) {\r\n\t\t\t\t\tclearInterval(_imgInterval);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\titem.isCheckingImgSize = false;\r\n\r\n\t\t\t\t_mfpTrigger('ImageHasSize', item);\r\n\r\n\t\t\t\tif(item.imgHidden) {\r\n\t\t\t\t\tif(mfp.content)\r\n\t\t\t\t\t\tmfp.content.removeClass('mfp-loading');\r\n\t\t\t\t\t\r\n\t\t\t\t\titem.imgHidden = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Function that loops until the image has size to display elements that rely on it asap\r\n\t\t */\r\n\t\tfindImageSize: function(item) {\r\n\r\n\t\t\tvar counter = 0,\r\n\t\t\t\timg = item.img[0],\r\n\t\t\t\tmfpSetInterval = function(delay) {\r\n\r\n\t\t\t\t\tif(_imgInterval) {\r\n\t\t\t\t\t\tclearInterval(_imgInterval);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// decelerating interval that checks for size of an image\r\n\t\t\t\t\t_imgInterval = setInterval(function() {\r\n\t\t\t\t\t\tif(img.naturalWidth > 0) {\r\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(counter > 200) {\r\n\t\t\t\t\t\t\tclearInterval(_imgInterval);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t\tif(counter === 3) {\r\n\t\t\t\t\t\t\tmfpSetInterval(10);\r\n\t\t\t\t\t\t} else if(counter === 40) {\r\n\t\t\t\t\t\t\tmfpSetInterval(50);\r\n\t\t\t\t\t\t} else if(counter === 100) {\r\n\t\t\t\t\t\t\tmfpSetInterval(500);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, delay);\r\n\t\t\t\t};\r\n\r\n\t\t\tmfpSetInterval(1);\r\n\t\t},\r\n\r\n\t\tgetImage: function(item, template) {\r\n\r\n\t\t\tvar guard = 0,\r\n\r\n\t\t\t\t// image load complete handler\r\n\t\t\t\tonLoadComplete = function() {\r\n\t\t\t\t\tif(item) {\r\n\t\t\t\t\t\tif (item.img[0].complete) {\r\n\t\t\t\t\t\t\titem.img.off('.mfploader');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(item === mfp.currItem){\r\n\t\t\t\t\t\t\t\tmfp._onImageHasSize(item);\r\n\r\n\t\t\t\t\t\t\t\tmfp.updateStatus('ready');\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\titem.hasSize = true;\r\n\t\t\t\t\t\t\titem.loaded = true;\r\n\r\n\t\t\t\t\t\t\t_mfpTrigger('ImageLoadComplete');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// if image complete check fails 200 times (20 sec), we assume that there was an error.\r\n\t\t\t\t\t\t\tguard++;\r\n\t\t\t\t\t\t\tif(guard < 200) {\r\n\t\t\t\t\t\t\t\tsetTimeout(onLoadComplete,100);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tonLoadError();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// image error handler\r\n\t\t\t\tonLoadError = function() {\r\n\t\t\t\t\tif(item) {\r\n\t\t\t\t\t\titem.img.off('.mfploader');\r\n\t\t\t\t\t\tif(item === mfp.currItem){\r\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\r\n\t\t\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.hasSize = true;\r\n\t\t\t\t\t\titem.loaded = true;\r\n\t\t\t\t\t\titem.loadError = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\timgSt = mfp.st.image;\r\n\r\n\r\n\t\t\tvar el = template.find('.mfp-img');\r\n\t\t\tif(el.length) {\r\n\t\t\t\tvar img = document.createElement('img');\r\n\t\t\t\timg.className = 'mfp-img';\r\n\t\t\t\titem.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);\r\n\t\t\t\timg.src = item.src;\r\n\r\n\t\t\t\t// without clone() \"error\" event is not firing when IMG is replaced by new IMG\r\n\t\t\t\t// TODO: find a way to avoid such cloning\r\n\t\t\t\tif(el.is('img')) {\r\n\t\t\t\t\titem.img = item.img.clone();\r\n\t\t\t\t}\r\n\t\t\t\tif(item.img[0].naturalWidth > 0) {\r\n\t\t\t\t\titem.hasSize = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tmfp._parseMarkup(template, {\r\n\t\t\t\ttitle: _getTitle(item),\r\n\t\t\t\timg_replaceWith: item.img\r\n\t\t\t}, item);\r\n\r\n\t\t\tmfp.resizeImage();\r\n\r\n\t\t\tif(item.hasSize) {\r\n\t\t\t\tif(_imgInterval) clearInterval(_imgInterval);\r\n\r\n\t\t\t\tif(item.loadError) {\r\n\t\t\t\t\ttemplate.addClass('mfp-loading');\r\n\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttemplate.removeClass('mfp-loading');\r\n\t\t\t\t\tmfp.updateStatus('ready');\r\n\t\t\t\t}\r\n\t\t\t\treturn template;\r\n\t\t\t}\r\n\r\n\t\t\tmfp.updateStatus('loading');\r\n\t\t\titem.loading = true;\r\n\r\n\t\t\tif(!item.hasSize) {\r\n\t\t\t\titem.imgHidden = true;\r\n\t\t\t\ttemplate.addClass('mfp-loading');\r\n\t\t\t\tmfp.findImageSize(item);\r\n\t\t\t} \r\n\r\n\t\t\treturn template;\r\n\t\t}\r\n\t}\r\n});\r\n\r\n\r\n\r\n/*>>image*/\r\n\r\n/*>>zoom*/\r\nvar hasMozTransform,\r\n\tgetHasMozTransform = function() {\r\n\t\tif(hasMozTransform === undefined) {\r\n\t\t\thasMozTransform = document.createElement('p').style.MozTransform !== undefined;\r\n\t\t}\r\n\t\treturn hasMozTransform;\t\t\r\n\t};\r\n\r\n$.magnificPopup.registerModule('zoom', {\r\n\r\n\toptions: {\r\n\t\tenabled: false,\r\n\t\teasing: 'ease-in-out',\r\n\t\tduration: 300,\r\n\t\topener: function(element) {\r\n\t\t\treturn element.is('img') ? element : element.find('img');\r\n\t\t}\r\n\t},\r\n\r\n\tproto: {\r\n\r\n\t\tinitZoom: function() {\r\n\t\t\tvar zoomSt = mfp.st.zoom,\r\n\t\t\t\tns = '.zoom',\r\n\t\t\t\timage;\r\n\t\t\t\t\r\n\t\t\tif(!zoomSt.enabled || !mfp.supportsTransition) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar duration = zoomSt.duration,\r\n\t\t\t\tgetElToAnimate = function(image) {\r\n\t\t\t\t\tvar newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),\r\n\t\t\t\t\t\ttransition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,\r\n\t\t\t\t\t\tcssObj = {\r\n\t\t\t\t\t\t\tposition: 'fixed',\r\n\t\t\t\t\t\t\tzIndex: 9999,\r\n\t\t\t\t\t\t\tleft: 0,\r\n\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\t'-webkit-backface-visibility': 'hidden'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tt = 'transition';\r\n\r\n\t\t\t\t\tcssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;\r\n\r\n\t\t\t\t\tnewImg.css(cssObj);\r\n\t\t\t\t\treturn newImg;\r\n\t\t\t\t},\r\n\t\t\t\tshowMainContent = function() {\r\n\t\t\t\t\tmfp.content.css('visibility', 'visible');\r\n\t\t\t\t},\r\n\t\t\t\topenTimeout,\r\n\t\t\t\tanimatedImg;\r\n\r\n\t\t\t_mfpOn('BuildControls'+ns, function() {\r\n\t\t\t\tif(mfp._allowZoom()) {\r\n\r\n\t\t\t\t\tclearTimeout(openTimeout);\r\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\r\n\r\n\t\t\t\t\t// Basically, all code below does is clones existing image, puts in on top of the current one and animated it\r\n\t\t\t\t\t\r\n\t\t\t\t\timage = mfp._getItemToZoom();\r\n\r\n\t\t\t\t\tif(!image) {\r\n\t\t\t\t\t\tshowMainContent();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tanimatedImg = getElToAnimate(image); \r\n\t\t\t\t\t\r\n\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\r\n\r\n\t\t\t\t\tmfp.wrap.append(animatedImg);\r\n\r\n\t\t\t\t\topenTimeout = setTimeout(function() {\r\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset( true ) );\r\n\t\t\t\t\t\topenTimeout = setTimeout(function() {\r\n\r\n\t\t\t\t\t\t\tshowMainContent();\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\tanimatedImg.remove();\r\n\t\t\t\t\t\t\t\timage = animatedImg = null;\r\n\t\t\t\t\t\t\t\t_mfpTrigger('ZoomAnimationEnded');\r\n\t\t\t\t\t\t\t}, 16); // avoid blink when switching images \r\n\r\n\t\t\t\t\t\t}, duration); // this timeout equals animation duration\r\n\r\n\t\t\t\t\t}, 16); // by adding this timeout we avoid short glitch at the beginning of animation\r\n\r\n\r\n\t\t\t\t\t// Lots of timeouts...\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {\r\n\t\t\t\tif(mfp._allowZoom()) {\r\n\r\n\t\t\t\t\tclearTimeout(openTimeout);\r\n\r\n\t\t\t\t\tmfp.st.removalDelay = duration;\r\n\r\n\t\t\t\t\tif(!image) {\r\n\t\t\t\t\t\timage = mfp._getItemToZoom();\r\n\t\t\t\t\t\tif(!image) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tanimatedImg = getElToAnimate(image);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tanimatedImg.css( mfp._getOffset(true) );\r\n\t\t\t\t\tmfp.wrap.append(animatedImg);\r\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\r\n\t\t\t\t\t}, 16);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\r\n\t\t\t\tif(mfp._allowZoom()) {\r\n\t\t\t\t\tshowMainContent();\r\n\t\t\t\t\tif(animatedImg) {\r\n\t\t\t\t\t\tanimatedImg.remove();\r\n\t\t\t\t\t}\r\n\t\t\t\t\timage = null;\r\n\t\t\t\t}\t\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t_allowZoom: function() {\r\n\t\t\treturn mfp.currItem.type === 'image';\r\n\t\t},\r\n\r\n\t\t_getItemToZoom: function() {\r\n\t\t\tif(mfp.currItem.hasSize) {\r\n\t\t\t\treturn mfp.currItem.img;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Get element postion relative to viewport\r\n\t\t_getOffset: function(isLarge) {\r\n\t\t\tvar el;\r\n\t\t\tif(isLarge) {\r\n\t\t\t\tel = mfp.currItem.img;\r\n\t\t\t} else {\r\n\t\t\t\tel = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);\r\n\t\t\t}\r\n\r\n\t\t\tvar offset = el.offset();\r\n\t\t\tvar paddingTop = parseInt(el.css('padding-top'),10);\r\n\t\t\tvar paddingBottom = parseInt(el.css('padding-bottom'),10);\r\n\t\t\toffset.top -= ( $(window).scrollTop() - paddingTop );\r\n\r\n\r\n\t\t\t/*\r\n\t\t\t\r\n\t\t\tAnimating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.\r\n\r\n\t\t\t */\r\n\t\t\tvar obj = {\r\n\t\t\t\twidth: el.width(),\r\n\t\t\t\t// fix Zepto height+padding issue\r\n\t\t\t\theight: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop\r\n\t\t\t};\r\n\r\n\t\t\t// I hate to do this, but there is no another option\r\n\t\t\tif( getHasMozTransform() ) {\r\n\t\t\t\tobj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';\r\n\t\t\t} else {\r\n\t\t\t\tobj.left = offset.left;\r\n\t\t\t\tobj.top = offset.top;\r\n\t\t\t}\r\n\t\t\treturn obj;\r\n\t\t}\r\n\r\n\t}\r\n});\r\n\r\n\r\n\r\n/*>>zoom*/\r\n\r\n/*>>iframe*/\r\n\r\nvar IFRAME_NS = 'iframe',\r\n\t_emptyPage = '//about:blank',\r\n\t\r\n\t_fixIframeBugs = function(isShowing) {\r\n\t\tif(mfp.currTemplate[IFRAME_NS]) {\r\n\t\t\tvar el = mfp.currTemplate[IFRAME_NS].find('iframe');\r\n\t\t\tif(el.length) { \r\n\t\t\t\t// reset src after the popup is closed to avoid \"video keeps playing after popup is closed\" bug\r\n\t\t\t\tif(!isShowing) {\r\n\t\t\t\t\tel[0].src = _emptyPage;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// IE8 black screen bug fix\r\n\t\t\t\tif(mfp.isIE8) {\r\n\t\t\t\t\tel.css('display', isShowing ? 'block' : 'none');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n$.magnificPopup.registerModule(IFRAME_NS, {\r\n\r\n\toptions: {\r\n\t\tmarkup: '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
',\r\n\r\n\t\tsrcAction: 'iframe_src',\r\n\r\n\t\t// we don't care and support only one default type of URL by default\r\n\t\tpatterns: {\r\n\t\t\tyoutube: {\r\n\t\t\t\tindex: 'youtube.com', \r\n\t\t\t\tid: 'v=', \r\n\t\t\t\tsrc: '//www.youtube.com/embed/%id%?autoplay=1'\r\n\t\t\t},\r\n\t\t\tvimeo: {\r\n\t\t\t\tindex: 'vimeo.com/',\r\n\t\t\t\tid: '/',\r\n\t\t\t\tsrc: '//player.vimeo.com/video/%id%?autoplay=1'\r\n\t\t\t},\r\n\t\t\tgmaps: {\r\n\t\t\t\tindex: '//maps.google.',\r\n\t\t\t\tsrc: '%id%&output=embed'\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tproto: {\r\n\t\tinitIframe: function() {\r\n\t\t\tmfp.types.push(IFRAME_NS);\r\n\r\n\t\t\t_mfpOn('BeforeChange', function(e, prevType, newType) {\r\n\t\t\t\tif(prevType !== newType) {\r\n\t\t\t\t\tif(prevType === IFRAME_NS) {\r\n\t\t\t\t\t\t_fixIframeBugs(); // iframe if removed\r\n\t\t\t\t\t} else if(newType === IFRAME_NS) {\r\n\t\t\t\t\t\t_fixIframeBugs(true); // iframe is showing\r\n\t\t\t\t\t} \r\n\t\t\t\t}// else {\r\n\t\t\t\t\t// iframe source is switched, don't do anything\r\n\t\t\t\t//}\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {\r\n\t\t\t\t_fixIframeBugs();\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tgetIframe: function(item, template) {\r\n\t\t\tvar embedSrc = item.src;\r\n\t\t\tvar iframeSt = mfp.st.iframe;\r\n\t\t\t\t\r\n\t\t\t$.each(iframeSt.patterns, function() {\r\n\t\t\t\tif(embedSrc.indexOf( this.index ) > -1) {\r\n\t\t\t\t\tif(this.id) {\r\n\t\t\t\t\t\tif(typeof this.id === 'string') {\r\n\t\t\t\t\t\t\tembedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tembedSrc = this.id.call( this, embedSrc );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tembedSrc = this.src.replace('%id%', embedSrc );\r\n\t\t\t\t\treturn false; // break;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar dataObj = {};\r\n\t\t\tif(iframeSt.srcAction) {\r\n\t\t\t\tdataObj[iframeSt.srcAction] = embedSrc;\r\n\t\t\t}\r\n\t\t\tmfp._parseMarkup(template, dataObj, item);\r\n\r\n\t\t\tmfp.updateStatus('ready');\r\n\r\n\t\t\treturn template;\r\n\t\t}\r\n\t}\r\n});\r\n\r\n\r\n\r\n/*>>iframe*/\r\n\r\n/*>>gallery*/\r\n/**\r\n * Get looped index depending on number of slides\r\n */\r\nvar _getLoopedId = function(index) {\r\n\t\tvar numSlides = mfp.items.length;\r\n\t\tif(index > numSlides - 1) {\r\n\t\t\treturn index - numSlides;\r\n\t\t} else if(index < 0) {\r\n\t\t\treturn numSlides + index;\r\n\t\t}\r\n\t\treturn index;\r\n\t},\r\n\t_replaceCurrTotal = function(text, curr, total) {\r\n\t\treturn text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);\r\n\t};\r\n\r\n$.magnificPopup.registerModule('gallery', {\r\n\r\n\toptions: {\r\n\t\tenabled: false,\r\n\t\tarrowMarkup: '
',\r\n\t\tpreload: [0,2],\r\n\t\tnavigateByImgClick: true,\r\n\t\tarrows: true,\r\n\r\n\t\ttPrev: 'Previous (Left arrow key)',\r\n\t\ttNext: 'Next (Right arrow key)',\r\n\t\ttCounter: '%curr% of %total%'\r\n\t},\r\n\r\n\tproto: {\r\n\t\tinitGallery: function() {\r\n\r\n\t\t\tvar gSt = mfp.st.gallery,\r\n\t\t\t\tns = '.mfp-gallery',\r\n\t\t\t\tsupportsFastClick = Boolean($.fn.mfpFastClick);\r\n\r\n\t\t\tmfp.direction = true; // true - next, false - prev\r\n\t\t\t\r\n\t\t\tif(!gSt || !gSt.enabled ) return false;\r\n\r\n\t\t\t_wrapClasses += ' mfp-gallery';\r\n\r\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\r\n\r\n\t\t\t\tif(gSt.navigateByImgClick) {\r\n\t\t\t\t\tmfp.wrap.on('click'+ns, '.mfp-img', function() {\r\n\t\t\t\t\t\tif(mfp.items.length > 1) {\r\n\t\t\t\t\t\t\tmfp.next();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t_document.on('keydown'+ns, function(e) {\r\n\t\t\t\t\tif (e.keyCode === 37) {\r\n\t\t\t\t\t\tmfp.prev();\r\n\t\t\t\t\t} else if (e.keyCode === 39) {\r\n\t\t\t\t\t\tmfp.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn('UpdateStatus'+ns, function(e, data) {\r\n\t\t\t\tif(data.text) {\r\n\t\t\t\t\tdata.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {\r\n\t\t\t\tvar l = mfp.items.length;\r\n\t\t\t\tvalues.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn('BuildControls' + ns, function() {\r\n\t\t\t\tif(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {\r\n\t\t\t\t\tvar markup = gSt.arrowMarkup,\r\n\t\t\t\t\t\tarrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),\t\t\t\r\n\t\t\t\t\t\tarrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);\r\n\r\n\t\t\t\t\tvar eName = supportsFastClick ? 'mfpFastClick' : 'click';\r\n\t\t\t\t\tarrowLeft[eName](function() {\r\n\t\t\t\t\t\tmfp.prev();\r\n\t\t\t\t\t});\t\t\t\r\n\t\t\t\t\tarrowRight[eName](function() {\r\n\t\t\t\t\t\tmfp.next();\r\n\t\t\t\t\t});\t\r\n\r\n\t\t\t\t\t// Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)\r\n\t\t\t\t\tif(mfp.isIE7) {\r\n\t\t\t\t\t\t_getEl('b', arrowLeft[0], false, true);\r\n\t\t\t\t\t\t_getEl('a', arrowLeft[0], false, true);\r\n\t\t\t\t\t\t_getEl('b', arrowRight[0], false, true);\r\n\t\t\t\t\t\t_getEl('a', arrowRight[0], false, true);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tmfp.container.append(arrowLeft.add(arrowRight));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t_mfpOn(CHANGE_EVENT+ns, function() {\r\n\t\t\t\tif(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);\r\n\r\n\t\t\t\tmfp._preloadTimeout = setTimeout(function() {\r\n\t\t\t\t\tmfp.preloadNearbyImages();\r\n\t\t\t\t\tmfp._preloadTimeout = null;\r\n\t\t\t\t}, 16);\t\t\r\n\t\t\t});\r\n\r\n\r\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\r\n\t\t\t\t_document.off(ns);\r\n\t\t\t\tmfp.wrap.off('click'+ns);\r\n\t\t\t\r\n\t\t\t\tif(mfp.arrowLeft && supportsFastClick) {\r\n\t\t\t\t\tmfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();\r\n\t\t\t\t}\r\n\t\t\t\tmfp.arrowRight = mfp.arrowLeft = null;\r\n\t\t\t});\r\n\r\n\t\t}, \r\n\t\tnext: function() {\r\n\t\t\tmfp.direction = true;\r\n\t\t\tmfp.index = _getLoopedId(mfp.index + 1);\r\n\t\t\tmfp.updateItemHTML();\r\n\t\t},\r\n\t\tprev: function() {\r\n\t\t\tmfp.direction = false;\r\n\t\t\tmfp.index = _getLoopedId(mfp.index - 1);\r\n\t\t\tmfp.updateItemHTML();\r\n\t\t},\r\n\t\tgoTo: function(newIndex) {\r\n\t\t\tmfp.direction = (newIndex >= mfp.index);\r\n\t\t\tmfp.index = newIndex;\r\n\t\t\tmfp.updateItemHTML();\r\n\t\t},\r\n\t\tpreloadNearbyImages: function() {\r\n\t\t\tvar p = mfp.st.gallery.preload,\r\n\t\t\t\tpreloadBefore = Math.min(p[0], mfp.items.length),\r\n\t\t\t\tpreloadAfter = Math.min(p[1], mfp.items.length),\r\n\t\t\t\ti;\r\n\r\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {\r\n\t\t\t\tmfp._preloadItem(mfp.index+i);\r\n\t\t\t}\r\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {\r\n\t\t\t\tmfp._preloadItem(mfp.index-i);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_preloadItem: function(index) {\r\n\t\t\tindex = _getLoopedId(index);\r\n\r\n\t\t\tif(mfp.items[index].preloaded) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar item = mfp.items[index];\r\n\t\t\tif(!item.parsed) {\r\n\t\t\t\titem = mfp.parseEl( index );\r\n\t\t\t}\r\n\r\n\t\t\t_mfpTrigger('LazyLoad', item);\r\n\r\n\t\t\tif(item.type === 'image') {\r\n\t\t\t\titem.img = $('
![]()
').on('load.mfploader', function() {\r\n\t\t\t\t\titem.hasSize = true;\r\n\t\t\t\t}).on('error.mfploader', function() {\r\n\t\t\t\t\titem.hasSize = true;\r\n\t\t\t\t\titem.loadError = true;\r\n\t\t\t\t\t_mfpTrigger('LazyLoadError', item);\r\n\t\t\t\t}).attr('src', item.src);\r\n\t\t\t}\r\n\r\n\r\n\t\t\titem.preloaded = true;\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/*\r\nTouch Support that might be implemented some day\r\n\r\naddSwipeGesture: function() {\r\n\tvar startX,\r\n\t\tmoved,\r\n\t\tmultipleTouches;\r\n\r\n\t\treturn;\r\n\r\n\tvar namespace = '.mfp',\r\n\t\taddEventNames = function(pref, down, move, up, cancel) {\r\n\t\t\tmfp._tStart = pref + down + namespace;\r\n\t\t\tmfp._tMove = pref + move + namespace;\r\n\t\t\tmfp._tEnd = pref + up + namespace;\r\n\t\t\tmfp._tCancel = pref + cancel + namespace;\r\n\t\t};\r\n\r\n\tif(window.navigator.msPointerEnabled) {\r\n\t\taddEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');\r\n\t} else if('ontouchstart' in window) {\r\n\t\taddEventNames('touch', 'start', 'move', 'end', 'cancel');\r\n\t} else {\r\n\t\treturn;\r\n\t}\r\n\t_window.on(mfp._tStart, function(e) {\r\n\t\tvar oE = e.originalEvent;\r\n\t\tmultipleTouches = moved = false;\r\n\t\tstartX = oE.pageX || oE.changedTouches[0].pageX;\r\n\t}).on(mfp._tMove, function(e) {\r\n\t\tif(e.originalEvent.touches.length > 1) {\r\n\t\t\tmultipleTouches = e.originalEvent.touches.length;\r\n\t\t} else {\r\n\t\t\t//e.preventDefault();\r\n\t\t\tmoved = true;\r\n\t\t}\r\n\t}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {\r\n\t\tif(moved && !multipleTouches) {\r\n\t\t\tvar oE = e.originalEvent,\r\n\t\t\t\tdiff = startX - (oE.pageX || oE.changedTouches[0].pageX);\r\n\r\n\t\t\tif(diff > 20) {\r\n\t\t\t\tmfp.next();\r\n\t\t\t} else if(diff < -20) {\r\n\t\t\t\tmfp.prev();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n},\r\n*/\r\n\r\n\r\n/*>>gallery*/\r\n\r\n/*>>retina*/\r\n\r\nvar RETINA_NS = 'retina';\r\n\r\n$.magnificPopup.registerModule(RETINA_NS, {\r\n\toptions: {\r\n\t\treplaceSrc: function(item) {\r\n\t\t\treturn item.src.replace(/\\.\\w+$/, function(m) { return '@2x' + m; });\r\n\t\t},\r\n\t\tratio: 1 // Function or number. Set to 1 to disable.\r\n\t},\r\n\tproto: {\r\n\t\tinitRetina: function() {\r\n\t\t\tif(window.devicePixelRatio > 1) {\r\n\r\n\t\t\t\tvar st = mfp.st.retina,\r\n\t\t\t\t\tratio = st.ratio;\r\n\r\n\t\t\t\tratio = !isNaN(ratio) ? ratio : ratio();\r\n\r\n\t\t\t\tif(ratio > 1) {\r\n\t\t\t\t\t_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {\r\n\t\t\t\t\t\titem.img.css({\r\n\t\t\t\t\t\t\t'max-width': item.img[0].naturalWidth / ratio,\r\n\t\t\t\t\t\t\t'width': '100%'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {\r\n\t\t\t\t\t\titem.src = st.replaceSrc(item, ratio);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/*>>retina*/\r\n\r\n/*>>fastclick*/\r\n/**\r\n * FastClick event implementation. (removes 300ms delay on touch devices)\r\n * Based on https://developers.google.com/mobile/articles/fast_buttons\r\n *\r\n * You may use it outside the Magnific Popup by calling just:\r\n *\r\n * $('.your-el').mfpFastClick(function() {\r\n * console.log('Clicked!');\r\n * });\r\n *\r\n * To unbind:\r\n * $('.your-el').destroyMfpFastClick();\r\n * \r\n * \r\n * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.\r\n * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick\r\n * \r\n */\r\n\r\n(function() {\r\n\tvar ghostClickDelay = 1000,\r\n\t\tsupportsTouch = 'ontouchstart' in window,\r\n\t\tunbindTouchMove = function() {\r\n\t\t\t_window.off('touchmove'+ns+' touchend'+ns);\r\n\t\t},\r\n\t\teName = 'mfpFastClick',\r\n\t\tns = '.'+eName;\r\n\r\n\r\n\t// As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way\r\n\t$.fn.mfpFastClick = function(callback) {\r\n\r\n\t\treturn $(this).each(function() {\r\n\r\n\t\t\tvar elem = $(this),\r\n\t\t\t\tlock;\r\n\r\n\t\t\tif( supportsTouch ) {\r\n\r\n\t\t\t\tvar timeout,\r\n\t\t\t\t\tstartX,\r\n\t\t\t\t\tstartY,\r\n\t\t\t\t\tpointerMoved,\r\n\t\t\t\t\tpoint,\r\n\t\t\t\t\tnumPointers;\r\n\r\n\t\t\t\telem.on('touchstart' + ns, function(e) {\r\n\t\t\t\t\tpointerMoved = false;\r\n\t\t\t\t\tnumPointers = 1;\r\n\r\n\t\t\t\t\tpoint = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];\r\n\t\t\t\t\tstartX = point.clientX;\r\n\t\t\t\t\tstartY = point.clientY;\r\n\r\n\t\t\t\t\t_window.on('touchmove'+ns, function(e) {\r\n\t\t\t\t\t\tpoint = e.originalEvent ? e.originalEvent.touches : e.touches;\r\n\t\t\t\t\t\tnumPointers = point.length;\r\n\t\t\t\t\t\tpoint = point[0];\r\n\t\t\t\t\t\tif (Math.abs(point.clientX - startX) > 10 ||\r\n\t\t\t\t\t\t\tMath.abs(point.clientY - startY) > 10) {\r\n\t\t\t\t\t\t\tpointerMoved = true;\r\n\t\t\t\t\t\t\tunbindTouchMove();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).on('touchend'+ns, function(e) {\r\n\t\t\t\t\t\tunbindTouchMove();\r\n\t\t\t\t\t\tif(pointerMoved || numPointers > 1) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlock = true;\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tclearTimeout(timeout);\r\n\t\t\t\t\t\ttimeout = setTimeout(function() {\r\n\t\t\t\t\t\t\tlock = false;\r\n\t\t\t\t\t\t}, ghostClickDelay);\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\r\n\t\t\telem.on('click' + ns, function() {\r\n\t\t\t\tif(!lock) {\r\n\t\t\t\t\tcallback();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\t$.fn.destroyMfpFastClick = function() {\r\n\t\t$(this).off('touchstart' + ns + ' click' + ns);\r\n\t\tif(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);\r\n\t};\r\n})();\r\n\r\n/*>>fastclick*/\r\n})(window.jQuery || window.Zepto);","/**\r\n* jquery-match-height 0.7.0 by @liabru\r\n* http://brm.io/jquery-match-height/\r\n* License: MIT\r\n*/\r\n\r\n;(function(factory) { // eslint-disable-line no-extra-semi\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(['jquery'], factory);\r\n } else if (typeof module !== 'undefined' && module.exports) {\r\n // CommonJS\r\n module.exports = factory(require('jquery'));\r\n } else {\r\n // Global\r\n factory(jQuery);\r\n }\r\n})(function($) {\r\n /*\r\n * internal\r\n */\r\n\r\n var _previousResizeWidth = -1,\r\n _updateTimeout = -1;\r\n\r\n /*\r\n * _parse\r\n * value parse utility function\r\n */\r\n\r\n var _parse = function(value) {\r\n // parse value and convert NaN to 0\r\n return parseFloat(value) || 0;\r\n };\r\n\r\n /*\r\n * _rows\r\n * utility function returns array of jQuery selections representing each row\r\n * (as displayed after float wrapping applied by browser)\r\n */\r\n\r\n var _rows = function(elements) {\r\n var tolerance = 1,\r\n $elements = $(elements),\r\n lastTop = null,\r\n rows = [];\r\n\r\n // group elements by their top position\r\n $elements.each(function(){\r\n var $that = $(this),\r\n top = $that.offset().top - _parse($that.css('margin-top')),\r\n lastRow = rows.length > 0 ? rows[rows.length - 1] : null;\r\n\r\n if (lastRow === null) {\r\n // first item on the row, so just push it\r\n rows.push($that);\r\n } else {\r\n // if the row top is the same, add to the row group\r\n if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {\r\n rows[rows.length - 1] = lastRow.add($that);\r\n } else {\r\n // otherwise start a new row group\r\n rows.push($that);\r\n }\r\n }\r\n\r\n // keep track of the last row top\r\n lastTop = top;\r\n });\r\n\r\n return rows;\r\n };\r\n\r\n /*\r\n * _parseOptions\r\n * handle plugin options\r\n */\r\n\r\n var _parseOptions = function(options) {\r\n var opts = {\r\n byRow: true,\r\n property: 'height',\r\n target: null,\r\n remove: false\r\n };\r\n\r\n if (typeof options === 'object') {\r\n return $.extend(opts, options);\r\n }\r\n\r\n if (typeof options === 'boolean') {\r\n opts.byRow = options;\r\n } else if (options === 'remove') {\r\n opts.remove = true;\r\n }\r\n\r\n return opts;\r\n };\r\n\r\n /*\r\n * matchHeight\r\n * plugin definition\r\n */\r\n\r\n var matchHeight = $.fn.matchHeight = function(options) {\r\n var opts = _parseOptions(options);\r\n\r\n // handle remove\r\n if (opts.remove) {\r\n var that = this;\r\n\r\n // remove fixed height from all selected elements\r\n this.css(opts.property, '');\r\n\r\n // remove selected elements from all groups\r\n $.each(matchHeight._groups, function(key, group) {\r\n group.elements = group.elements.not(that);\r\n });\r\n\r\n // TODO: cleanup empty groups\r\n\r\n return this;\r\n }\r\n\r\n if (this.length <= 1 && !opts.target) {\r\n return this;\r\n }\r\n\r\n // keep track of this group so we can re-apply later on load and resize events\r\n matchHeight._groups.push({\r\n elements: this,\r\n options: opts\r\n });\r\n\r\n // match each element's height to the tallest element in the selection\r\n matchHeight._apply(this, opts);\r\n\r\n return this;\r\n };\r\n\r\n /*\r\n * plugin global options\r\n */\r\n\r\n matchHeight.version = '0.7.0';\r\n matchHeight._groups = [];\r\n matchHeight._throttle = 80;\r\n matchHeight._maintainScroll = false;\r\n matchHeight._beforeUpdate = null;\r\n matchHeight._afterUpdate = null;\r\n matchHeight._rows = _rows;\r\n matchHeight._parse = _parse;\r\n matchHeight._parseOptions = _parseOptions;\r\n\r\n /*\r\n * matchHeight._apply\r\n * apply matchHeight to given elements\r\n */\r\n\r\n matchHeight._apply = function(elements, options) {\r\n var opts = _parseOptions(options),\r\n $elements = $(elements),\r\n rows = [$elements];\r\n\r\n // take note of scroll position\r\n var scrollTop = $(window).scrollTop(),\r\n htmlHeight = $('html').outerHeight(true);\r\n\r\n // get hidden parents\r\n var $hiddenParents = $elements.parents().filter(':hidden');\r\n\r\n // cache the original inline style\r\n $hiddenParents.each(function() {\r\n var $that = $(this);\r\n $that.data('style-cache', $that.attr('style'));\r\n });\r\n\r\n // temporarily must force hidden parents visible\r\n $hiddenParents.css('display', 'block');\r\n\r\n // get rows if using byRow, otherwise assume one row\r\n if (opts.byRow && !opts.target) {\r\n\r\n // must first force an arbitrary equal height so floating elements break evenly\r\n $elements.each(function() {\r\n var $that = $(this),\r\n display = $that.css('display');\r\n\r\n // temporarily force a usable display value\r\n if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {\r\n display = 'block';\r\n }\r\n\r\n // cache the original inline style\r\n $that.data('style-cache', $that.attr('style'));\r\n\r\n $that.css({\r\n 'display': display,\r\n 'padding-top': '0',\r\n 'padding-bottom': '0',\r\n 'margin-top': '0',\r\n 'margin-bottom': '0',\r\n 'border-top-width': '0',\r\n 'border-bottom-width': '0',\r\n 'height': '100px',\r\n 'overflow': 'hidden'\r\n });\r\n });\r\n\r\n // get the array of rows (based on element top position)\r\n rows = _rows($elements);\r\n\r\n // revert original inline styles\r\n $elements.each(function() {\r\n var $that = $(this);\r\n $that.attr('style', $that.data('style-cache') || '');\r\n });\r\n }\r\n\r\n $.each(rows, function(key, row) {\r\n var $row = $(row),\r\n targetHeight = 0;\r\n\r\n if (!opts.target) {\r\n // skip apply to rows with only one item\r\n if (opts.byRow && $row.length <= 1) {\r\n $row.css(opts.property, '');\r\n return;\r\n }\r\n\r\n // iterate the row and find the max height\r\n $row.each(function(){\r\n var $that = $(this),\r\n style = $that.attr('style'),\r\n display = $that.css('display');\r\n\r\n // temporarily force a usable display value\r\n if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {\r\n display = 'block';\r\n }\r\n\r\n // ensure we get the correct actual height (and not a previously set height value)\r\n var css = { 'display': display };\r\n css[opts.property] = '';\r\n $that.css(css);\r\n\r\n // find the max height (including padding, but not margin)\r\n if ($that.outerHeight(false) > targetHeight) {\r\n targetHeight = $that.outerHeight(false);\r\n }\r\n\r\n // revert styles\r\n if (style) {\r\n $that.attr('style', style);\r\n } else {\r\n $that.css('display', '');\r\n }\r\n });\r\n } else {\r\n // if target set, use the height of the target element\r\n targetHeight = opts.target.outerHeight(false);\r\n }\r\n\r\n // iterate the row and apply the height to all elements\r\n $row.each(function(){\r\n var $that = $(this),\r\n verticalPadding = 0;\r\n\r\n // don't apply to a target\r\n if (opts.target && $that.is(opts.target)) {\r\n return;\r\n }\r\n\r\n // handle padding and border correctly (required when not using border-box)\r\n if ($that.css('box-sizing') !== 'border-box') {\r\n verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));\r\n verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));\r\n }\r\n\r\n // set the height (accounting for padding and border)\r\n $that.css(opts.property, (targetHeight - verticalPadding) + 'px');\r\n });\r\n });\r\n\r\n // revert hidden parents\r\n $hiddenParents.each(function() {\r\n var $that = $(this);\r\n $that.attr('style', $that.data('style-cache') || null);\r\n });\r\n\r\n // restore scroll position if enabled\r\n if (matchHeight._maintainScroll) {\r\n $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /*\r\n * matchHeight._applyDataApi\r\n * applies matchHeight to all elements with a data-match-height attribute\r\n */\r\n\r\n matchHeight._applyDataApi = function() {\r\n var groups = {};\r\n\r\n // generate groups by their groupId set by elements using data-match-height\r\n $('[data-match-height], [data-mh]').each(function() {\r\n var $this = $(this),\r\n groupId = $this.attr('data-mh') || $this.attr('data-match-height');\r\n\r\n if (groupId in groups) {\r\n groups[groupId] = groups[groupId].add($this);\r\n } else {\r\n groups[groupId] = $this;\r\n }\r\n });\r\n\r\n // apply matchHeight to each group\r\n $.each(groups, function() {\r\n this.matchHeight(true);\r\n });\r\n };\r\n\r\n /*\r\n * matchHeight._update\r\n * updates matchHeight on all current groups with their correct options\r\n */\r\n\r\n var _update = function(event) {\r\n if (matchHeight._beforeUpdate) {\r\n matchHeight._beforeUpdate(event, matchHeight._groups);\r\n }\r\n\r\n $.each(matchHeight._groups, function() {\r\n matchHeight._apply(this.elements, this.options);\r\n });\r\n\r\n if (matchHeight._afterUpdate) {\r\n matchHeight._afterUpdate(event, matchHeight._groups);\r\n }\r\n };\r\n\r\n matchHeight._update = function(throttle, event) {\r\n // prevent update if fired from a resize event\r\n // where the viewport width hasn't actually changed\r\n // fixes an event looping bug in IE8\r\n if (event && event.type === 'resize') {\r\n var windowWidth = $(window).width();\r\n if (windowWidth === _previousResizeWidth) {\r\n return;\r\n }\r\n _previousResizeWidth = windowWidth;\r\n }\r\n\r\n // throttle updates\r\n if (!throttle) {\r\n _update(event);\r\n } else if (_updateTimeout === -1) {\r\n _updateTimeout = setTimeout(function() {\r\n _update(event);\r\n _updateTimeout = -1;\r\n }, matchHeight._throttle);\r\n }\r\n };\r\n\r\n /*\r\n * bind events\r\n */\r\n\r\n // apply on DOM ready event\r\n $(matchHeight._applyDataApi);\r\n\r\n // update heights on load and resize events\r\n $(window).bind('load', function(event) {\r\n matchHeight._update(false, event);\r\n });\r\n\r\n // throttled update heights on resize events\r\n $(window).bind('resize orientationchange', function(event) {\r\n matchHeight._update(true, event);\r\n });\r\n\r\n});\r\n","/*\r\n * Copyright (C) 2012 PrimeBox (info@primebox.co.uk)\r\n * \r\n * This work is licensed under the Creative Commons\r\n * Attribution 3.0 Unported License. To view a copy\r\n * of this license, visit\r\n * http://creativecommons.org/licenses/by/3.0/.\r\n * \r\n * Documentation available at:\r\n * http://www.primebox.co.uk/projects/cookie-bar/\r\n * \r\n * When using this software you use it at your own risk. We hold\r\n * no responsibility for any damage caused by using this plugin\r\n * or the documentation provided.\r\n */\r\n(function($){\r\n\t$.cookieBar = function(options,val){\r\n\t\tif(options=='cookies'){\r\n\t\t\tvar doReturn = 'cookies';\r\n\t\t}else if(options=='set'){\r\n\t\t\tvar doReturn = 'set';\r\n\t\t}else{\r\n\t\t\tvar doReturn = false;\r\n\t\t}\r\n\t\tvar defaults = {\r\n\t\t\tmessage: 'We use cookies to track usage and preferences.', //Message displayed on bar\r\n\t\t\tacceptButton: true, //Set to true to show accept/enable button\r\n\t\t\tacceptText: 'I Understand', //Text on accept/enable button\r\n\t\t\tacceptFunction: function(cookieValue){if(cookieValue!='enabled' && cookieValue!='accepted') window.location = window.location.href;}, //Function to run after accept\r\n\t\t\tdeclineButton: false, //Set to true to show decline/disable button\r\n\t\t\tdeclineText: 'Disable Cookies', //Text on decline/disable button\r\n\t\t\tdeclineFunction: function(cookieValue){if(cookieValue=='enabled' || cookieValue=='accepted') window.location = window.location.href;}, //Function to run after decline\r\n\t\t\tpolicyButton: false, //Set to true to show Privacy Policy button\r\n\t\t\tpolicyText: 'Privacy Policy', //Text on Privacy Policy button\r\n\t\t\tpolicyURL: '/privacy-policy/', //URL of Privacy Policy\r\n\t\t\tautoEnable: true, //Set to true for cookies to be accepted automatically. Banner still shows\r\n\t\t\tacceptOnContinue: false, //Set to true to accept cookies when visitor moves to another page\r\n\t\t\tacceptOnScroll: false, //Set to true to accept cookies when visitor scrolls X pixels up or down\r\n\t\t\tacceptAnyClick: false, //Set to true to accept cookies when visitor clicks anywhere on the page\r\n\t\t\texpireDays: 365, //Number of days for cookieBar cookie to be stored for\r\n\t\t\trenewOnVisit: false, //Renew the cookie upon revisit to website\r\n\t\t\tforceShow: false, //Force cookieBar to show regardless of user cookie preference\r\n\t\t\teffect: 'slide', //Options: slide, fade, hide\r\n\t\t\telement: 'body', //Element to append/prepend cookieBar to. Remember \".\" for class or \"#\" for id.\r\n\t\t\tappend: false, //Set to true for cookieBar HTML to be placed at base of website. Actual position may change according to CSS\r\n\t\t\tfixed: false, //Set to true to add the class \"fixed\" to the cookie bar. Default CSS should fix the position\r\n\t\t\tbottom: false, //Force CSS when fixed, so bar appears at bottom of website\r\n\t\t\tzindex: '', //Can be set in CSS, although some may prefer to set here\r\n\t\t\tdomain: String(window.location.hostname), //Location of privacy policy\r\n\t\t\treferrer: String(document.referrer) //Where visitor has come from\r\n\t\t};\r\n\t\tvar options = $.extend(defaults,options);\r\n\t\t\r\n\t\t//Sets expiration date for cookie\r\n\t\tvar expireDate = new Date();\r\n\t\texpireDate.setTime(expireDate.getTime()+(options.expireDays*86400000));\r\n\t\texpireDate = expireDate.toGMTString();\r\n\t\t\r\n\t\tvar cookieEntry = 'cb-enabled={value}; expires='+expireDate+'; path=/';\r\n\t\t\r\n\t\t//Retrieves current cookie preference\r\n\t\tvar i,cookieValue='',aCookie,aCookies=document.cookie.split('; ');\r\n\t\tfor (i=0;i
=0 && String(window.location.href).indexOf(options.policyURL)==-1 && doReturn!='cookies' && doReturn!='set' && cookieValue!='accepted' && cookieValue!='declined'){\r\n\t\t\t\tdoReturn = 'set';\r\n\t\t\t\tval = 'accepted';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(doReturn=='cookies'){\r\n\t\t\t//Returns true if cookies are enabled, false otherwise\r\n\t\t\tif(cookieValue=='enabled' || cookieValue=='accepted'){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(doReturn=='set' && (val=='accepted' || val=='declined')){\r\n\t\t\t//Sets value of cookie to 'accepted' or 'declined'\r\n\t\t\tdocument.cookie = cookieEntry.replace('{value}',val);\r\n\t\t\tif(val=='accepted'){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//Sets up enable/accept button if required\r\n\t\t\tvar message = options.message.replace('{policy_url}',options.policyURL);\r\n\t\t\t\r\n\t\t\tif(options.acceptButton){\r\n\t\t\t\tvar acceptButton = ''+options.acceptText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar acceptButton = '';\r\n\t\t\t}\r\n\t\t\t//Sets up disable/decline button if required\r\n\t\t\tif(options.declineButton){\r\n\t\t\t\tvar declineButton = ''+options.declineText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar declineButton = '';\r\n\t\t\t}\r\n\t\t\t//Sets up privacy policy button if required\r\n\t\t\tif(options.policyButton){\r\n\t\t\t\tvar policyButton = ''+options.policyText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar policyButton = '';\r\n\t\t\t}\r\n\t\t\t//Whether to add \"fixed\" class to cookie bar\r\n\t\t\tif(options.fixed){\r\n\t\t\t\tif(options.bottom){\r\n\t\t\t\t\tvar fixed = ' class=\"fixed bottom\"';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar fixed = ' class=\"fixed\"';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvar fixed = '';\r\n\t\t\t}\r\n\t\t\tif(options.zindex!=''){\r\n\t\t\t\tvar zindex = ' style=\"z-index:'+options.zindex+';\"';\r\n\t\t\t}else{\r\n\t\t\t\tvar zindex = '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Displays the cookie bar if arguments met\r\n\t\t\tif(options.forceShow || cookieValue=='enabled' || cookieValue==''){\r\n\t\t\t\tif(options.append){\r\n\t\t\t\t\t$(options.element).append(''+message+acceptButton+declineButton+policyButton+'
');\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(options.element).prepend(''+message+acceptButton+declineButton+policyButton+'
');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar removeBar = function(func){\r\n\t\t\t\tif(options.acceptOnScroll) $(document).off('scroll');\r\n\t\t\t\tif(typeof(func)==='function') func(cookieValue);\r\n\t\t\t\tif(options.effect=='slide'){\r\n\t\t\t\t\t$('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}else if(options.effect=='fade'){\r\n\t\t\t\t\t$('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}\r\n\t\t\t\t$(document).unbind('click',anyClick);\r\n\t\t\t};\r\n\t\t\tvar cookieAccept = function(){\r\n\t\t\t\tdocument.cookie = cookieEntry.replace('{value}','accepted');\r\n\t\t\t\tremoveBar(options.acceptFunction);\r\n\t\t\t};\r\n\t\t\tvar cookieDecline = function(){\r\n\t\t\t\tvar deleteDate = new Date();\r\n\t\t\t\tdeleteDate.setTime(deleteDate.getTime()-(864000000));\r\n\t\t\t\tdeleteDate = deleteDate.toGMTString();\r\n\t\t\t\taCookies=document.cookie.split('; ');\r\n\t\t\t\tfor (i=0;i=0){\r\n\t\t\t\t\t\tdocument.cookie = aCookie[0]+'=0; expires='+deleteDate+'; domain='+options.domain.replace('www','')+'; path=/';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdocument.cookie = aCookie[0]+'=0; expires='+deleteDate+'; path=/';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdocument.cookie = cookieEntry.replace('{value}','declined');\r\n\t\t\t\tremoveBar(options.declineFunction);\r\n\t\t\t};\r\n\t\t\tvar anyClick = function(e){\r\n\t\t\t\tif(!$(e.target).hasClass('cb-policy')) cookieAccept();\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t$('#cookie-bar .cb-enable').click(function(){cookieAccept();return false;});\r\n\t\t\t$('#cookie-bar .cb-disable').click(function(){cookieDecline();return false;});\r\n\t\t\tif(options.acceptOnScroll){\r\n\t\t\t\tvar scrollStart = $(document).scrollTop(),scrollNew,scrollDiff;\r\n\t\t\t\t$(document).on('scroll',function(){\r\n\t\t\t\t\tscrollNew = $(document).scrollTop();\r\n\t\t\t\t\tif(scrollNew>scrollStart){\r\n\t\t\t\t\t\tscrollDiff = scrollNew - scrollStart;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tscrollDiff = scrollStart - scrollNew;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(scrollDiff>=Math.round(options.acceptOnScroll)) cookieAccept();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif(options.acceptAnyClick){\r\n\t\t\t\t$(document).bind('click',anyClick);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n})(jQuery);"]}