!function(t){"use strict";function e(t){var e,n,o,i,s=t.css("transition-duration")||t.css("-webkit-transition-duration")||t.css("-moz-transition-duration")||t.css("-o-transition-duration")||t.css("-ms-transition-duration")||"0s",a=t.css("transition-delay")||t.css("-webkit-transition-delay")||t.css("-moz-transition-delay")||t.css("-o-transition-delay")||t.css("-ms-transition-delay")||"0s";for(s=s.split(", "),a=a.split(", "),i=0,n=s.length,e=Number.NEGATIVE_INFINITY;n>i;i++)o=parseFloat(s[i])+parseFloat(a[i]),o>e&&(e=o);return 1e3*o}function n(){if(t(document.body).height()<=t(window).height())return 0;var e,n,o=document.createElement("div"),i=document.createElement("div");return o.style.visibility="hidden",o.style.width="100px",document.body.appendChild(o),e=o.offsetWidth,o.style.overflow="scroll",i.style.width="100%",o.appendChild(i),n=i.offsetWidth,o.parentNode.removeChild(o),e-n}function o(){var e=t(document.body),o=parseInt(e.css("padding-right"),10)+n();e.css("padding-right",o+"px"),t("html, body").addClass(d+"_Locked")}function i(){var e=t(document.body),o=parseInt(e.css("padding-right"),10)-n();e.css("padding-right",o+"px"),t("html, body").removeClass(d+"_Locked")}function s(t){var e,n,o,i,s={};for(t=t.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),e=t.split(","),i=0,n=e.length;n>i;i++)e[i]=e[i].split(":"),o=e[i][1],("string"==typeof o||o instanceof String)&&(o="true"===o||("false"===o?!1:o)),("string"==typeof o||o instanceof String)&&(o=isNaN(o)?o:+o),s[e[i][0]]=o;return s}function a(n,o){var i,s,a,r=this;r.settings=t.extend({},u,o),r.$body=t(document.body),r.$overlay=t("."+d+"_Overlay"),r.$overlay.length||(r.$overlay=t("<div>").addClass(d+"_Overlay"),r.$body.append(r.$overlay)),r.$bg=t("."+d+"-bg"),r.$closeButton=t("<a href='#'></a>").addClass(d+"_Close"),r.$wrapper=t("<div>").addClass(d+"_Wrapper"),r.$BoxAlert=n,r.$BoxAlert.addClass(d),r.$BoxAlert.css("visibility","visible"),r.$BoxAlert.append(r.$closeButton),r.$wrapper.append(r.$BoxAlert),r.$body.append(r.$wrapper),r.$cancelButton=r.$BoxAlert.find("."+d+"_Cancel"),i=e(r.$overlay),s=e(r.$BoxAlert),a=e(r.$bg),r.td=s>i?s:i,r.td=a>r.td?a:r.td,r.$closeButton.bind("click."+d,function(t){t.preventDefault(),r.close()}),r.$cancelButton.bind("click."+d,function(t){t.preventDefault(),r.$BoxAlert.trigger("cancel"),r.settings.closeOnCancel&&r.close()}),t(document).bind("keyup."+d,function(t){27===t.keyCode&&r.settings.closeOnEscape&&r.close()}),r.$wrapper.bind("click."+d,function(e){var n=t(e.target);n.hasClass(d+"_Wrapper")&&r.settings.closeOnAnyClick&&r.close()}),r.index=t[d].lookup.push(r)-1,r.busy=!1}function r(e,n){var o,i,s=location.hash.replace("#","");if("undefined"==typeof n&&(n=!0),s){try{i=t("[data-"+d+"-id="+s.replace(new RegExp("/","g"),"\\/")+"]")}catch(a){}i&&i.length&&(o=t[d].lookup[i.data(d)],o&&o.settings.hashTracking&&o.open())}else n&&c&&!c.busy&&c.settings.hashTracking&&c.close()}var c,l,d="BoxAlertArea",u={hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnAnyClick:!0};a.prototype.open=function(){if(!this.busy){var e,n=this;n.busy=!0,n.$BoxAlert.trigger("open"),e=n.$BoxAlert.attr("data-"+d+"-id"),e&&n.settings.hashTracking&&(l=t(window).scrollTop(),location.hash=e),c&&c!==n&&(c.$overlay.hide(),c.$wrapper.hide(),c.$body.removeClass(d+"_Active")),c=n,o(),n.$overlay.show(),n.$wrapper.show(),setTimeout(function(){n.$body.addClass(d+"_Active"),setTimeout(function(){n.busy=!1,n.$BoxAlert.trigger("opened")},n.td+50)},25)}},a.prototype.close=function(){if(!this.busy){this.busy=!0,this.$BoxAlert.trigger("close");var e=this;e.settings.hashTracking&&e.$BoxAlert.attr("data-"+d+"-id")===location.hash.substr(1)&&(location.hash="",t(window).scrollTop(l)),e.$body.removeClass(d+"_Active"),setTimeout(function(){e.$overlay.hide(),e.$wrapper.hide(),i(),e.busy=!1,e.$BoxAlert.trigger("closed")},e.td+50)}},t[d]={lookup:[]},t.fn[d]=function(e){var n,o;return this.each(function(i,s){o=t(s),null==o.data(d)?(n=new a(o,e),o.data(d,n.index),n.settings.hashTracking&&o.attr("data-"+d+"-id")===location.hash.substr(1)&&n.open()):n=t[d].lookup[o.data(d)]}),n},t(document).ready(function(){t(document).on("click","[data-"+d+"-target]",function(e){e.preventDefault();var n=e.currentTarget,o=n.getAttribute("data-"+d+"-target"),i=t("[data-"+d+"-id="+o+"]");t[d].lookup[i.data(d)].open()}),t(document).find("."+d).each(function(e,n){var o=t(n),i=o.data(d+"-options");i?("string"==typeof i||i instanceof String)&&(i=s(i)):i={},o[d](i)})}),t(window).bind("hashchange."+d,r)}(window.jQuery||window.Zepto);