!function(a,b){"function"==typeof define&&define.amd?define(["exports"],b):b("undefined"!=typeof exports?exports:a.dragscroll={})}(this,function(a){var b=window,c=document,d="mousemove",e="mouseup",f="mousedown",g="EventListener",h="add"+g,i="remove"+g,j=[],k=function(a,g){for(a=0;a<j.length;)g=j[a++],g=g.container||g,g[i](f,g.md,0),b[i](e,g.mu,0),b[i](d,g.mm,0);for(j=[].slice.call(c.getElementsByClassName("dragscroll")),a=0;a<j.length;)!function(a,g,i,j,k,l){(l=a.container||a)[h](f,l.md=function(b){a.hasAttribute("nochilddrag")&&c.elementFromPoint(b.pageX,b.pageY)!=l||(j=1,g=b.clientX,i=b.clientY,b.preventDefault())},0),b[h](e,l.mu=function(){j=0},0),b[h](d,l.mm=function(b){j&&((k=a.scroller||a).scrollLeft-=-g+(g=b.clientX),k.scrollTop-=-i+(i=b.clientY))},0)}(j[a++])};"complete"==c.readyState?k():b[h]("load",k,0),a.reset=k});