/* simpler-sidebar v1.2.0 (http://dcdeiv.github.io/simpler-sidebar)
* copyright 2015-2015 and licensed under gplv2 (https://github.com/dcdeiv/simpler-sidebar/blob/master/license)
*/
!function(a){a.fn.simplersidebar=function(b){var c=a.extend(!0,a.fn.simplersidebar.settings,b);return this.each(function(){var b,d,e,f,g,h,i=c.attr,j=a(this),k=a(c.opener),l=a(c.sidebar.closinglinks),m=c.animation.duration,n=c.sidebar.width,o=c.sidebar.gap,p=n+o,q=a(window).width(),r={},s={},t=function(){a("body, html").css("overflow","hidden")},u=function(){a("body, html").css("overflow","auto")},v={duration:m,easing:c.animation.easing,complete:t},w={duration:m,easing:c.animation.easing,complete:u},x=a("
").attr("data-"+i,"mask");"right"===c.sidebar.align?b="right":"left"===c.sidebar.align&&(b="left"),d=p>q?q-o:n,e={position:"fixed",top:c.top,bottom:0,width:d},e[b]=-d,r[b]=0,f=a.extend(!0,e,c.sidebar.css),j.css(f).attr("data-"+i,"disabled"),g={position:"fixed",top:c.top,right:0,bottom:0,left:0,zindex:c.sidebar.css.zindex-1,display:"none"},h=a.extend(!0,g,c.mask.css),!0===c.mask.display&&x.appendto("body").css(h),k.click(function(){var a=j.attr("data-"+i),c=j.width();s[b]=-c,"disabled"===a?(j.animate(r,v).attr("data-"+i,"active"),x.fadein(m)):"active"===a&&(j.animate(s,w).attr("data-"+i,"disabled"),x.fadeout(m))}),x.click(function(){var a=j.attr("data-"+i),c=j.width();s[b]=-c,"active"===a&&(j.animate(s,w).attr("data-"+i,"disabled"),x.fadeout(m))}),j.on("click",l,function(){var a=j.attr("data-"+i),c=j.width();s[b]=-c,"active"===a&&(j.animate(s,w).attr("data-"+i,"disabled"),x.fadeout(m))}),a(window).resize(function(){var c,d,e=a(window).width();c=p>e?e-o:n,d={width:c},d[b]=-c,j.attr("data-"+i,"disabled").css(d),x.fadeout(m),a("body, html").css({overflow:"auto"})})})},a.fn.simplersidebar.settings={attr:"simplersidebar",top:0,animation:{duration:500,easing:"swing"},sidebar:{width:350,gap:64,closinglinks:"a",css:{zindex:3e3}},mask:{display:!0,css:{backgroundcolor:"black",opacity:.5,filter:"alpha(opacity=50)"}}}}(jquery);