(function($){if($.fn.imageready)return;function isImageLoaded($img){var img=$img[0];var hasNoSrc=!$img.attr("src");var isLazyLoading=$img.attr("loading")==="lazy";var isMarkedComplete=img.complete;var hasCorrectReadyState=img.readyState===4;var has$Height=$img.height()>0;var hasNaturalHeight=img.naturalHeight===undefined?true:img.naturalHeight>0;var hasValidHeight=has$Height&&hasNaturalHeight;return hasNoSrc||isLazyLoading||isMarkedComplete||hasCorrectReadyState||hasValidHeight}function getElementsByCSSAttributeName(name){if(name===undefined)throw"Must specify a css attribute name";var tags=this.getElementsByTagName("*"),el;var rtn=[];var body=$("body")[0];if(body.currentStyle){var scriptName=changeCSSAttributeNameFormat(name);for(var i=0,len=tags.length;i<len;i++){el=tags[i];if(!el.currentStyle)continue;var hasNoValue=el.currentStyle[scriptName]=="none";if(hasNoValue)continue;rtn.push(el)}}else if(window.getComputedStyle){for(var i=0,len=tags.length;i<len;i++){el=tags[i];var hasNoValue=document.defaultView.getComputedStyle(el,null).getPropertyValue(name)=="none";if(hasNoValue)continue;rtn.push(el)}}return rtn}function changeCSSAttributeNameFormat(CSSName){var noDash=CSSName.replace(/-/g," ");var titleCase=toTitleCase(noDash);var noSpace=titleCase.replace(/ /g,"");var lowerCaseStart=noSpace.substr(0,1).toLowerCase()+noSpace.substr(1);return lowerCaseStart}function toTitleCase(str){return str.replace(/\w\S*/g,(function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()}))}function getAllImages($set){var $images=$set.find("img").add($set.filter("img"));$set.each((function(){var $backgroundImageElements=$(getElementsByCSSAttributeName.call(this,"background-image"));$backgroundImageElements.each((function(){var $image=$(new Image);var backgroundImageValue=$(this).css("background-image");var matches=/url\(([^)]*)\)/g.exec(backgroundImageValue);if(matches===null)return;var url=matches[1].replace(/[\"\']/g,"");$image.attr("loading","eager");$image.attr("src",url);$images=$images.add($image)}))}));$images.loaded=0;if($images.length===0)return;return $images}$.fn.imageready=function(callback,options){options=options||{};if(options.allowTimeout===undefined){options.allowTimeout=$.fn.imageready.allowTimeout;options.timeoutDuration=$.fn.imageready.timeoutDuration}var $images=getAllImages(this);if(!$images)return callback();var timeoutHandle;function check(){clearTimeout(timeoutHandle);var notLoadedImg=[];$images.each((function(){if(this._isImageReadyComplete)return;notLoadedImg.push(this);var $this=$(this);console.error("image not loaded in time",$this.attr("src"))}));return callback($(notLoadedImg))}function complete(event){clearTimeout(timeoutHandle);var isAnEventCallback=event&&event.target;if(isAnEventCallback){$images.loaded++;event.currentTarget._isImageReadyComplete=true}var haveAllImagesLoaded=$images.length<=$images.loaded;if(haveAllImagesLoaded)return callback();if(!options.allowTimeout)return;timeoutHandle=setTimeout(check,options.timeoutDuration)}$images.each((function(){var $this=$(this);if(isImageLoaded($this))return $images.loaded++;$this.one("load",complete);$this.one("error",complete);$this.attr("src",$this.attr("src"))}));if($images.length<=$images.loaded)return complete();if(!options.allowTimeout)return;timeoutHandle=setTimeout(check,options.timeoutDuration)};$.fn.imageready.timeoutDuration=1;$.fn.imageready.allowTimeout=false})(jQuery);