$(function(){
/* set all list items hidden, except for first*/
	$(".single-question").hide();
	$(".single-question:first-child").show();

/* set sub navigation to default */
	$(".question-nav-left").addClass("prev-off");
	$(".question-nav-right").addClass("next-on");
	BenefulMap.questionPrev();
	BenefulMap.questionNext();
});

BenefulMap.questionsCount = 1;

BenefulMap.questionPrev = function(){
	var total = $(".single-question").size();
	$(".question-nav-left").click(function() {
		$(".single-question:nth-child("+BenefulMap.questionsCount+")").hide();
        if (BenefulMap.questionsCount > 1){
            BenefulMap.questionsCount--;
            BenefulMap.questionNav();
        }
        $(".single-question:nth-child("+BenefulMap.questionsCount+")").show();
        return false;
	});		
}

BenefulMap.questionNext = function(){
	var total = $(".single-question").size();
	$(".question-nav-right").click(function() {
		$(".single-question:nth-child("+BenefulMap.questionsCount+")").hide();
        if (BenefulMap.questionsCount < total) {
            BenefulMap.questionsCount++;
            BenefulMap.questionNav();
        }
        $(".single-question:nth-child("+BenefulMap.questionsCount+")").show();
        return false;
	});	
}
	
BenefulMap.questionNav = function(){
	var total = $(".single-question").size();
	if (BenefulMap.questionsCount == 1){
		$(".question-nav-left").addClass("prev-off");
    	$(".question-nav-right").addClass("next-on");
    	
    	$(".question-nav-left").removeClass("prev-on");
	}
	else if (BenefulMap.questionsCount < total && BenefulMap.questionsCount > 1){
		$(".question-nav-left").addClass("prev-on");
    	$(".question-nav-right").addClass("next-on");
	}
	else if(BenefulMap.questionsCount == total){
		$(".question-nav-left").addClass("prev-on");
    	$(".question-nav-right").addClass("next-off");
    	
    	$(".question-nav-right").removeClass("next-on");
    }
}