/*! gray v1.6.0 | mit */ /*! modernizr 2.8.3 (custom build) | mit & bsd */ if(window.modernizr=function(e,t,i){function r(e){c.csstext=e}function n(e,t){return typeof e===t}var s,o,a,d="2.8.3",l={},h=t.documentelement,g="modernizr",u=t.createelement(g),c=u.style,f=({}.tostring," -webkit- -moz- -o- -ms- ".split(" ")),p={svg:"http://www.w3.org/2000/svg"},m={},y=[],v=y.slice,w={}.hasownproperty;a=n(w,"undefined")||n(w.call,"undefined")?function(e,t){return t in e&&n(e.constructor.prototype[t],"undefined")}:function(e,t){return w.call(e,t)},function.prototype.bind||(function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new typeerror;var i=v.call(arguments,1),r=function(){if(this instanceof r){var n=function(){};n.prototype=t.prototype;var s=new n,o=t.apply(s,i.concat(v.call(arguments)));return object(o)===o?o:s}return t.apply(e,i.concat(v.call(arguments)))};return r}),m.inlinesvg=function(){var e=t.createelement("div");return e.innerhtml="",(e.firstchild&&e.firstchild.namespaceuri)==p.svg};for(var b in m)a(m,b)&&(o=b.tolowercase(),l[o]=m[b](),y.push((l[o]?"":"no-")+o));return l.addtest=function(e,t){if("object"==typeof e)for(var r in e)a(e,r)&&l.addtest(r,e[r]);else{if(e=e.tolowercase(),l[e]!==i)return l;t="function"==typeof t?t():t,"undefined"!=typeof enableclasses&&enableclasses&&(h.classname+=" "+(t?"":"no-")+e),l[e]=t}return l},r(""),u=s=null,l._version=d,l._prefixes=f,l}(this,this.document),!window.modernizr._prefixes)throw error("jquery-gray: modernizr._prefixes not set!\n\nplease add the necessary feature detects:\nhttps://github.com/karlhorky/gray#modernizr");modernizr.addtest("cssfilters",function(){var e=document.createelement("div");return e.style.csstext=modernizr._prefixes.join("filter:blur(2px); "),!!e.style.length&&(void 0===document.documentmode||document.documentmode>9)}),modernizr.addtest("svgfilters",function(){var e=!1;try{e=void 0!==typeof svgfecolormatrixelement&&2==svgfecolormatrixelement.svg_fecolormatrix_type_saturate}catch(t){}return e}),function(e,t){function i(t,i){var o,a;i=i||{},o=i.classes||{},a=o.fade||n.classes.fade,i.fade=i.fade||t.classname.indexof(a)>-1,this.element=t,this.elementid=s++,this.settings=e.extend({},n,i),this._defaults=n,this._name=r,this.init()}var r="gray",n={fade:!1,classes:{fade:"grayscale-fade"}},s=0;e.extend(i.prototype,{init:function(){var t;!modernizr.cssfilters&&modernizr.inlinesvg&&modernizr.svgfilters&&(t=e(this.element),(this.cssfilterdeprecated(t)||this.settings.fade)&&this.switchimage(t))},cssfilterdeprecated:function(e){return"none"===e.css("filter")},elementtype:function(e){return"img"===e.prop("tagname")?"img":"bg"},pxtonumber:function(e){return parseint(e.replace("px",""))},getcomputedstyle:function(e){var i={},r={};i=t.getcomputedstyle(e,null);for(var n=0,s=i.length;s>n;n++){var o=i[n],a=i.getpropertyvalue(o);r[o]=a}return r},extracturl:function(e){var t;return startregex=/^url\(["']?/,endregex=/["']?\)$/,t=e.replace(startregex,"").replace(endregex,"")},positiontonegativemargin:function(e){var t,i,r;return t=e.match(/^(-?\d+\s+)/)[0],i=e.match(/\s(-?\d+\s+)$/)[0],r="margin:"+i+" 0 0 "+t},getbgsize:function(t,i){var r,n,s,o,a,d,l;if(r=new image,r.src=t,"auto"!==i&&"cover"!==i&&"contain"!==i&&"inherit"!==i){var h=e(this.element);n=r.width/r.height,o=parseint((i.match(/^(\d+)px/)||[0,0])[1]),d=parseint((i.match(/\s(\d+)px$/)||[0,0])[1]),s=h.height()*n,a=h.width()/n,o=o||s,d=d||a}return l=o||d?{width:o,height:d}:{width:r.width,height:r.height}},getimgparams:function(e){var t={};t.styles=this.getcomputedstyle(e[0]);var 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"])};return t.image={width:this.pxtonumber(t.styles.width),height:this.pxtonumber(t.styles.height)},t.svg={url:e[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 i,r={};return i=this.extracturl(t.css("background-image")),bgsize=this.getbgsize(i,t.css("background-size")),offset=this.positiontonegativemargin(t.css("background-position")),r.styles=this.getcomputedstyle(t[0]),r.svg=e.extend({url:i},bgsize,{offset:offset}),r.image={width:r.svg.width,height:r.svg.height},r},setstyles:function(e,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"===e&&(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=e("body"),$body.data("plugin_"+r+"_has_filter")||$body.data("plugin_"+r+"_has_filter","true").append('')},switchimage:function(t){var i,r,n,s,o,a;i=this.elementtype(t),r=this["get"+i+"params"](t),n=this.settings.fade?this.settings.classes.fade:"",s=t[0].alt?' aria-labelledby="gray-title-'+this.elementid+'"':"",o=t[0].alt?''+t[0].alt+"":"",a=e('
"+o+'
'),r.styles=this.setstyles(i,r.styles,r.svg,r.image),a.css(r.styles),this.addsvgfilteronce(),t.replacewith(a)}}),e.fn[r]=function(t){return this.each(function(){e.data(this,"plugin_"+r)||e.data(this,"plugin_"+r,new i(this,t))}),this},e(t).on("load",function(){e(".grayscale:not(.grayscale-replaced)")[r]()})}(jquery,window,document);