!function($){function isDOMAttrModifiedSupported(){var p=document.createElement("p"),flag=!1;if(p.addEventListener)p.addEventListener("DOMAttrModified",function(){flag=!0},!1);else{if(!p.attachEvent)return!1;p.attachEvent("onDOMAttrModified",function(){flag=!0})}return p.setAttribute("id","target"),flag}function checkAttributes(chkAttr,e){if(chkAttr){var attributes=this.data("attr-old-value");if(e.attributeName.indexOf("style")>=0){attributes.style||(attributes.style={});var keys=e.attributeName.split(".");e.attributeName=keys[0],e.oldValue=attributes.style[keys[1]],e.newValue=keys[1]+":"+this.prop("style")[$.camelCase(keys[1])],attributes.style[keys[1]]=e.newValue}else e.oldValue=attributes[e.attributeName],e.newValue=this.attr(e.attributeName),attributes[e.attributeName]=e.newValue;this.data("attr-old-value",attributes)}}var MutationObserver=window.MutationObserver||window.WebKitMutationObserver;$.fn.attrchange=function(a,b){if("object"==typeof a){var cfg={trackValues:!1,callback:$.noop};if("function"==typeof a?cfg.callback=a:$.extend(cfg,a),cfg.trackValues&&this.each(function(i,el){for(var attr,attributes={},i=0,attrs=el.attributes,l=attrs.length;l>i;i++)attr=attrs.item(i),attributes[attr.nodeName]=attr.value;$(this).data("attr-old-value",attributes)}),MutationObserver){var mOptions={subtree:!1,attributes:!0,attributeOldValue:cfg.trackValues},observer=new MutationObserver(function(mutations){mutations.forEach(function(e){var _this=e.target;cfg.trackValues&&(e.newValue=$(_this).attr(e.attributeName)),"connected"===$(_this).data("attrchange-status")&&cfg.callback.call(_this,e)})});return this.data("attrchange-method","Mutation Observer").data("attrchange-status","connected").data("attrchange-obs",observer).each(function(){observer.observe(this,mOptions)})}return isDOMAttrModifiedSupported()?this.data("attrchange-method","DOMAttrModified").data("attrchange-status","connected").on("DOMAttrModified",function(event){event.originalEvent&&(event=event.originalEvent),event.attributeName=event.attrName,event.oldValue=event.prevValue,"connected"===$(this).data("attrchange-status")&&cfg.callback.call(this,event)}):"onpropertychange"in document.body?this.data("attrchange-method","propertychange").data("attrchange-status","connected").on("propertychange",function(e){e.attributeName=window.event.propertyName,checkAttributes.call($(this),cfg.trackValues,e),"connected"===$(this).data("attrchange-status")&&cfg.callback.call(this,e)}):this}return"string"==typeof a&&$.fn.attrchange.hasOwnProperty("extensions")&&$.fn.attrchange.extensions.hasOwnProperty(a)?$.fn.attrchange.extensions[a].call(this,b):void 0}}(jQuery);