/*! DOMHooks - v0.1.2 - 2013-09-17 * https://github.com/dwightjack/domhooks * Copyright (c) 2013 Marco "DWJ" Solazzi; Licensed MIT */ !function(a,b){var c=a(b.documentElement),d=a(b),e=[],f=function(a){var b=d.find(a.selector);b&&b.length&&a.callback(a.selector,b)},g={settings:{pollsInterval:25,pollsMax:40},html:function(a,b){"string"==typeof a&&c.hasClass(a)&&b(a,c)},ready:function(b,c){var d={selector:b,callback:c};a.isReady?f(d):e.push(d)},available:function(b,c){var e,f=a.Deferred(),h=g.settings.pollsMax;f.progress(function(){var a=d.find(b);a.length?f.resolve(b,a):(h-=1,h||f.reject())}),f.done(c),f.always(function(){e&&clearInterval(e)}),"pending"===f.state()&&(e=setInterval(f.notify,g.settings.pollsInterval))}};a.domHooks=function(b,c,d){return 3===arguments.length?a.isFunction(g[b])?g[b].call(g,c,d):null:(a.isPlainObject(b)&&(c=b,b="ready"),a.isFunction(g[b])&&a.each(c,g[b]),void 0)},a.domHooks.settings=g.settings,d.ready(function(){for(;e.length;)f(e.pop())})}(jQuery,document);