/*! * jQuery Steps v1.1.0 - 09/04/2014 * Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com) * Licensed under MIT http://www.opensource.org/licenses/MIT */ (function($,undefined){$.fn.extend({_aria:function(name,value){return this.attr("aria-"+name,value)},_removeAria:function(name){return this.removeAttr("aria-"+name)},_enableAria:function(enable){return(enable==null||enable)?this.removeClass("disabled")._aria("disabled","false"):this.addClass("disabled")._aria("disabled","true")},_showAria:function(show){return(show==null||show)?this.show()._aria("hidden","false"):this.hide()._aria("hidden","true")},_selectAria:function(select){return(select==null||select)?this.addClass("current")._aria("selected","true"):this.removeClass("current")._aria("selected","false")},_id:function(id){return(id)?this.attr("id",id):this.attr("id")}});if(!String.prototype.format){String.prototype.format=function(){var args=(arguments.length===1&&$.isArray(arguments[0]))?arguments[0]:arguments;var formattedString=this;for(var i=0;istepContents.length){throwError(_missingCorrespondingElementErrorMessage,"contents")}else{if(stepTitles.length *");contents.removeData("loaded").removeData("mode").removeData("url");contents.removeAttr("id").removeAttr("role").removeAttr("tabindex").removeAttr("class").removeAttr("style")._removeAria("labelledby")._removeAria("hidden");wizard.find(".content > [data-mode='async'],.content > [data-mode='iframe']").empty();var wizardSubstitute=$('<{0} class="{1}">'.format(wizard.get(0).tagName,wizard.attr("class")));var wizardId=wizard._id();if(wizardId!=null&&wizardId!==""){wizardSubstitute._id(wizardId)}wizardSubstitute.html(wizard.find(".content").html());wizard.after(wizardSubstitute);wizard.remove();return wizardSubstitute}function finishStep(wizard,state){var currentStep=wizard.find(".steps li").eq(state.currentIndex);if(wizard.triggerHandler("finishing",[state.currentIndex])){currentStep.addClass("done").removeClass("error");wizard.triggerHandler("finished",[state.currentIndex])}else{currentStep.addClass("error")}}function getEventNamespace(wizard){var eventNamespace=wizard.data("eventNamespace");if(eventNamespace==null){eventNamespace="."+getUniqueId(wizard);wizard.data("eventNamespace",eventNamespace)}return eventNamespace}function getStepAnchor(wizard,index){var uniqueId=getUniqueId(wizard);return wizard.find("#"+uniqueId+_tabSuffix+index)}function getStepPanel(wizard,index){var uniqueId=getUniqueId(wizard);return wizard.find("#"+uniqueId+_tabpanelSuffix+index)}function getStepTitle(wizard,index){var uniqueId=getUniqueId(wizard);return wizard.find("#"+uniqueId+_titleSuffix+index)}function getOptions(wizard){return wizard.data("options")}function getState(wizard){return wizard.data("state")}function getSteps(wizard){return wizard.data("steps")}function getStep(wizard,index){var steps=getSteps(wizard);if(index<0||index>=steps.length){throwError(_indexOutOfRangeErrorMessage)}return steps[index]}function getUniqueId(wizard){var uniqueId=wizard.data("uid");if(uniqueId==null){uniqueId=wizard._id();if(uniqueId==null){uniqueId="steps-uid-".concat(_uniqueId);wizard._id(uniqueId)}_uniqueId++;wizard.data("uid",uniqueId)}return uniqueId}function getValidEnumValue(enumType,keyOrValue){validateArgument("enumType",enumType);validateArgument("keyOrValue",keyOrValue);if(typeof keyOrValue==="string"){var value=enumType[keyOrValue];if(value===undefined){throwError("The enum key '{0}' does not exist.",keyOrValue)}return value}else{if(typeof keyOrValue==="number"){for(var key in enumType){if(enumType[key]===keyOrValue){return keyOrValue}}throwError("Invalid enum value '{0}'.",keyOrValue)}else{throwError("Invalid key or value type.")}}}function goToNextStep(wizard,options,state){return paginationClick(wizard,options,state,increaseCurrentIndexBy(state,1))}function goToPreviousStep(wizard,options,state){return paginationClick(wizard,options,state,decreaseCurrentIndexBy(state,1))}function goToStep(wizard,options,state,index){if(index<0||index>=state.stepCount){throwError(_indexOutOfRangeErrorMessage)}if(options.forceMoveForward&&indexstate.stepCount){throwError(_indexOutOfRangeErrorMessage)}step=$.extend({},stepModel,step);insertStepToCache(wizard,index,step);if(state.currentIndex!==state.stepCount&&state.currentIndex>=index){state.currentIndex++;saveCurrentStateToCookie(wizard,options,state)}state.stepCount++;var contentContainer=wizard.find(".content"),header=$("<{0}>{1}".format(options.headerTag,step.title)),body=$("<{0}>".format(options.bodyTag));if(step.contentMode==null||step.contentMode===contentMode.html){body.html(step.content)}if(index===0){contentContainer.prepend(body).prepend(header)}else{getStepPanel(wizard,(index-1)).after(body).after(header)}renderBody(wizard,state,body,index);renderTitle(wizard,options,state,header,index);refreshSteps(wizard,options,state,index);if(index===state.currentIndex){refreshStepNavigation(wizard,options,state)}refreshPagination(wizard,options,state);return wizard}function insertStepToCache(wizard,index,step){getSteps(wizard).splice(index,0,step)}function keyUpHandler(event){var wizard=$(this),options=getOptions(wizard),state=getState(wizard);if(options.suppressPaginationOnFocus&&wizard.find(":focus").is(":input")){event.preventDefault();return false}var keyCodes={left:37,right:39};if(event.keyCode===keyCodes.left){event.preventDefault();goToPreviousStep(wizard,options,state)}else{if(event.keyCode===keyCodes.right){event.preventDefault();goToNextStep(wizard,options,state)}}}function loadAsyncContent(wizard,options,state){if(state.stepCount>0){var currentIndex=state.currentIndex,currentStep=getStep(wizard,currentIndex);if(!options.enableContentCache||!currentStep.contentLoaded){switch(getValidEnumValue(contentMode,currentStep.contentMode)){case contentMode.iframe:wizard.find(".content > .body").eq(state.currentIndex).empty().html('