define(function(){function e(e){if(!(i||e&&"readystatechange"==e.type&&!r[a.readyState])){for(;c.length;)c.shift()();i=1}}function t(){r[a.readyState]?e():setTimeout(t,30)}function n(e,t,n){var a,o,r;if(require.is(e,"Number")||(n=t,t=e,e=1e3),a=n?function(){n.call(t)}:t,i)a();else{for(a.priority=e,o=0,r=c.length;r>o&&e>=c[o].priority;o++);c.splice(o,0,a)}}var a=document,o=require.on,r={loaded:1,complete:1},i=!!r[a.readyState],c=[];return i||(c.concat([o(a,"DOMContentLoaded",e),o(window,"load",e)]),"onreadystatechange"in a?c.push(require.on(a,"readystatechange",e)):t()),n.load=function(e,t,a){n(a)},n});