window.Modernizr=window.Modernizr||function(n,t,i){function v(n){w.cssText=n}function o(n,t){return typeof n===t}var y,u,s,r={},p=t.documentElement,l=t.createElement("modernizr"),w=l.style,b=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),k={svg:"http://www.w3.org/2000/svg"},f={},a=[],h=a.slice,c={}.hasOwnProperty,e;s=o(c,"undefined")||o(c.call,"undefined")?function(n,t){return t in n&&o(n.constructor.prototype[t],"undefined")}:function(n,t){return c.call(n,t)};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if("function"!=typeof t)throw new TypeError;return i=h.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(h.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(h.call(arguments)))},r});f.inlinesvg=function(){var n=t.createElement("div");return n.innerHTML="<svg/>",(n.firstChild&&n.firstChild.namespaceURI)==k.svg};for(e in f)s(f,e)&&(u=e.toLowerCase(),r[u]=f[e](),a.push((r[u]?"":"no-")+u));return r.addTest=function(n,t){if("object"==typeof n)for(var u in n)s(n,u)&&r.addTest(u,n[u]);else{if(n=n.toLowerCase(),r[n]!==i)return r;t="function"==typeof t?t():t;"undefined"!=typeof enableClasses&&enableClasses&&(p.className+=" "+(t?"":"no-")+n);r[n]=t}return r},v(""),l=y=null,r._version="2.8.3",r._prefixes=b,r}(this,this.document);Modernizr.addTest("cssfilters",function(){var n=document.createElement("div");return n.style.cssText=Modernizr._prefixes.join("filter:blur(2px); "),!!n.style.length&&(void 0===document.documentMode||document.documentMode>9)});Modernizr.addTest("svgfilters",function(){var n=!1;try{n=void 0!==typeof SVGFEColorMatrixElement&&2==SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE}catch(t){}return n}),function(n,t){function u(t,u){var e,o;u=u||{};e=u.classes||{};o=e.fade||r.classes.fade;u.fade=u.fade||t.className.indexOf(o)>-1;this.element=t;this.elementId=f++;this.settings=n.extend({},r,u);this._defaults=r;this._name=i;this.init()}var i="gray",r={fade:!1,classes:{fade:"grayscale-fade"}},f=0;n.extend(u.prototype,{init:function(){var t;!Modernizr.cssfilters&&Modernizr.inlinesvg&&Modernizr.svgfilters&&(t=n(this.element),(this.cssFilterDeprecated(t)||this.settings.fade)&&this.switchImage(t))},cssFilterDeprecated:function(n){return"none"===n.css("filter")},elementType:function(n){return"IMG"===n.prop("tagName")?"Img":"Bg"},pxToNumber:function(n){return parseInt(n.replace("px",""))},getComputedStyle:function(n){var i={},f={},r,e,u,o;for(i=t.getComputedStyle(n,null),r=0,e=i.length;e>r;r++)u=i[r],o=i.getPropertyValue(u),f[u]=o;return f},extractUrl:function(n){var t;return startRegex=/^url\(["']?/,endRegex=/["']?\)$/,t=n.replace(startRegex,"").replace(endRegex,"")},positionToNegativeMargin:function(n){var t,i,r;return t=n.match(/^(-?\d+\S+)/)[0],i=n.match(/\s(-?\d+\S+)$/)[0],r="margin:"+i+" 0 0 "+t},getBgSize:function(t,i){var r,e,s,u,h,f,o;return(r=new Image,r.src=t,"auto"!==i&&"cover"!==i&&"contain"!==i&&"inherit"!==i)&&(o=n(this.element),e=r.width/r.height,u=parseInt((i.match(/^(\d+)px/)||[0,0])[1]),f=parseInt((i.match(/\s(\d+)px$/)||[0,0])[1]),s=o.height()*e,h=o.width()/e,u=u||s,f=f||h),u||f?{width:u,height:f}:{width:r.width,height:r.height}},getImgParams:function(n){var t={},i,r;return t.styles=this.getComputedStyle(n[0]),i={top:this.pxToNumber(t.styles["padding-top"]),right:this.pxToNumber(t.styles["padding-right"]),bottom:this.pxToNumber(t.styles["padding-bottom"]),left:this.pxToNumber(t.styles["padding-left"])},r={top:this.pxToNumber(t.styles["border-top-width"]),right:this.pxToNumber(t.styles["border-right-width"]),bottom:this.pxToNumber(t.styles["border-bottom-width"]),left:this.pxToNumber(t.styles["border-left-width"])},t.image={width:this.pxToNumber(t.styles.width),height:this.pxToNumber(t.styles.height)},t.svg={url:n[0].src,padding:i,borderWidth:r,width:t.image.width+i.left+i.right+r.left+r.right,height:t.image.height+i.top+i.bottom+r.top+r.bottom,offset:""},t},getBgParams:function(t){var r,i={};return r=this.extractUrl(t.css("background-image")),bgSize=this.getBgSize(r,t.css("background-size")),offset=this.positionToNegativeMargin(t.css("background-position")),i.styles=this.getComputedStyle(t[0]),i.svg=n.extend({url:r},bgSize,{offset:offset}),i.image={width:i.svg.width,height:i.svg.height},i},setStyles:function(n,t,i,r){return t.display="inline-block",t.overflow=t["overflow-x"]=t["overflow-y"]="hidden",t["background-image"]='url("'+i.url+'")',t["background-size"]=r.width+"px "+r.height+"px","Img"===n&&(t["background-repeat"]="no-repeat",t["background-position"]=i.padding.left+"px "+i.padding.top+"px",t.width=i.width,t.height=i.height),delete t.filter,t},addSVGFilterOnce:function(){$body=n("body");$body.data("plugin_"+i+"_has_filter")||$body.data("plugin_"+i+"_has_filter","true").append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="0" height="0" style="position:absolute"><defs><filter id="gray"><feColorMatrix type="saturate" values="0"/><\/filter><\/defs><\/svg>')},switchImage:function(t){var r,i,f,e,o,u;r=this.elementType(t);i=this["get"+r+"Params"](t);f=this.settings.fade?this.settings.classes.fade:"";e=t[0].alt?' aria-labelledby="gray-title-'+this.elementId+'"':"";o=t[0].alt?'<title id="gray-title-'+this.elementId+'">'+t[0].alt+"<\/title>":"";u=n('<div class="grayscale grayscale-replaced '+f+'"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+i.svg.width+" "+i.svg.height+'" width="'+i.svg.width+'" height="'+i.svg.height+'" style="'+i.svg.offset+'" role="img"'+e+">"+o+'<image filter="url(&quot;#gray&quot;)" x="0" y="0" width="'+i.image.width+'" height="'+i.image.height+'" preserveAspectRatio="none" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="'+i.svg.url+'" /><\/svg><\/div>');i.styles=this.setStyles(r,i.styles,i.svg,i.image);u.css(i.styles);this.addSVGFilterOnce();t.replaceWith(u)}});n.fn[i]=function(t){return this.each(function(){n.data(this,"plugin_"+i)||n.data(this,"plugin_"+i,new u(this,t))}),this};n(t).on("load",function(){n(".grayscale:not(.grayscale-replaced)")[i]()})}(jQuery,window,document)