!function(n){var t=function(t,i){var t=n(t),e=this,o=n.extend({},n.fn.bootstrapWizard.defaults,i),r=null,a=null;this.rebindClick=function(n,t){n.unbind("click",t).bind("click",t)},this.fixNavigationButtons=function(){return r.length||(a.find("a:first").tab("show"),r=a.find("li:first")),n(o.previousSelector,t).toggleClass("disabled",e.firstIndex()>=e.currentIndex()),n(o.nextSelector,t).toggleClass("disabled",e.currentIndex()>=e.navigationLength()),e.rebindClick(n(o.nextSelector,t),e.next),e.rebindClick(n(o.previousSelector,t),e.previous),e.rebindClick(n(o.lastSelector,t),e.last),e.rebindClick(n(o.firstSelector,t),e.first),o.onTabShow&&"function"==typeof o.onTabShow&&o.onTabShow(r,a,e.currentIndex())===!1?!1:void 0},this.next=function(){return t.hasClass("last")?!1:o.onNext&&"function"==typeof o.onNext&&o.onNext(r,a,e.nextIndex())===!1?!1:($index=e.nextIndex(),$index>e.navigationLength()||(a.find("li:eq("+$index+") a").tab("show"),r=a.find("li.active",t),n(o.previousSelector,t).toggleClass("disabled",e.firstIndex()>=e.currentIndex()),n(o.nextSelector,t).toggleClass("disabled",e.currentIndex()>=e.navigationLength())),void 0)},this.previous=function(){return t.hasClass("first")?!1:o.onPrevious&&"function"==typeof o.onPrevious&&o.onPrevious(r,a,e.previousIndex())===!1?!1:($index=e.previousIndex(),0>$index||(a.find("li:eq("+$index+") a").tab("show"),r=a.find("li.active",t),n(o.previousSelector,t).toggleClass("disabled",e.firstIndex()>=e.currentIndex()),n(o.nextSelector,t).toggleClass("disabled",e.currentIndex()>=e.navigationLength())),void 0)},this.first=function(){return o.onFirst&&"function"==typeof o.onFirst&&o.onFirst(r,a,e.firstIndex())===!1?!1:t.hasClass("disabled")?!1:(a.find("li:eq(0) a").tab("show"),void 0)},this.last=function(){return o.onLast&&"function"==typeof o.onLast&&o.onLast(r,a,e.lastIndex())===!1?!1:t.hasClass("disabled")?!1:(a.find("li:eq("+e.navigationLength()+") a").tab("show"),void 0)},this.currentIndex=function(){return a.find("li").index(r)},this.firstIndex=function(){return 0},this.lastIndex=function(){return e.navigationLength()},this.getIndex=function(n){return a.find("li").index(n)},this.nextIndex=function(){return a.find("li").index(r)+1},this.previousIndex=function(){return a.find("li").index(r)-1},this.navigationLength=function(){return a.find("li").length-1},this.activeTab=function(){return r},this.nextTab=function(){return a.find("li:eq("+(e.currentIndex()+1)+")").length?a.find("li:eq("+(e.currentIndex()+1)+")"):null},this.previousTab=function(){return e.currentIndex()<=0?null:a.find("li:eq("+parseInt(e.currentIndex()-1)+")")},this.show=function(n){return t.find("li:eq("+n+") a").tab("show")},this.disable=function(n){a.find("li:eq("+n+")").addClass("disabled")},this.enable=function(n){a.find("li:eq("+n+")").removeClass("disabled")},this.hide=function(n){a.find("li:eq("+n+")").hide()},this.display=function(n){a.find("li:eq("+n+")").show()},this.remove=function(t){var i=t[0],e="undefined"!=typeof t[1]?t[1]:!1,o=a.find("li:eq("+i+")");if(e){var r=o.find("a").attr("href");n(r).remove()}o.remove()},a=t.find("ul:first",t),r=a.find("li.active",t),a.hasClass(o.tabClass)||a.addClass(o.tabClass),o.onInit&&"function"==typeof o.onInit&&o.onInit(r,a,0),o.onShow&&"function"==typeof o.onShow&&o.onShow(r,a,e.nextIndex()),e.fixNavigationButtons(),n('a[data-toggle="tab"]',a).on("click",function(t){var i=a.find("li").index(n(t.currentTarget).parent("li"));return o.onTabClick&&"function"==typeof o.onTabClick&&o.onTabClick(r,a,e.currentIndex(),i)===!1?!1:void 0}),n('a[data-toggle="tab"]',a).on("shown",function(t){$element=n(t.target).parent();var i=a.find("li").index($element);return $element.hasClass("disabled")?!1:o.onTabChange&&"function"==typeof o.onTabChange&&o.onTabChange(r,a,e.currentIndex(),i)===!1?!1:(r=$element,e.fixNavigationButtons(),void 0)})};n.fn.bootstrapWizard=function(i){if("string"==typeof i){var e=Array.prototype.slice.call(arguments,1);return 1===e.length&&e.toString(),this.data("bootstrapWizard")[i](e)}return this.each(function(){var e=n(this);if(!e.data("bootstrapWizard")){var o=new t(e,i);e.data("bootstrapWizard",o)}})},n.fn.bootstrapWizard.defaults={tabClass:"nav nav-pills",nextSelector:".wizard li.next",previousSelector:".wizard li.previous",firstSelector:".wizard li.first",lastSelector:".wizard li.last",onShow:null,onInit:null,onNext:null,onPrevious:null,onLast:null,onFirst:null,onTabChange:null,onTabClick:null,onTabShow:null}}(jQuery);