var nextQuesTimer;
var curObjName;
var SCO
var selectedAns = ["","","","","","","","","",""];

function ref() {
    location.reload();
}
(function ($) {

    function addScorm() {
        console.log("rajji");
        SCO = pipwerks.SCORM;
        SCO.connection.initialize();
        console.log("INIT:  ", SCO.connection.isActive);
        let minScore = SCO.get("cmi.core.score.min");
        let maxScore=SCO.get("cmi.core.score.max")
        console.log(maxScore);
        console.log(init);
        if(!minScore){
            SCO.set("cmi.core.score.min", 0)
            SCO.set("cmi.core.score.max", init.questions.length)
        }
        let lmsData = SCO.get("cmi.suspend_data");
      let finalScore = SCO.get("cmi.core.score.raw")
        console.log(finalScore);
        console.log("LMS DATA: ", lmsData);

        if (lmsData.length) {
            selectedAns = JSON.parse(lmsData);

        }

        // selectedAns.map(id => {

        //     console.log(id);
        //     document.getElementById(id).classList.add("completed");
        //     return id;

        // })




        //  document.getElementById(id).classList.add("selected");
        console.log("DATA: ", lmsData);
    }

    try {
        addScorm();
    } catch (err) {
    }


    $.fn.jquizzy = function (settings) {

        var defaults = {
            questions: null,
            twitterStatus: 'Wow! i have scored {score}% on MangoReader Book http://mangoreader.com- We bring Books to Life via @mangoreader',
            startText: 'Let\'s get started!',
            endText: 'Finished!',
            splashImage: 'images/quizzy/index.jpeg',
            //twitterImage: 'images/quizzy/share.png',
            //facebookImage: 'images/quizzy/share.png',
            resultComments: {
                perfect: '',
                excellent: '',
                good: '',
                average: '',
                bad: '',
                poor: '',
                worst: ''
            }

        };
        
        var sliderctr = 1;
        var config = $.extend(defaults, settings);
        config.questions = $.grep(config.questions, function (n, i) {
            return (n !== "" && n != null);
        });
        if (config.questions === null) {
            $(this).html('<div class="intro-container slide-container"><h2 class="qTitle">Failed to parse questions.</h2></div>');
            return;
        }
        //console.log("*****: ", config.questions);

        var superContainer = $(this),
            answers = [],
            introFob = '	<div class="intro-container slide-container"><div class="question-number">' + config.startText + '</div><a class="nav-start" href="#"><img src="' + config.splashImage + '" /></a></div>	',
            exitFob = '<div class="results-container slide-container"><div class="Finished">' + config.endText + '</div><div class="result-keeper"></div></div><div class="notice">Please select an option</div><div class="progress-keeper" ><div class="progress"></div></div>',
            contentFob = '';
        superContainer.addClass('main-quiz-holder');


        //selectedAns = ["op0", "op1", "op0", "op0", "op1"]
        for (questionsIteratorIndex = 0; questionsIteratorIndex < config.questions.length; questionsIteratorIndex++) {
            contentFob += '<div class="slide-container"><div class="question-number">' + (questionsIteratorIndex + 1) + ' out of ' + config.questions.length + '</div><div class="question">' + config.questions[questionsIteratorIndex].question + '</div><ul class="answers">';
            for (answersIteratorIndex = 0; answersIteratorIndex < config.questions[questionsIteratorIndex].answers.length; answersIteratorIndex++) {
                try {
                    let cls = "";
                    if(selectedAns[questionsIteratorIndex].trim() === "op"+answersIteratorIndex){
                       console.log("selected");
                        cls = "selected";
                    }
                    contentFob += '<li class="op' + answersIteratorIndex + ' '+ cls+'">' + config.questions[questionsIteratorIndex].answers[answersIteratorIndex] + '</li>';
                } catch (error) {
                    contentFob += '<li>' + config.questions[questionsIteratorIndex].answers[answersIteratorIndex] + '</li>';
                }
               
            }


            contentFob += '</ul><div class="nav-container">';


            if (questionsIteratorIndex !== 0) {

                contentFob += '<div class="sliderprev"></div>';
                contentFob += '<div class="bluebtn1">1</div>';
                contentFob += '<div class="bluebtn2">2</div>';
                contentFob += '<div class="bluebtn3">3</div>';
                contentFob += '<div class="bluebtn4">4</div>';
                contentFob += '<div class="bluebtn5">5</div>';
                contentFob += '<div class="bluebtn6">6</div>';
                contentFob += '<div class="bluebtn7">7</div>';
                contentFob += '<div class="bluebtn8">8</div>';
                contentFob += '<div class="bluebtn9">9</div>';
                contentFob += '<div class="bluebtn10">10</div>';
                contentFob += '<div class="slidernext"></div>';

            }

            if (questionsIteratorIndex < config.questions.length - 1) {
                contentFob += '<div class="reset"><span class="nav-reset" href="">Reset</span></div>';
                contentFob += '<div class=""><span class="nav-next" href=""></span></div>';


                contentFob += '<div class="sliderprev"></div>'
                contentFob += '<div class="bluebtn1">1</div>';
                contentFob += '<div class="bluebtn2">2</div>';
                contentFob += '<div class="bluebtn3">3</div>';
                contentFob += '<div class="bluebtn4">4</div>';
                contentFob += '<div class="bluebtn5">5</div>';
                contentFob += '<div class="bluebtn6">6</div>';
                contentFob += '<div class="bluebtn7">7</div>';
                contentFob += '<div class="bluebtn8">8</div>';
                contentFob += '<div class="bluebtn9">9</div>';
                contentFob += '<div class="bluebtn10">10</div>';
                contentFob += '<div class="slidernext"></div>';
            }
            else {
                contentFob += '<div class="reset"><span class="nav-reset" href="#">Reset</span></div>';
                contentFob += '<div class="next final"><span class="nav-show-result" href="#">Check</span></div>';
            }

            contentFob += '</div></div>';
            answers.push(config.questions[questionsIteratorIndex].correctAnswer);
        }

        superContainer.html(contentFob + exitFob);

        var progress = superContainer.find('.progress'),
            progressKeeper = superContainer.find('.progress-keeper'),
            notice = superContainer.find('.notice'),
            progressWidth = progressKeeper.width(),
            userAnswers = [],
            questionLength = config.questions.length,
            resultArr = [],
            // SCO;
            slidesList = superContainer.find('.slide-container');




        // function saveData() {
        //     SCO.set("cmi.suspend_data", JSON.stringify(resultArr));
        //     SCO.save();
        // }


        function checkAnswers() {
            
            flag = false;
            for (i = 0; i < answers.length; i++) {
                if (answers[i] == userAnswers[i]) {

                    flag = true;
                }
                else {
                    flag = false;
                }
                resultArr.push(flag);
            }
            console.log(resultArr);
            // SCO.set("cmi.suspend_data", JSON.stringify(resultArr));
            // SCO.save()
            // var rajji = SCO.get("cmi.suspend_data");
            // console.log(rajji);
            return resultArr;

            // SCO = pipwerks.SCORM;
            // SCO.connection.initialize();
            // console.log("INIT:  ",SCO.connection.isActive);

            //  let lmsData = SCO.get("cmi.suspend_data");

            //  console.log("LMS DATA: ", lmsData);

            // if(lmsData.length){
            //      resultArr = JSON.parse(lmsData);

            //  }

            //  console.log("DATA: ", lmsData);


        }
        console.log(userAnswers, "******************");
        console.log(resultArr, "/////////////++++++++++");
        // SCO.set("cmi.suspend_data", JSON.stringify(resultArr));
        // SCO.save();



        function roundReloaded(num, dec) {
            var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
            return result;


        }

        function judgeSkills(score) {
            var returnString;
            if (score == 100) return '';
            else if (score > 90) return '';
            else if (score > 70) return '';
            else if (score > 50) return '';
            else if (score > 35) return '';
            else if (score > 20) return '';
            else return '';

        }

        progressKeeper.hide();
        notice.hide();
        slidesList.hide().first().fadeIn(0);
        //////////////////////////////////////////////////////////////////////////////
        var btn1 = true;
        var btn2 = true;
        var btn3 = true;
        var btn4 = true;
        var btn5 = true;
        var btn6 = true;
        var btn7 = true;
        var btn8 = true;
        var btn9 = true;
        var btn10 = true;

        ////////////////////////////////////////////////////////////////////////// btn 1
        superContainer.find('.bluebtn1').click(function () {
            clearTimeout(nextQuesTimer);
            //			alert("bb1");
            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.2);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {
                //alert("slider counter"+sliderctr);
                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');


                //if(sliderctr == 1)
                //					{		
                //					sliderctr+=1;		
                //					$(this).next().fadeIn(0);
                //					$('.bluebtn1').css('background-position', '0 -40px');
                //					}
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }
                //		alert("slidercounter"+sliderctr)
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr = 1;
                    return;
                }

                if (sliderctr == 2) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }


                if (sliderctr == 3) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 5;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 6;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 7;
                    return;

                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 8;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    sliderctr -= 9;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });

        ////////////////////////////////////////////////////////////////////// btn2
        superContainer.find('.bluebtn2').click(function () {
            clearTimeout(nextQuesTimer);
            //alert("bb2");
            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');

                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }
                //alert("slider counter"+sliderctr);
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (sliderctr == 1) {


                    $(this).next().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 2) {


                    $(this).fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    //sliderctr =2;
                    return;
                }


                //if(sliderctr == 2)
                //					{		
                //					sliderctr+=4;		
                //					$(this).next().next().next().next().fadeIn(0);
                //					$('.bluebtn2').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 3) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 5;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 6;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 7;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    sliderctr -= 8;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });


        /////////////////////////////////////////////////////////////////////// btn 3
        superContainer.find('.bluebtn3').click(function () {
            clearTimeout(nextQuesTimer);
            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');

                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (sliderctr == 1) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 3) {

                    $(this).fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr = 3;
                    return;
                }



                //	if(sliderctr == 3)
                //					{			
                //					sliderctr-=1;	
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn3').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 4) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;

                }
                if (sliderctr == 6) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 5;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 6;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    sliderctr -= 7;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });


        ////////////////////////////////////////////////////////////////////////////////////////// btn 4
        superContainer.find('.bluebtn4').click(function () {
            clearTimeout(nextQuesTimer);
            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }


                if (sliderctr == 4) {

                    $(this).fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr = 4;
                    return;
                }




                //	if(sliderctr == 4)
                //					{			
                //					sliderctr-=2;	
                //					$(this).prev().prev().fadeIn(0);
                //					$('.bluebtn4').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 5) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;

                }
                if (sliderctr == 8) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 5;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    sliderctr -= 6;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });

        ////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////// btn 5
        superContainer.find('.bluebtn5').click(function () {
            clearTimeout(nextQuesTimer);

            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');

                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (sliderctr == 1) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr = 5;
                    return;
                }




                //if(sliderctr == 5)
                //					{			
                //					sliderctr-=1;	
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn5').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 6) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn5').css('background-position', '0 -40px');
                    sliderctr -= 5;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });
        ////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////// btn 7
        superContainer.find('.bluebtn7').click(function () {
            clearTimeout(nextQuesTimer);
            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn7').css('background-position', '0 -40px');
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 6;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().next().next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 5;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 7) {

                    $(this).fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr = 7;
                    return;
                }

                //if(sliderctr == 7)
                //					{			
                //					sliderctr-=1;	
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn7').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 8) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn7').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });



        /////////////////////////////////////////////////////////////////////////////////////////// btn 8
        superContainer.find('.bluebtn8').click(function () {
            clearTimeout(nextQuesTimer);

            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn8').css('background-position', '0 -40px');
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 7;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 6;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().next().next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 5;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;

                }
                if (sliderctr == 7) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 8) {

                    $(this).fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr = 8;
                    return;
                }





                //if(sliderctr == 8)
                //					{				
                //					sliderctr-=1;
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn8').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 9) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn8').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });


        //////////////////////////////////////////////////////////////////////////////////////////

        superContainer.find('.bluebtn6').click(function () {
            clearTimeout(nextQuesTimer);

            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn6').css('background-position', '0 -40px');
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).next().next().next().next().next().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr += 5;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 6) {

                    $(this).fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr = 6;
                    return;
                }



                if (sliderctr == 7) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).prev().prev().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr -= 2;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).prev().prev().prev().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr -= 3;
                    return;
                }
                if (sliderctr == 10) {

                    $(this).prev().prev().prev().prev().fadeIn(0);
                    $('.bluebtn6').css('background-position', '0 -40px');
                    sliderctr -= 4;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });





        ///////////////////////////////////////////////////////////////////////////////// btn 9

        superContainer.find('.bluebtn9').click(function () {
            clearTimeout(nextQuesTimer);

            $('.question').css('text-indent', '-28px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.7);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn9').css('background-position', '0 -40px');

                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (sliderctr == 1) {

                    $(this).next().next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 8;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 7;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 6;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().next().next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 5;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }

                if (sliderctr == 9) {

                    $(this).fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr = 9;
                    return;
                }

                //if(sliderctr == 9)
                //					{			
                //					sliderctr-=1;	
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn9').css('background-position', '0 -40px');
                //					}
                if (sliderctr == 10) {

                    $(this).prev().fadeIn(0);
                    $('.bluebtn9').css('background-position', '0 -40px');
                    sliderctr -= 1;
                    return;
                }

            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;

        });

        ///////////////////////////////////////////////////////////////////////////////////////////////// btn 10
        superContainer.find('.bluebtn10').click(function () {

            clearTimeout(nextQuesTimer);
            $('.question').css('text-indent', '-41px');
            $('.sliderprev').css('opacity', 0.7);
            $('.slidernext').css('opacity', 0.2);
            $(this).parents('.slide-container').fadeOut(0, function () {

                //$(this).next().next().next().next().next().fadeIn(0);
                //$('.bluebtn10').css('background-position', '0 -40px');
                //////////////////////////////////////////////////////////////////////////////////////////////////make other grey
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 0');

                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                if (sliderctr == 1) {

                    $(this).next().next().next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 9;
                    return;
                }
                if (sliderctr == 2) {

                    $(this).next().next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 8;
                    return;
                }
                if (sliderctr == 3) {

                    $(this).next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 7;
                    return;
                }
                if (sliderctr == 4) {

                    $(this).next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 6;
                    return;
                }
                if (sliderctr == 5) {

                    $(this).next().next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 5;
                    return;
                }
                if (sliderctr == 6) {

                    $(this).next().next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 4;
                    return;
                }
                if (sliderctr == 7) {

                    $(this).next().next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 3;
                    return;
                }
                if (sliderctr == 8) {

                    $(this).next().next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 2;
                    return;
                }
                if (sliderctr == 9) {

                    $(this).next().fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr += 1;
                    return;
                }


                if (sliderctr == 10) {

                    $(this).fadeIn(0);
                    $('.bluebtn10').css('background-position', '0 -40px');
                    sliderctr = 10;
                    return;
                }


                //if(sliderctr == 10)
                //					{			
                //					sliderctr-=1;	
                //					$(this).prev().fadeIn(0);
                //					$('.bluebtn10').css('background-position', '0 -40px');
                //					}

                //sliderctr==9;
            });
            //sliderctr+=5;
            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            //	sliderctr+=5;
            return false;
            //sliderctr+=5;
            //	var btn1 = true;
            //		var btn2 = true;
            //		var btn3 = true;
            //		var btn4 = true;
            //		var btn5 = true;
            //		var btn6 = true;
            //		var btn7 = true;
            //		var btn8 = true;
            //		var btn9 = true;
            //		var btn10 = true;

        });
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        superContainer.find('li').click(function () {
            var thisLi = $(this);
            //$('.main-quiz-holder .slide-container .reset');	
            //var value=
            console.log(thisLi.attr('class'))
            thisLi.attr('id', sliderctr);
            //alert(this.attr('id'));
            if (thisLi.hasClass('selected')) {
                thisLi.removeClass('selected');

                if (sliderctr == 1) {
                    //sliderctr+=9;		
                    //$(this).next().next().next().next().next().next().next().next().next().fadeIn(0);
                    $('.bluebtn1').css('background-position', '0 -40px');
                    $(this).fadeIn(0);
                    btn1 = true;
                    //alert(""+superContainer.find('li.selected').attr('id'));					//$(this).parents('.slide-container').find('li.selected').removeClass('selected');
                    superContainer.find('#1').removeClass('selected');
                    selectedAns[0] = null;
                    console.log(thisLi.attr('class'));
                    return;
                }
                if (sliderctr == 2) {
                    // sliderctr -= 1;
                    $(this).fadeIn(0);
                    $('.bluebtn2').css('background-position', '0 -40px');
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    btn2 = true;
                    //alert(""+superContainer.find('li.selected').attr('id'));					//$(this).parents('.slide-container').find('li.selected').removeClass('selected');
                    superContainer.find('#2').removeClass('selected');
                    selectedAns[1] = null;
                    return;
                }
                if (sliderctr == 3) {
                    // sliderctr -= 2;
                    $(this).fadeIn(0);
                    $('.bluebtn3').css('background-position', '0 -40px');
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    btn3 = true;
                    superContainer.find('#3').removeClass('selected');
                    selectedAns[2] = null;
                    return;
                }
                if (sliderctr == 4) {
                    //   sliderctr -= 3;
                    $(this).fadeIn(0);
                    $('.bluebtn4').css('background-position', '0 -40px');
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    btn4 = true;
                    superContainer.find('#4').removeClass('selected');
                    selectedAns[3] = null;
                    return;
                }
                if (sliderctr == 5) {
                    //sliderctr -= 4;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn5').css('background-position', '0 -40px');
                    btn5 = true;
                    superContainer.find('#5').removeClass('selected');
                    selectedAns[4] = null;
                    return;
                }
                if (sliderctr == 6) {
                    //sliderctr -= 5;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn6').css('background-position', '0 -40px');
                    btn6 = true;
                    superContainer.find('#6').removeClass('selected');
                    selectedAns[5] = null;
                    return;
                }
                if (sliderctr == 7) {
                    // sliderctr -= 6;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn7').css('background-position', '0 -40px');
                    btn7 = true;
                    superContainer.find('#7').removeClass('selected');
                    selectedAns[6] = null;
                    return;
                }
                if (sliderctr == 8) {
                    //  sliderctr -= 7;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn8').css('background-position', '0 -40px');
                    btn8 = true;
                    superContainer.find('#8').removeClass('selected');
                    selectedAns[7] = null;
                    return;
                }
                if (sliderctr == 9) {
                    //sliderctr -= 8;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn9').css('background-position', '0 -40px');
                    btn9 = true;
                    superContainer.find('#9').removeClass('selected');
                    selectedAns[8] = null;
                    return;
                }
                if (sliderctr == 10) {
                    //sliderctr -= 9;
                    $(this).fadeIn(0);
                    //$('.bluebtn10').css('background-position', '0 -40px');
                    $('.bluebtn10').css('background-position', '0 -40px');
                    btn10 = true;
                    superContainer.find('#10').removeClass('selected');
                    selectedAns[9] = null;
                    return;
                }
            }

            else {

                if (sliderctr == 1) {
                    btn1 = false;
                    $('.bluebtn1').css('background-position', '0 -80px');

                    selectedAns[0] = thisLi.attr('class');
                    console.log(thisLi.attr('class'));
                }

                if (sliderctr == 2) {

                    btn2 = false;
                    $('.bluebtn2').css('background-position', '0 -80px');
                    selectedAns[1] = thisLi.attr('class');
                    console.log(thisLi.attr('class'));
                }

                if (sliderctr == 3) {
                    btn3 = false;
                    $('.bluebtn3').css('background-position', '0 -80px');
                    selectedAns[2] = thisLi.attr('class');
                }

                if (sliderctr == 4) {
                    btn4 = false;
                    $('.bluebtn4').css('background-position', '0 -80px');
                    selectedAns[3] = thisLi.attr('class');
                }
                if (sliderctr == 5) {
                    btn5 = false;
                    $('.bluebtn5').css('background-position', '0 -80px');
                    selectedAns[4] = thisLi.attr('class');
                }
                if (sliderctr == 6) {
                    btn6 = false;
                    $('.bluebtn6').css('background-position', '0 -80px');
                    selectedAns[5] = thisLi.attr('class');
                }
                if (sliderctr == 7) {
                    btn7 = false;
                    $('.bluebtn7').css('background-position', '0 -80px');
                    selectedAns[6] = thisLi.attr('class');
                }
                if (sliderctr == 8) {
                    btn8 = false;
                    $('.bluebtn8').css('background-position', '0 -80px');
                    selectedAns[7] = thisLi.attr('class');
                }
                if (sliderctr == 9) {
                    btn9 = false;
                    $('.bluebtn9').css('background-position', '0 -80px');
                    selectedAns[8] = thisLi.attr('class');
                }
                if (sliderctr == 10) {
                    btn10 = false;
                    $('.bluebtn10').css('background-position', '0 -80px');
                    selectedAns[9] = thisLi.attr('class');
                }
                thisLi.parents('.answers').children('li').removeClass('selected');
                thisLi.addClass('selected');
            }

            // SCO.set()

            let status = SCO.get("cmi.core.lesson_status");
            if (status !== "completed") {
            SCO.set("cmi.suspend_data", JSON.stringify(selectedAns));
            SCO.save()
            }
           var getSlectedAns= SCO.get("cmi.suspend_data");
            console.log(getSlectedAns);

            curObjName = $(this);

            clearTimeout(nextQuesTimer);
            nextQuesTimer = setTimeout(function () {

                if (sliderctr < 10) {
                    curObjName.parents('.slide-container').fadeOut(0, function () {
                        //sliderctr++;
                        $(this).next().fadeIn(0);
                    });
                    onNextClick();
                }

                /*else{
                    onFinalClick()
                }*/
            }, 1000);
        });


        superContainer.find('.reset').click(function () {
             selectedAns = ["","","","","","","","","",""]
             //location.reload();
            $("li.selected").removeClass("selected");
        });


        superContainer.find('.nav-start').click(function () {

            $(this).parents('.slide-container').fadeOut(0, function () {
                $(this).next().fadeIn(0);
                progressKeeper.fadeIn(0);
            });
            return false;

        });




        superContainer.find('.next').click(function () {
            notice.hide();

            ////////////////////////////////////////

            //////////////////////////////////////
            if (sliderctr < 10) {
                //if (answers[i] == userAnswers[i])
                //					{
                //						alert("Right");
                //						
                //						
                //					}

                $('.sliderprev').css('opacity', 0.7);
                $(this).parents('.slide-container').fadeOut(0, function () {
                    sliderctr++;
                    //$(this).next().fadeIn(0);
                });
                $('.question').css('text-indent', '-28px');
            }
            if (sliderctr == 9) {
                $('.question').css('text-indent', '-41px');
                $('.slidernext').css('opacity', 0.2);
            }

            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            return false;
        });


        superContainer.find('.slidernext').click(onNextClick);

        // function addScorm() {
        //     SCO = pipwerks.SCORM;
        //     SCO.connection.initialize();
        //     console.log("INIT:  ", SCO.connection.isActive);

        //     let lmsData = SCO.get("cmi.suspend_data");

        //     console.log("LMS DATA: ", lmsData);

        //     if (lmsData.length) {
        //         resultArr = JSON.parse(lmsData) || resultArr;

        //     }

        //     console.log("DATA: ", lmsData);
        // }

        function onNextClick() {
            //selectedAns = ["op1", "op2", "op1", "op1", "op0", "op0", "op3"];
            clearTimeout(nextQuesTimer);
            notice.hide();
            console.log("**********", sliderctr);
            if (sliderctr < 10) {

                sliderctr++;
                if (sliderctr == 1) {
                    $('.bluebtn1').css('background-position', '0 -40px');
                }

                if (sliderctr == 2) {
                    //$('.bluebtn1').css('background-position', '0 0');
                    //if(btn1 == false)
                    //					{
                    //						$('.bluebtn1').css('background-position', '0 -80px');
                    //						$('.bluebtn2').css('background-position', '0 -40px');
                    //					}
                    //					else
                    //					{
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 -40px');
                    //
                }

                if (sliderctr == 3) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 -40px');
                }

                if (sliderctr == 4) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 -40px');
                }
                if (sliderctr == 5) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 0');
                    $('.bluebtn5').css('background-position', '0 -40px');
                }
                if (sliderctr == 6) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 0');
                    $('.bluebtn5').css('background-position', '0 0');
                    $('.bluebtn6').css('background-position', '0 -40px');
                }
                if (sliderctr == 7) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 0');
                    $('.bluebtn5').css('background-position', '0 0');
                    $('.bluebtn6').css('background-position', '0 0');
                    $('.bluebtn7').css('background-position', '0 -40px');
                }
                if (sliderctr == 8) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 0');
                    $('.bluebtn5').css('background-position', '0 0');
                    $('.bluebtn6').css('background-position', '0 0');
                    $('.bluebtn7').css('background-position', '0 0');
                    $('.bluebtn8').css('background-position', '0 -40px');
                }
                if (sliderctr == 9) {
                    $('.bluebtn1').css('background-position', '0 0');
                    $('.bluebtn2').css('background-position', '0 0');
                    $('.bluebtn3').css('background-position', '0 0');
                    $('.bluebtn4').css('background-position', '0 0');
                    $('.bluebtn5').css('background-position', '0 0');
                    $('.bluebtn6').css('background-position', '0 0');
                    $('.bluebtn7').css('background-position', '0 0');
                    $('.bluebtn8').css('background-position', '0 0');
                    $('.bluebtn9').css('background-position', '0 -40px');
                }


                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');


                }
                //if(sliderctr == 10)
                //				{				
                //				$('.bluebtn10').css('background-position', '0 -40px');
                //				}


                $('.sliderprev').css('opacity', 0.7);
                $(this).parents('.slide-container').fadeOut(0, function () {
                    //sliderctr++;
                    $(this).next().fadeIn(0);
                });
                

                $('.question').css('text-indent', '-28px');

            }
            if (sliderctr == 10) {
                $('.bluebtn1').css('background-position', '0 0');
                $('.bluebtn2').css('background-position', '0 0');
                $('.bluebtn3').css('background-position', '0 0');
                $('.bluebtn4').css('background-position', '0 0');
                $('.bluebtn5').css('background-position', '0 0');
                $('.bluebtn6').css('background-position', '0 0');
                $('.bluebtn7').css('background-position', '0 0');
                $('.bluebtn8').css('background-position', '0 0');
                $('.bluebtn9').css('background-position', '0 0');
                $('.bluebtn10').css('background-position', '0 -40px');


                if (btn1 == false) {
                    $('.bluebtn1').css('background-position', '0 -80px');

                }
                if (btn2 == false) {
                    $('.bluebtn2').css('background-position', '0 -80px');

                }
                if (btn3 == false) {
                    $('.bluebtn3').css('background-position', '0 -80px');

                }
                if (btn4 == false) {
                    $('.bluebtn4').css('background-position', '0 -80px');

                }
                if (btn5 == false) {
                    $('.bluebtn5').css('background-position', '0 -80px');

                }
                if (btn6 == false) {
                    $('.bluebtn6').css('background-position', '0 -80px');

                }
                if (btn7 == false) {
                    $('.bluebtn7').css('background-position', '0 -80px');

                }
                if (btn8 == false) {
                    $('.bluebtn8').css('background-position', '0 -80px');

                }
                if (btn9 == false) {
                    $('.bluebtn9').css('background-position', '0 -80px');

                }
                if (btn10 == false) {
                    $('.bluebtn10').css('background-position', '0 -80px');

                }
                $('.question').css('text-indent', '-41px');
            }
            if (sliderctr > 9)
                $('.slidernext').css('opacity', 0.2);

            progress.animate({
                width: progress.width() + Math.round(progressWidth / questionLength)
            }, 0);
            return false;

            // addScorm()


        };

        /*superContainer.find('.bluebtn1').click(function () 
        {
        if(sliderctr > 1)
        {
        $(this).parents('.slide-container').fadeOut(0, function () 
        {
        sliderctr--;
        $('.bluebtn1').css('background-position', '0 -40px');
        $('.bluebtnactive2').css('background-position', '0 0px');
        $('.bluebtnactive3').css('background-position', '0 0px');
        $('.bluebtnactive4').css('background-position', '0 0px');
        $(this).prev().fadeIn(0);	
        });
        }
            	
        progress.animate(
        {
        width: progress.width() + Math.round(progressWidth / questionLength)
        }, 0);
        return false;
        });*/


        /*superContainer.find('.bluebtn2').click(function () 
        {
        sliderctr = 2;
        notice.hide();
        $(this).parents('.slide-container').fadeOut(0, function () 
        {
        $(this).next().fadeIn(0);
        });
        	
        progress.animate({
        width: progress.width() + Math.round(progressWidth / questionLength)}, 0);
        return false;
        });
    	
        superContainer.find('.bluebtn3').click(function () 
        {
        sliderctr = 3;
        notice.hide();
        $(this).parents('.slide-container').fadeOut(0, function () 
        {
        if(questionsIteratorIndex = 1)
        {
        $(this).next().fadeIn(0);
        }
        });
        	
        progress.animate({
        width: progress.width() + Math.round(progressWidth / questionLength)}, 0);
        return false;
        });*/

        /*superContainer.find('.prev').click(function () 
        {
        sliderctr--;
        notice.hide();
        $(this).parents('.slide-container').fadeOut(0, function () {
        $(this).prev().fadeIn(0);
        });

        progress.animate({
        width: progress.width() - Math.round(progressWidth / questionLength)
        }, 0);
        return false;
        });*/


        superContainer.find('.sliderprev').click(onPrevClick);

        function onPrevClick() {
            clearTimeout(nextQuesTimer);
            notice.hide();
            $('.question').css('text-indent', '-28px');
            if (sliderctr > 1) {
                $('.slidernext').css('opacity', 0.7);
                $(this).parents('.slide-container').fadeOut(0, function () {
                    sliderctr--;
                    $(this).prev().fadeIn(0);

                    //if(sliderctr == 1)
                    //				{				
                    //				$('.bluebtn1').css('background-position', '0 -40px');
                    //				}
                    //				
                    //				if(sliderctr == 2)
                    //				{				
                    //				$('.bluebtn2').css('background-position', '0 -40px');
                    //				}
                    //				
                    //				if(sliderctr == 3)
                    //				{				
                    //				$('.bluebtn3').css('background-position', '0 -40px');
                    //				}
                    //				
                    //				if(sliderctr == 4)
                    //				{				
                    //				$('.bluebtn4').css('background-position', '0 -40px');
                    //				}
                    //				if(sliderctr == 5)
                    //				{				
                    //				$('.bluebtn5').css('background-position', '0 -40px');
                    //				}
                    //				if(sliderctr == 6)
                    //				{				
                    //				$('.bluebtn6').css('background-position', '0 -40px');
                    //				}
                    //				if(sliderctr == 7)
                    //				{				
                    //				$('.bluebtn7').css('background-position', '0 -40px');
                    //				}
                    //				if(sliderctr == 8)
                    //				{				
                    //				$('.bluebtn8').css('background-position', '0 -40px');
                    //				}
                    //				if(sliderctr == 9)
                    //				{				
                    //				$('.bluebtn9').css('background-position', '0 -40px');
                    //				}
                    ///////////////////////////////////

                    if (sliderctr == 1) {
                        $('.bluebtn1').css('background-position', '0 -40px');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0')
                    }

                    if (sliderctr == 2) {

                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 -40px');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0')


                    }

                    if (sliderctr == 3) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 -40px');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0')
                    }

                    if (sliderctr == 4) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 -40px');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0')
                    }
                    if (sliderctr == 5) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 -40px');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0');
                    }
                    if (sliderctr == 6) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 -40px');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0');
                    }
                    if (sliderctr == 7) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 -40px');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0');
                    }
                    if (sliderctr == 8) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 -40px');
                        $('.bluebtn9').css('background-position', '0 0');
                        $('.bluebtn10').css('background-position', '0 0');
                    }
                    if (sliderctr == 9) {
                        $('.bluebtn1').css('background-position', '0 0');
                        $('.bluebtn2').css('background-position', '0 0');
                        $('.bluebtn3').css('background-position', '0 0');
                        $('.bluebtn4').css('background-position', '0 0');
                        $('.bluebtn5').css('background-position', '0 0');
                        $('.bluebtn6').css('background-position', '0 0');
                        $('.bluebtn7').css('background-position', '0 0');
                        $('.bluebtn8').css('background-position', '0 0');
                        $('.bluebtn9').css('background-position', '0 -40px');
                        $('.bluebtn10').css('background-position', '0 0');
                    }

                    ///////////////////////////////// boolean
                    if (btn1 == false) {
                        $('.bluebtn1').css('background-position', '0 -80px');

                    }
                    if (btn2 == false) {
                        $('.bluebtn2').css('background-position', '0 -80px');

                    }
                    if (btn3 == false) {
                        $('.bluebtn3').css('background-position', '0 -80px');

                    }
                    if (btn4 == false) {
                        $('.bluebtn4').css('background-position', '0 -80px');

                    }
                    if (btn5 == false) {
                        $('.bluebtn5').css('background-position', '0 -80px');

                    }
                    if (btn6 == false) {
                        $('.bluebtn6').css('background-position', '0 -80px');

                    }
                    if (btn7 == false) {
                        $('.bluebtn7').css('background-position', '0 -80px');

                    }
                    if (btn8 == false) {
                        $('.bluebtn8').css('background-position', '0 -80px');

                    }
                    if (btn9 == false) {
                        $('.bluebtn9').css('background-position', '0 -80px');

                    }
                    if (btn10 == false) {
                        $('.bluebtn10').css('background-position', '0 -80px');

                    }

                    ////////////////////////////////////////////////////////

                });



            }

            if (sliderctr < 2)
                $('.sliderprev').css('opacity', 0.2);

            progress.animate({
                width: progress.width() - Math.round(progressWidth / questionLength)
            }, 0);
            return false;
        };



        superContainer.find('.final').click(onFinalClick);
        function onFinalClick() {
            clearTimeout(nextQuesTimer);
            // if ($(this).parents('.slide-container').find('li.selected').length === 0) 
            //{
            //notice.fadeIn(100);
            //return false;
            //}

            superContainer.find('ul.answers').each(function (index) {

                userAnswers.push($(this).children('li').index($(this).find('li.selected')) + 1);

                console.log("-------------------------------------------------hello");


                //ya save karna hai.../.....
                // SCO.set("cmi.suspend_data", JSON.stringify(resultArr));
                // SCO.save();




            });
            //                            superContainer.find('li.selected').each(function (index) {
            //                    userAnswers.push($(this).parents('.answers').children('li').index($(this).parents('.answers').find('li.selected')) + 1);
            //                    alert(userAnswers);
            //                });

            console.log(userAnswers);

            // SCO.set("cmi.suspend_data", JSON.stringify(userAnswers));
            //          SCO.save()
            progressKeeper.hide();
            var results = checkAnswers(),
                resultSet = '',
                trueCount = 0,
                shareButton = '',
                score;

                //  try {
                //     resultSet += '<div id="rSet" class="lReset" onClick="ref()"><span class="nav-reset" href="">Reset</span></div>';
                // } catch (error) {
                //     resultSet += '<div id="rSet" class="lReset" onClick="ref()"><span class="nav-reset" href="">Reset</span></div>';
                // }
            resultSet += '<div id="rSet" class="lReset" onClick="ref()"><span class="nav-reset" href="">Reset</span></div>';
            for (var i = 0, toLoopTill = results.length; i < toLoopTill; i++)
            //for (var i = 0, toLoopTill = 2; i < toLoopTill; i++) 
            {
                if (results[i] === true) {
                    trueCount++;
                    isCorrect = true;
                }


                resultSet += '<div class="result-row"> Question ' + (i + 1) + (results[i] === true ? "<div class='correct'><span>Correct</span></div>" : "<div class='wrong'><span>Incorrect</span></div>");

                var classestoAdd = '';
                if (i == 3 || i == 2 || i == 6 || i == 7) {
                    classestoAdd += '"left:-373px;"';
                }
                if (i == 8) {
                    classestoAdd += '"top: -140px;"';
                }
                if (i == 9) {
                    classestoAdd += '"top: -140px; text-indent: -24px;"';
                }
                resultSet += '<div class="resultsview-qhover" style=' + classestoAdd + '>' + config.questions[i].question;
                if (config.questions[i].img != 'NULL') {
                    resultSet;
                }
                resultSet += "<ul>";
                for (answersIteratorIndex = 0; answersIteratorIndex < config.questions[i].answers.length; answersIteratorIndex++)
                //for (answersIteratorIndex = 0; answersIteratorIndex <9; answersIteratorIndex++) 
                {
                    var classestoAdd = '';
                    if (config.questions[i].correctAnswer == answersIteratorIndex + 1) {
                        classestoAdd += 'right';
                    }
                    if (userAnswers[i] == answersIteratorIndex + 1) {
                        classestoAdd += ' selected';
                    }
                    resultSet += '<li class="' + classestoAdd + '">' + config.questions[i].answers[answersIteratorIndex] + '</li>';

                }
                resultSet += '</ul></div></div>';

            }
            score = roundReloaded(trueCount / questionLength * 100, 2);
            shareButton = config.twitterStatus.replace("{score}", score);
            console.log(trueCount);
            let status = SCO.get("cmi.core.lesson_status");
            if (status !== "completed") {
                SCO.set("cmi.core.score.raw", trueCount);
                SCO.save()	
            }   
                SCO.set("cmi.core.lesson_status", "completed");
			SCO.save();
            
            var btitle = "Inquisitive Science"
            var fShareButton = '<a href="https://www.facebook.com/dialog/feed?app_id=344525655596295&amp;link=http://www.mangoreader.com/store&amp;picture=http://mangoreader.com/images/mango2/logo.png&amp;name=' + 'Book: ' + btitle + '&amp;caption=Hurray!%20I%20have%20scored%20' + score + '% on%20MangoReader%20Book-%20We%20bring%20Books%20to%20Life&amp;redirect_uri=http://www.mangoreader.com" class="share-button" target="_blank"></a> ';

            resultSet = '<h2 class="qTitle">' + judgeSkills(score) + ' You scored ' + score + '%</h2>' + fShareButton + resultSet + '<div class="jquizzy-clear"></div>';
            superContainer.find('.result-keeper').html(resultSet).show(0);
            superContainer.find('.resultsview-qhover').hide();
            superContainer.find('.result-row').hover(function () {
                $(this).find('.resultsview-qhover').show();
            }, function () {
                $(this).find('.resultsview-qhover').hide();
            });
            $(this).parents('.slide-container').fadeOut(0, function () {
                $(this).next().fadeIn(0);
            });
            return false;
        };
    };
})(jQuery);

