").addClass("sf-nav-number-inner").html(e+1).appendTo(n),n=t("").appendTo(i),e==s.config.startStep&&i.addClass("sf-active"),1==s.config.linkNav&&i.addClass("sf-nav-link"),"left"==s.config.showNav&&(t(".sf-nav-wrap",s.wizard).addClass("sf-nav-left"),s.element.addClass("sf-nav-on-left")),"right"==s.config.showNav&&(t(".sf-nav-wrap",s.wizard).addClass("sf-nav-right"),s.element.addClass("sf-nav-on-right")),"top"!=s.config.showNav&&!0!==s.config.showNav||(t(".sf-nav-wrap",s.wizard).addClass("sf-nav-top"),s.element.addClass("sf-nav-on-top")),"bottom"==s.config.showNav&&(t(".sf-nav-wrap",s.wizard).addClass("sf-nav-bottom"),s.element.addClass("sf-nav-on-bottom")),s.wizard.find(".sf-nav").append(i)}),t(".sf-nav-step.sf-nav-link",s.wizard).on("click",function(e){var i=t(this).data("step"),n=s.stepActive-i,a=s.stepActive
if(n<0)for(var r=s.stepActive;ri&&!1!==s.config.onPrev(r);r--)a=r-1
s.goTo(a),e.preventDefault()}),this.careNav(this.stepActive,this.stepActive)},s.prototype.setProportion=function(){this.stepWidth=this.viewPort.width()
var s=this.stepWidth*this.steps.length,i=0
if("auto"==this.config.height&&this.steps.length){this.viewPort.height("auto")
var n=t(this.steps[this.stepActive]).outerHeight(!0)
this.viewPort.height(n)}"first"==this.config.height&&this.steps.length&&(t(this.steps[0]).height("auto"),i=t(this.steps[0]).height()),!isNaN(parseInt(this.config.height))&&this.steps.length&&(i=this.config.height),"tallest"==this.config.height&&this.steps.length&&this.steps.each(function(s){t(this).height("auto"),t(this).height()>i&&(i=t(this).height())})
var a=this
this.steps.each(function(s){var n=t(this).parent()
0==e?n.css({width:a.stepWidth+"px",float:"left","margin-right":a.stepOffset+"px"}):n.css({width:a.stepWidth+"px",float:"right","margin-left":a.stepOffset+"px"}),i&&t(this).height(i)}),this.fieldWrap.width(s+this.stepOffset*this.steps.length+"px"),1==e?this.fieldWrap.css({"margin-right":"-"+(this.stepActive*this.stepWidth+this.stepOffset*this.stepActive)+"px"}):this.fieldWrap.css({"margin-left":"-"+(this.stepActive*this.stepWidth+this.stepOffset*this.stepActive)+"px"})},s.prototype.goTo=function(s){var e=this,i=this.stepActive,n=i-s,a=jQuery.Event("sf-step-before")
if(e.element.trigger(a,[i,s,e.wizard]),a.isDefaultPrevented())return!1
e.config.markPrevSteps&&t(".sf-nav-step",e.navWrap).each(function(e){t(this).removeClass("sf-nav-prev-step"),e=this.steps.length?this.btnFinish.data("step",s-1).fadeIn(100):this.btnFinish.fadeOut(0),0==s?this.btnPrev.fadeOut(100):this.btnPrev.data("step",s-1).fadeIn(100),!0},s.prototype.careNav=function(s,i){var n=this
if(!1!==n.config.showNav){var a=n.navWrap.width(),r=new Array
if(n.navWrap.hasClass("sf-nav-top")||n.navWrap.hasClass("sf-nav-bottom")){var f=0,o=0
if(t(".sf-nav-step",n.navWrap).each(function(e){r[e]=t(this).outerWidth(!0),o+=r[e],e=0&&(f-=r[s-1]),o>a){var h=o-a,p=s-1,d=0
i-s<0&&(p=s+1,d=-50),f>h&&(f=h,d=0)
t(".sf-nav-step-"+p,this.wizard).length?t(".sf-nav",n.navWrap).animate({left:"-"+(f+d)+"px"},this.config.duration):p<0?t(".sf-nav",n.navWrap).animate({left:"0px"},this.config.duration):t(".sf-nav",n.navWrap).animate({left:"-"+f+"px"},this.config.duration)}}else{var v=0
t(".sf-nav-step",n.navWrap).each(function(s){n.navWrap.css("width","9999px")
var e=t(this).css("float","left").outerWidth(!0)
n.navWrap.css("width",""),t(this).css("float",""),v