(function(e){"use strict";function r(r,i){var s=r.outerWidth(true),o={},u={};if(r.is(":visible")||n){return}n=true;r.addClass("ps-active-panel").css({position:"fixed",top:0,height:"100%","z-index":999999999999999});r.data(i);e("html").addClass("overflow-hidden");e("body").addClass("overflow-hidden");e("#dv-overlay").bind("touchmove",false);e("#dv-overlay").fadeIn(200);switch(i.side){case"left":r.css({left:"-"+s+"px",right:"auto"});o["margin-left"]="+="+s;u.left="+="+s;break;case"right":r.css({left:"auto",right:"-"+s+"px"});o["margin-left"]="-="+s;u.right="+="+s;break}t.animate(o,i.duration);r.show().animate(u,i.duration,function(){n=false;if(typeof i.onOpen=="function"){i.onOpen()}})}var t=e("body"),n=false;e.panelslider=function(t,n){var i=e(".ps-active-panel");var s={side:"left",duration:200,clickClose:true,onOpen:null};n=e.extend({},s,n);if(i.is(":visible")&&i[0]!=t[0]){e.panelslider.close(function(){r(t,n)})}else if(!i.length||i.is(":hidden")){r(t,n)}};e.panelslider.close=function(r){var i=e(".ps-active-panel"),s=i.data("duration"),o=i.outerWidth(true),u={},a={};if(!i.length||i.is(":hidden")||n){return}n=true;switch(i.data("side")){case"left":u["margin-left"]="-="+o;a.left="-="+o;break;case"right":u["margin-left"]="+="+o;a.right="-="+o;break}i.animate(a,s);t.animate(u,s,function(){i.hide();i.removeClass("ps-active-panel");e("html").removeClass("overflow-hidden");e("body").removeClass("overflow-hidden");e("#dv-overlay").fadeOut(200);n=false;if(r){r()}})};e(document).bind("click keyup",function(t){var n=e(".ps-active-panel");if(t.type=="keyup"&&t.keyCode!=27){return}if(n.is(":visible")&&n.data("clickClose")){e.panelslider.close()}});e(document).on("click",".ps-active-panel",function(e){e.stopPropagation()});e.fn.panelslider=function(t){this.on('click',function(n){var r=e(".ps-active-panel"),i=e(this.getAttribute("href"));if(r.is(":visible")&&i[0]==r[0]){e.panelslider.close()}else{e.panelslider(i,t)}n.preventDefault();n.stopPropagation()});return this}})(jQuery)