/**
 * HumaneJS
 * Humanized Messages for Notifications
 * @author Marc Harter (@wavded)
 * @contributers
 *   Alexander (@bga_)
 *   Jose (@joseanpg)
 * @example
 *  humane('hello world');
 */(function(a,b){function s(a){k.push(a),j&&n()}function r(b,c){var d,e;b===1?(e=0,a.humane.forceNew&&(e=i?g.filters.item("DXImageTransform.Microsoft.Alpha").Opacity/100|0:g.style.opacity|0),g.style.zIndex=1e5,d=setInterval(function(){e<1?(e+=.1,e>1&&(e=1),q(e)):clearInterval(d)},10)):(e=1,d=setInterval(function(){e>0?(e-=.1,e<0&&(e=0),q(e)):(clearInterval(d),g.style.zIndex=-1,p())},10))}function p(){setTimeout(function(){f=!1,n()},500)}function o(a){a===1?g.className="humane humane-show":(g.className="humane",p())}function n(){if(!f||!!a.humane.forceNew){if(!k.length){m();return}f=!0,h&&(clearTimeout(h),h=null),h=setTimeout(function(){e||(c(b.body,"mousemove",m),c(b.body,"click",m),c(b.body,"keypress",m),c(b.body,"touchstart",m),e=!0,a.humane.waitForMove||m())},a.humane.timeout),g.innerHTML=k.shift(),o(1)}}function m(){d(b.body,"mousemove",m),d(b.body,"click",m),d(b.body,"keypress",m),d(b.body,"touchstart",m),e=!1,f&&o(0)}function l(){g=b.createElement("div"),g.id="humane",g.className="humane",b.body.appendChild(g),i&&(g.filters.item("DXImageTransform.Microsoft.Alpha").Opacity=0),j=!0}var c,d;a.addEventListener?(c=function(a,b,c){a.addEventListener(b,c,!1)},d=function(a,b,c){a.removeEventListener(b,c,!1)}):(c=function(a,b,c){a.attachEvent("on"+b,c)},d=function(a,b,c){a.detachEvent("on"+b,c)});var e=!1,f=!1,g=null,h=null,i=/msie [678]/i.test(navigator.userAgent),j=!1,k=[];c(a,"load",function(){var a=function(a){var b=["MozT","WebkitT","OT","msT","KhtmlT","t"];for(var c=0,d;d=b[c];c++)if(d+"ransition"in a)return!0;return!1}(b.body.style);a||(o=r),l(),n()});var q=function(){return i?function(a){g.filters.item("DXImageTransform.Microsoft.Alpha").Opacity=a*100}:function(a){g.style.opacity=String(a)}}();a.humane=s,a.humane.timeout=2500,a.humane.waitForMove=!1,a.humane.forceNew=!1})(window,document)
