<script>
var q1 = $(".q1txt").html();
var q1explainer = $(".q1exp").html();
var q2 = $(".q2txt").html();
var q2explainer = $(".q2exp").html();
var q3 = $(".q3txt").html();
var q3explainer = $(".q3exp").html();
var stepNumber = 1;
var workpapers = "MAS, Accounts or AO Classic General Ledger";
var workpapersDesc = $(".workpapersDesc1").html();
var myobLedger = "MYOB Ledger";
var myobLedgerDesc = $(".myobLedgerDesc1").html();
var commonLedger = "MYOB AccountRight or Essentials";
var commonLedgerDesc = $(".commonLedgerDesc1").html();
$(document).ready(function() {
$("#questionText").html(q1).css("display", "block")
$("#explainerText").html(q1explainer).css("display", "block")
$(".rwui_expandable_item").css("display","none"); // hide all dropdowns on page load
})
function showRecommended (product,description) {
// change title of recommended dropdown:
$(".rwui_expandable_item_title:first").html("<div class='rwui_icon'></div>"+product+"</a>");
// change text in recommended dropdown
$(".rwui_expandable_item_body:first").html(description);
//Show Recommended header
$(".headerRec").css("display", "block")
}
function showBackups (product1,description1,product2,description2) {
// change title of second dropdown:
$("#rwui_expand-Backup1").html("<div class='rwui_icon'></div>"+product1+"</a>");
// change text in second dropdown
$("#rwui_expand-Backup1").next().html(description1);
// change title of third dropdown:
$("#rwui_expand-Backup2").html("<div class='rwui_icon'></div>"+product2+"</a>");
// change text in third dropdown
$("#rwui_expand-Backup2").next().html(description2);
//Show backup header
$(".headerBak").css("display", "block")
}
$("#yes").click(function() {
if (stepNumber == 1) {
showRecommended(workpapers,workpapersDesc);
showBackups(myobLedger,myobLedgerDesc,commonLedger,commonLedgerDesc);
showResults();
}
else if (stepNumber == 2) {
$("#questionText").html(q3);
$("#explainerText").html(q3explainer);
}
else if (stepNumber == 3) {
showRecommended(commonLedger,commonLedgerDesc);
showBackups(myobLedger,myobLedgerDesc,workpapers,workpapersDesc);
showResults();
}
stepNumber++;
});
$("#no").click(function() {
if (stepNumber == 1) {
$("#questionText").html(q2);
$("#explainerText").html(q2explainer);
}
else if (stepNumber == 2) {
showRecommended(myobLedger,myobLedgerDesc);
showBackups(commonLedger,commonLedgerDesc,workpapers,workpapersDesc);
showResults();
}
else if (stepNumber == 3) {
showRecommended(myobLedger,myobLedgerDesc);
showBackups(commonLedger,commonLedgerDesc,workpapers,workpapersDesc);
showResults();
}
stepNumber++;
});
$(".startOver").click(function() {
stepNumber = 1;
$("#questionText").html(q1);
$("#explainerText").html(q1explainer);
$(".rwui_expandable_item").css("display", "none");
$(".CAanswerButton").removeClass("disabledButton");
$(".headerRec, .headerBak").css("display", "none");
});
function showResults() {
// show dropdowns:
$(".rwui_expandable_item").css("display","block");
disableButtons();
}
function disableButtons() {
// disable buttons when all questions answered
$("#yes, #no").removeAttr('id');
$(".CAanswerButton").addClass("disabledButton");
}
</script> |