$(function(){var n=this;n.lastQuestionStep=[$($(".question-step")[0]).html()];$(document).on("click",".question-step .answer",function(){var t=$(this).data("href");t?window.location.href=t:n.getQuestionStep($(this).data("nodeAliasPath"))});$(document).on("click",".back",function(){$($(".question-step")[0]).html(n.lastQuestionStep.pop())});n.setQuestionStep=function(t){n.lastQuestionStep.push($($(".question-step")[0]).html());$(".question-step .answer").remove();$(".question-step .question").html(t.Question.Text);for(var i=0;i<t.Answers.length;i++)$(".question-step").append('<div class="answer" data-href="'+t.Answers[i].LinkedPage+'" data-node-alias-path="'+t.Answers[i].NodeAliasPath+'">'+t.Answers[i].Text+"<\/div>");n.lastQuestionStep.length>0?$(".back").css("display","block"):$(".back").css("display","none")};n.getQuestionStep=function(t){$.ajax({method:"POST",url:GlobalRouting.Home+"/GetQuestionStep",data:{nodeAliasPath:t},success:n.setQuestionStep,error:function(){console.error("Error gathering data from the server")}})}})