﻿var isFadedIn = "";

function FadeInInsight(objName,fadeSpeed,fadeCount)
{
    document.getElementById(objName.replace("p#","")).style.display = "";
    
    fadeCount = fadeCount + 1200;
    
    if(fadeCount > 0)
    {
        setTimeout("$(\"" + objName + "\").fadeIn(" + fadeSpeed + ");",fadeCount);
    }else{
        $(objName).fadeIn(fadeSpeed);
    }
}
 
function nextQuestion()
{
    var isCompleted = false;
    var timeoutnine = 0;
 
    if (document.getElementById("fibrocentertool_question1").style.display != "none")
    {
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_0").checked)
        {
            document.getElementById("fibrocentertool_question1a").style.display = "block";
            Track_Questions_Insights(1, true);
            document.getElementById("progress1q1a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_0").value;
            
            FadeInInsight("p#insight1a",1800,0);
        }
        else if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_1").checked)
        {
            document.getElementById("fibrocentertool_question1b").style.display = "block";
            Track_Questions_Insights(1, true);
            document.getElementById("progress1q1a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_1").value;
            
            FadeInInsight("p#insight1b",1800,0);
        }else{  //No answer picked move on to next question
            document.getElementById("fibrocentertool_question1a").style.display = "block";
            Track_Questions_Insights(1, true);
            document.getElementById("progress1q1a").innerHTML = "&nbsp;";        
            
            FadeInInsight("p#insight1a",1800,0);
        }
        
        document.getElementById("progress1_dot1").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot1").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question1").style.display = "none";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question1a").style.display != "none" 
        && document.getElementById("fibrocentertool_question1a").style.display != "")
    {
        document.getElementById("fibrocentertool_question2").style.display = "block";
        Track_Questions_Insights(2, false);
        
        
        
        document.getElementById("progress1q2").style.display = "block";
        document.getElementById("fibrocentertool_question1a").style.display = "none";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question1b").style.display != "none" 
        && document.getElementById("fibrocentertool_question1b").style.display != "")
    {
        document.getElementById("fibrocentertool_question2").style.display = "block";
        Track_Questions_Insights(2, false);
        
        document.getElementById("progress1q2").style.display = "block";
        document.getElementById("fibrocentertool_question1b").style.display = "none";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question2").style.display != "none" 
        && document.getElementById("fibrocentertool_question2").style.display != "")
    {
        document.getElementById("back").style.display = "block";
        
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2_0").checked)
        {    
            document.getElementById("fibrocentertool_question2a").style.display = "block";
            Track_Questions_Insights(2, true);
            document.getElementById("progress1q2a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2",0);
            
            FadeInInsight("p#insight2a",1800,0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2_1").checked)  
        {    
            document.getElementById("fibrocentertool_question2a").style.display = "block";
            Track_Questions_Insights(2, true);
            document.getElementById("progress1q2a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2",0);
            
            FadeInInsight("p#insight2a",1800,0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2_2").checked)
        {    
            document.getElementById("fibrocentertool_question2a").style.display = "block";
            Track_Questions_Insights(2, true);
            document.getElementById("progress1q2a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2",0);
            
            FadeInInsight("p#insight2a",1800,0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2_3").checked)
        {    
            document.getElementById("fibrocentertool_question2b").style.display = "block";
            Track_Questions_Insights(2, true);
            document.getElementById("progress1q2a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2",0);
            
            FadeInInsight("p#insight2b",1800,0);
        }else{  //No answer picked move on to next question
            document.getElementById("fibrocentertool_question2a").style.display = "block";
            Track_Questions_Insights(2, true);
            document.getElementById("progress1q2a").innerHTML = "&nbsp;";        
            
            FadeInInsight("p#insight2a",1800,0);
        }
        
        
        document.getElementById("progress1_dot2").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot2").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question2").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question2a").style.display != "none" 
        && document.getElementById("fibrocentertool_question2a").style.display != "")
    {
        document.getElementById("fibrocentertool_question3").style.display = "block";
        Track_Questions_Insights(3, false);
        
        document.getElementById("progress1q3").style.display = "block";
        document.getElementById("fibrocentertool_question2a").style.display = "none";
        
    }
    else if (document.getElementById("fibrocentertool_question2b").style.display != "none" 
        && document.getElementById("fibrocentertool_question2b").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2b_0").checked)
        {
            document.getElementById("fibrocentertool_question3").style.display = "block";
            Track_Questions_Insights(3, false);
            

            
            document.getElementById("progress1q3").style.display = "block";
            document.getElementById("fibrocentertool_question2a").style.display = "none";
            document.getElementById("fibrocentertool_question2b").style.display = "none";
            document.getElementById("fibrocentertool_question2c").style.display = "none";
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2b_1").checked)
        {
            //Needs to go somehwere else!
            document.getElementById("fibrocentertool_question2a").style.display = "none";
            document.getElementById("fibrocentertool_question2b").style.display = "none";
            document.getElementById("fibrocentertool_question2c").style.display = "block";
            document.getElementById("next").style.display = "none";
            //isCompleted = true;
        }else{
            document.getElementById("fibrocentertool_question3").style.display = "block";
            Track_Questions_Insights(3, false);
            
            
            
            document.getElementById("progress1q3").style.display = "block";
            document.getElementById("fibrocentertool_question2a").style.display = "none";
            document.getElementById("fibrocentertool_question2b").style.display = "none";
            document.getElementById("fibrocentertool_question2c").style.display = "none";
        }
    }
    else if (document.getElementById("fibrocentertool_question3").style.display != "none" 
        && document.getElementById("fibrocentertool_question3").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_0").checked)
            {
                document.getElementById("fibrocentertool_question3a").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3",0);
                
                FadeInInsight("p#insight3a",1800,0);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_1").checked)
            {
                document.getElementById("fibrocentertool_question3b").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3",0);
                
                FadeInInsight("p#insight3b",1800,0);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_2").checked)
            {
                document.getElementById("fibrocentertool_question3c").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3",0);
                
                FadeInInsight("p#insight3c",1800,0);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_3").checked)
            {
                document.getElementById("fibrocentertool_question3d").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3",0);
                
                FadeInInsight("p#insight3d",1800,0);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_4").checked)
            {
                document.getElementById("fibrocentertool_question3e").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3",0);
                
                FadeInInsight("p#insight3e",1800,0);
            }
        else  //No answer picked move on to next question
            {
                document.getElementById("fibrocentertool_question3a").style.display = "block";
                Track_Questions_Insights(3, true);
                document.getElementById("progress1q3a").innerHTML = "&nbsp;";        
                
                FadeInInsight("p#insight3a",1800,0);
            }
        
        document.getElementById("progress1_dot3").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot3").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question3").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question3a").style.display != "none" 
        && document.getElementById("fibrocentertool_question3a").style.display != "")
    {
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        
        
        
        document.getElementById("tab1").setAttribute("class", "firstitem",0);
        document.getElementById("tab1").setAttribute("className", "firstitem",0);
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("fibrocentertool_question3a").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question3b").style.display != "none" 
        && document.getElementById("fibrocentertool_question3b").style.display != "")
    {
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        
        document.getElementById("tab1").setAttribute("class", "firstitem",0);
        document.getElementById("tab1").setAttribute("className", "firstitem",0);
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("fibrocentertool_question3b").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question3c").style.display != "none" 
        && document.getElementById("fibrocentertool_question3c").style.display != "")
    {
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        
        document.getElementById("tab1").setAttribute("class", "firstitem",0);
        document.getElementById("tab1").setAttribute("className", "firstitem",0);
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("fibrocentertool_question3c").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
   }
    else if (document.getElementById("fibrocentertool_question3d").style.display != "none" 
        && document.getElementById("fibrocentertool_question3d").style.display != "")
    {
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        
        document.getElementById("tab1").setAttribute("class", "firstitem",0);
        document.getElementById("tab1").setAttribute("className", "firstitem",0);
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("fibrocentertool_question3d").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question3e").style.display != "none" 
        && document.getElementById("fibrocentertool_question3e").style.display != "")
    {
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        
        document.getElementById("tab1").setAttribute("class", "firstitem",0);
        document.getElementById("tab1").setAttribute("className", "firstitem",0);
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("fibrocentertool_question3e").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
   }
    else if (document.getElementById("fibrocentertool_question4").style.display != "none" 
        && document.getElementById("fibrocentertool_question4").style.display != "")
    {
        //Add Question 4's answer to right side
        var q4_answered = false;
        for(var i=0; i <= 6; i++)
        {
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question4_" + i).checked)
            {
                document.getElementById("fibrocentertool_question4a").style.display = "block";
                Track_Questions_Insights(4, true);
                
                FadeInInsight("p#insight4a",1800,0);
                
                document.getElementById("progress2q4a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question4_" + i).value;
                q4_answered = true;
            }
        }
        
        if(!q4_answered)  //No answer picked move on to next question
        {
            document.getElementById("fibrocentertool_question4a").style.display = "block";
            Track_Questions_Insights(4, true);
            
            FadeInInsight("p#insight4a",1800,0);
            
            document.getElementById("progress2q4a").innerHTML = "&nbsp;";
        }
        
        document.getElementById("progress2_dot4").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot4").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question4").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question4a").style.display != "none" 
        && document.getElementById("fibrocentertool_question4a").style.display != "")
    {
        document.getElementById("fibrocentertool_question5").style.display = "block";
        Track_Questions_Insights(5, false);
        
        
        
        document.getElementById("progress2q5").style.display = "block";
        document.getElementById("fibrocentertool_question4a").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question5").style.display != "none" 
        && document.getElementById("fibrocentertool_question5").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_0").checked)
        {
            document.getElementById("fibrocentertool_question5a").style.display = "block";
            Track_Questions_Insights(5, true);
            
            FadeInInsight("p#insight5a",1800,0);
            
            document.getElementById("progress2q5a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5",0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_1").checked)
        {
            document.getElementById("fibrocentertool_question5b").style.display = "block";
            Track_Questions_Insights(5, true);
            
            FadeInInsight("p#insight5b",1800,0);
            
            document.getElementById("progress2q5a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5",0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_2").checked)
        {
            document.getElementById("fibrocentertool_question5c").style.display = "block";
            Track_Questions_Insights(5, true);
            
            FadeInInsight("p#insight5c",1800,0);
            
            document.getElementById("progress2q5a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5",0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_3").checked)
        {
            document.getElementById("fibrocentertool_question5d").style.display = "block";
            Track_Questions_Insights(5, true);
            
            FadeInInsight("p#insight5d",1800,0);
            
            document.getElementById("progress2q5a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5",0);
        }
        else //No answer picked move on to next question
        {
            document.getElementById("fibrocentertool_question5a").style.display = "block";
            Track_Questions_Insights(5, true);
            
            FadeInInsight("p#insight5a",1800,0);
            
            document.getElementById("progress2q5a").innerHTML = "&nbsp;";
        }
        
        document.getElementById("progress2_dot5").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot5").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question5").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question5a").style.display != "none" 
        && document.getElementById("fibrocentertool_question5a").style.display != "")
    {
        document.getElementById("fibrocentertool_question6").style.display = "block";
        Track_Questions_Insights(6, false);
        
        
        
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("fibrocentertool_question5a").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question5b").style.display != "none" 
        && document.getElementById("fibrocentertool_question5b").style.display != "")
    {
        document.getElementById("fibrocentertool_question6").style.display = "block";
        Track_Questions_Insights(6, false);
        
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("fibrocentertool_question5b").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question5c").style.display != "none" 
        && document.getElementById("fibrocentertool_question5c").style.display != "")
    {
        document.getElementById("fibrocentertool_question6").style.display = "block";
        Track_Questions_Insights(6, false);
        
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("fibrocentertool_question5c").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question5d").style.display != "none" 
        && document.getElementById("fibrocentertool_question5d").style.display != "")
    {
        document.getElementById("fibrocentertool_question6").style.display = "block";
        Track_Questions_Insights(6, false);
        
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("fibrocentertool_question5d").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question6").style.display != "none" 
        && document.getElementById("fibrocentertool_question6").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6_0").checked)
        {
            document.getElementById("fibrocentertool_question6sub").style.display = "block";
            document.getElementById("progress2q6a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6",0);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6_1").checked)
        {
            document.getElementById("fibrocentertool_question7").style.display = "block";
            Track_Questions_Insights(7, false);
            
            document.getElementById("progress2q7").style.display = "block";
            document.getElementById("progress2q6a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6",0);
            document.getElementById("progress2_dot6").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot6").setAttribute("className", "progressDotFull",0);
        }else{  //No answer picked move on to next question
            document.getElementById("fibrocentertool_question7").style.display = "block";
            Track_Questions_Insights(7, false);
            
            document.getElementById("progress2q7").style.display = "block";
            document.getElementById("progress2q6a").innerHTML = "&nbsp;";
            document.getElementById("progress2_dot6").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot6").setAttribute("className", "progressDotFull",0);
        }
        
        document.getElementById("fibrocentertool_question6").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question6sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question6sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question6suba").style.display = "block";
        Track_Questions_Insights(6, true);
        
        FadeInInsight("p#insight6a",1800,0);
        
        document.getElementById("progress2_dot6").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot6").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question6sub").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question6suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question6suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question7").style.display = "block";
        Track_Questions_Insights(7, false);
        
        document.getElementById("progress2q7").style.display = "block";
        document.getElementById("fibrocentertool_question6suba").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question7").style.display != "none" 
        && document.getElementById("fibrocentertool_question7").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_0").checked)
        {
            document.getElementById("fibrocentertool_question7sub").style.display = "block";
            document.getElementById("progress2q7a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_1").checked)
        {
            document.getElementById("fibrocentertool_question8").style.display = "block";
            Track_Questions_Insights(8, false);
            
            document.getElementById("progress2q8").style.display = "block";
            document.getElementById("progress2q7a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_1").value;
            document.getElementById("progress2_dot7").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot7").setAttribute("className", "progressDotFull",0);
        }else{ //No answer picked move on to next question
            document.getElementById("fibrocentertool_question8").style.display = "block";
            Track_Questions_Insights(8, false);
            
            document.getElementById("progress2q8").style.display = "block";
            document.getElementById("progress2q7a").innerHTML = "&nbsp;";
            document.getElementById("progress2_dot7").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot7").setAttribute("className", "progressDotFull",0);
        }

        document.getElementById("fibrocentertool_question7").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question7sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question7sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question7suba").style.display = "block";
        Track_Questions_Insights(7, true);
        
        FadeInInsight("p#insight7a",1800,0);
        
        document.getElementById("progress2_dot7").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot7").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question7sub").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question7suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question7suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question8").style.display = "block";
        Track_Questions_Insights(8, false);
        
        document.getElementById("progress2q8").style.display = "block";
        document.getElementById("fibrocentertool_question7suba").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question8").style.display != "none" 
        && document.getElementById("fibrocentertool_question8").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_0").checked)
        {
            document.getElementById("fibrocentertool_question8sub").style.display = "block";
            document.getElementById("progress2q8a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_1").checked)
        {
            document.getElementById("fibrocentertool_question9").style.display = "block";
            Track_Questions_Insights(9, false);
            
            document.getElementById("progress3q9").style.display = "block";
            document.getElementById("progress2q8a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_1").value;
            document.getElementById("progress2_dot8").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot8").setAttribute("className", "progressDotFull",0);
            //Swap Tab
            document.getElementById("tab2").setAttribute("class", "",0);
            document.getElementById("tab3").setAttribute("class", "selected",0);
            document.getElementById("tab2").setAttribute("className", "",0);
            document.getElementById("tab3").setAttribute("className", "selected",0);
            document.getElementById("progress2").style.display = "none";
            document.getElementById("progress3").style.display = "block";
            document.getElementById("back").style.display = "block";
        }else{ //No answer picked move on to next question
            document.getElementById("fibrocentertool_question9").style.display = "block";
            Track_Questions_Insights(9, false);
            
            document.getElementById("progress3q9").style.display = "block";
            document.getElementById("progress2q8a").innerHTML = "&nbsp;";
            document.getElementById("progress2_dot8").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress2_dot8").setAttribute("className", "progressDotFull",0);
            //Swap Tab
            document.getElementById("tab2").setAttribute("class", "",0);
            document.getElementById("tab3").setAttribute("class", "selected",0);
            document.getElementById("tab2").setAttribute("className", "",0);
            document.getElementById("tab3").setAttribute("className", "selected",0);
            document.getElementById("progress2").style.display = "none";
            document.getElementById("progress3").style.display = "block";
            document.getElementById("back").style.display = "block";
        }
        
        document.getElementById("fibrocentertool_question8").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question8sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question8sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question8suba").style.display = "block";
        Track_Questions_Insights(8, true);
        
        FadeInInsight("p#insight8a",1800,0);
        
        document.getElementById("progress2_dot8").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot8").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question8sub").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question8suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question8suba").style.display != "")
    {
        document.getElementById("back").style.display = "block";
        document.getElementById("fibrocentertool_question9").style.display = "block";
        Track_Questions_Insights(9, false);
        
        //Swap Tab
        document.getElementById("tab2").setAttribute("class", "",0);
        document.getElementById("tab3").setAttribute("class", "selected",0);
        document.getElementById("tab2").setAttribute("className", "",0);
        document.getElementById("tab3").setAttribute("className", "selected",0);
        document.getElementById("progress2").style.display = "none";
        document.getElementById("progress3").style.display = "block";
        document.getElementById("progress3q9").style.display = "block";
        document.getElementById("progress3q10").style.display = "none";
        document.getElementById("fibrocentertool_question8suba").style.display = "none";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question9").style.display != "none" 
        && document.getElementById("fibrocentertool_question9").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9_0").checked)
        {
            document.getElementById("fibrocentertool_question9sub").style.display = "block";
            document.getElementById("progress3q9a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9_1").checked)
        {
            document.getElementById("progress3_dot9").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress3_dot9").setAttribute("className", "progressDotFull",0);
            document.getElementById("fibrocentertool_question10").style.display = "block";
            Track_Questions_Insights(10, false);
            
            document.getElementById("progress3q10").style.display = "block";
            document.getElementById("progress3q9a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9_1").value;
        }else{//No answer picked move on to next question
            document.getElementById("progress3_dot9").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress3_dot9").setAttribute("className", "progressDotFull",0);
            document.getElementById("fibrocentertool_question10").style.display = "block";
            Track_Questions_Insights(10, false);
            
            document.getElementById("progress3q10").style.display = "block";
            document.getElementById("progress3q9a").innerHTML = "&nbsp;";
        }
        document.getElementById("fibrocentertool_question9").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question9sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question9sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question9suba").style.display = "block";
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_0").checked)
        {
            document.getElementById("fibrocentertool_question9_insighta").style.display = "block";
            Track_Questions_Insights(9, true);
            
            FadeInInsight("p#insight9a", 1800, timeoutnine);
            timeoutnine = timeoutnine + 100;
        }
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_1").checked)
        {
            document.getElementById("fibrocentertool_question9_insightb").style.display = "block";
            Track_Questions_Insights(9, true);
            
            FadeInInsight("p#insight9b",1800, timeoutnine);
            timeoutnine = timeoutnine + 100;
        }
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_2").checked)
        {
            document.getElementById("fibrocentertool_question9_insightc").style.display = "block";
            Track_Questions_Insights(9, true);
            
            FadeInInsight("p#insight9c",1800,timeoutnine);
            timeoutnine = timeoutnine + 100;
        }
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_3").checked)
        {
            document.getElementById("fibrocentertool_question9_insightd").style.display = "block";
            Track_Questions_Insights(9, true);
            
            FadeInInsight("p#insight9d",1800,timeoutnine);
            timeoutnine = timeoutnine + 100;
        }
        
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_4").checked)
        {
            document.getElementById("fibrocentertool_question9_insighte").style.display = "block";
            Track_Questions_Insights(9, true);
            
            FadeInInsight("p#insight9e",1800,timeoutnine);
            timeoutnine = timeoutnine + 100;
        }
        
        document.getElementById("progress3_dot9").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress3_dot9").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question9sub").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question9suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question9suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question10").style.display = "block";
        Track_Questions_Insights(10, false);
        
        document.getElementById("progress3q10").style.display = "block";
        document.getElementById("fibrocentertool_question9suba").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighta").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightb").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightc").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightd").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighte").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question10").style.display != "none" 
        && document.getElementById("fibrocentertool_question10").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question10_0").checked)
        {
            document.getElementById("fibrocentertool_question10sub").style.display = "block";
            document.getElementById("progress3q10a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question10_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question10_1").checked)
        {
            document.getElementById("progress3_dot10").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress3_dot10").setAttribute("className", "progressDotFull",0);
            document.getElementById("fibrocentertool_question11").style.display = "block";
            Track_Questions_Insights(11, false);
            
            document.getElementById("progress3q11").style.display = "block";
            document.getElementById("progress3q10a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question10_1").value;
        }else{//No answer picked move on to next question
            document.getElementById("progress3_dot10").setAttribute("class", "progressDotFull",0);
            document.getElementById("progress3_dot10").setAttribute("className", "progressDotFull",0);
            document.getElementById("fibrocentertool_question11").style.display = "block";
            Track_Questions_Insights(11, false);
            
            document.getElementById("progress3q11").style.display = "block";
            document.getElementById("progress3q10a").innerHTML = "&nbsp;";
        }

        document.getElementById("fibrocentertool_question10").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question10sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question10sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question10suba").style.display = "block";
        document.getElementById("progress3_dot10").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress3_dot10").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question10sub").style.display = "none";
        
        FadeInInsight("p#insight10a",1800,0);
        Track_Questions_Insights(10, true);
    }
    else if (document.getElementById("fibrocentertool_question10suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question10suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question11").style.display = "block";
        Track_Questions_Insights(11, false);
        
        document.getElementById("progress3q11").style.display = "block";
        document.getElementById("fibrocentertool_question10suba").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question11").style.display != "none" 
        && document.getElementById("fibrocentertool_question11").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_0").checked)
        {
            document.getElementById("fibrocentertool_question11b").style.display = "block";
            Track_Questions_Insights(11, true);
            document.getElementById("progress3q11a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_1").checked)
        {
            document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_myresults.gif";
            document.getElementById("fibrocentertool_question11a").style.display = "block";
            Track_Questions_Insights(11, true);
            
            FadeInInsight("p#insight11a",1800,0);
            
            document.getElementById("progress3q11a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_1").value;
        }else{//No answer picked move on to next question
            document.getElementById("fibrocentertool_question11b").style.display = "block";
            Track_Questions_Insights(11, true);
            document.getElementById("progress3q11a").innerHTML = "&nbsp;";
        }
        
        document.getElementById("progress3_dot11").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress3_dot11").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question11").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question11a").style.display != "none" 
        && document.getElementById("fibrocentertool_question11a").style.display != "")
    {
        /*
        document.getElementById("fibrocentertool_question11").style.display = "none";
        document.getElementById("fibrocentertool_question11a").style.display = "none";
        document.getElementById("fibrocentertool_question11b").style.display = "none";
        document.getElementById("fibrocentertool_question11c").style.display = "block";
        document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_myresults.gif";
        */
        //Track_Results();
        isCompleted = true;
        //Needs to go to new page
    }
    
    else if (document.getElementById("fibrocentertool_question11b").style.display != "none" 
        && document.getElementById("fibrocentertool_question11b").style.display != "")
    {
        document.getElementById("fibrocentertool_question12").style.display = "block";
        Track_Questions_Insights(12, false);
        
        document.getElementById("progress3q12").style.display = "block";
        document.getElementById("fibrocentertool_question11b").style.display = "none";
        document.getElementById("fibrocentertool_question11c").style.display = "none";
        //document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_myresults.gif";
    }
    else if (document.getElementById("fibrocentertool_question11c").style.display != "none" 
        && document.getElementById("fibrocentertool_question11c").style.display != "")
    {
        //Track_Results();
        isCompleted = true;
    }   
    else if (document.getElementById("fibrocentertool_question12").style.display != "none" 
        && document.getElementById("fibrocentertool_question12").style.display != "")
    {
        document.getElementById("progress3_dot12").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress3_dot12").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question12a").style.display = "block";
        Track_Questions_Insights(12, true);
        
        FadeInInsight("p#insight12a",1800,0);
        
        document.getElementById("fibrocentertool_question12").style.display = "none";
        document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_myresults.gif";
    }
    else if (document.getElementById("fibrocentertool_question12a").style.display != "none" 
        && document.getElementById("fibrocentertool_question12a").style.display != "")
    {

        isCompleted = true;
    }
    
    return isCompleted;
}


function backQuestion()
{
    
    var isCompleted = false;
    var timeoutnine = 0;
    
    if (document.getElementById("fibrocentertool_question12a").style.display != "none" 
        && document.getElementById("fibrocentertool_question12a").style.display != "")
    {
        document.getElementById("fibrocentertool_question12a").style.display = "none";
        document.getElementById("fibrocentertool_question12").style.display = "block";
        Track_Questions_Insights(12, false);
        document.getElementById("progress3_dot12").setAttribute("class", "progressDot",0);
        document.getElementById("progress3_dot12").setAttribute("className", "progressDot",0);
        document.getElementById("progress3q12").style.display = "block";
        document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_next.gif";
    } 
    else if (document.getElementById("fibrocentertool_question12").style.display != "none" 
        && document.getElementById("fibrocentertool_question12").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_0").checked)
        {
            document.getElementById("fibrocentertool_question11b").style.display = "block";
            Track_Questions_Insights(11, true);
            document.getElementById("progress3q11a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_0").value;
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_1").checked)
        {
            document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_myresults.gif";
            document.getElementById("fibrocentertool_question11a").style.display = "block";
            Track_Questions_Insights(11, true);
            FadeInInsight("p#insight11a",1800,0);
            document.getElementById("progress3q11a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_1").value;
        }else{//No answer picked move on to previous question
            document.getElementById("fibrocentertool_question11b").style.display = "block";
            Track_Questions_Insights(11, true);
            document.getElementById("progress3q11a").innerHTML = "&nbsp;";
        }
        
        document.getElementById("fibrocentertool_question12").style.display = "none";
        document.getElementById("progress3q12").style.display = "none";
        document.getElementById("progress3q11a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question11_0").value;
        document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_next.gif";
    }
    else if ((document.getElementById("fibrocentertool_question11b").style.display != "none" 
        && document.getElementById("fibrocentertool_question11b").style.display != "")
        || (document.getElementById("fibrocentertool_question11a").style.display != "none" 
        && document.getElementById("fibrocentertool_question11a").style.display != ""))
    {
        document.getElementById("fibrocentertool_question11a").style.display = "none";
        document.getElementById("fibrocentertool_question11b").style.display = "none";
        document.getElementById("progress3_dot11").setAttribute("class", "progressDot",0);
        document.getElementById("progress3_dot11").setAttribute("className", "progressDot",0);
        document.getElementById("fibrocentertool_question11").style.display = "block";
        Track_Questions_Insights(11, false);
        document.getElementById("progress3q11").style.display = "block";
        document.getElementById("ctl00_bodyContent_FibrocenterTool1_btnNext").src = "/images/FibrocenterTool/btn_next.gif";
    }
    else if (document.getElementById("fibrocentertool_question11").style.display != "none"
    && document.getElementById("fibrocentertool_question11").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question10_0").checked)
        {
            document.getElementById("fibrocentertool_question10suba").style.display = "block";
            
            FadeInInsight("p#insight10a",1800,0);
            Track_Questions_Insights(10, true);
            
            document.getElementById("progress3_dot10").setAttribute("class", "progressDot",0);
            document.getElementById("progress3_dot10").setAttribute("className", "progressDot",0);
            document.getElementById("fibrocentertool_question10sub").style.display = "none";
            
            document.getElementById("progress3q11").style.display = "none";
        }else{//No answer picked move on to previous question
            document.getElementById("progress3_dot10").setAttribute("class", "progressDot",0);
            document.getElementById("progress3_dot10").setAttribute("className", "progressDot",0);
            document.getElementById("fibrocentertool_question10").style.display = "block";
            
            FadeInInsight("p#insight10a",1800,0);
            Track_Questions_Insights(10, false);
            document.getElementById("progress3q11").style.display = "none";
            document.getElementById("progress3q10").style.display = "block";
        }
        
        document.getElementById("fibrocentertool_question11").style.display = "";
    }
    else if (document.getElementById("fibrocentertool_question10suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question10suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question10suba").style.display = "none";
        document.getElementById("fibrocentertool_question10sub").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question10sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question10sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question10sub").style.display = "none";
        document.getElementById("progress3_dot10").setAttribute("class", "progressDot",0);
        document.getElementById("progress3_dot10").setAttribute("className", "progressDot",0);
        document.getElementById("fibrocentertool_question10").style.display = "block";
        Track_Questions_Insights(10, false);
        
        document.getElementById("progress3q10").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question10").style.display != "none" 
        && document.getElementById("fibrocentertool_question10").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9_0").checked)
        {
            document.getElementById("fibrocentertool_question9suba").style.display = "block";
            document.getElementById("progress3q10").style.display = "none";
            
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_0").checked)
            {
                document.getElementById("fibrocentertool_question9_insighta").style.display = "block";
                
                FadeInInsight("p#insight9a",1800,timeoutnine);
                
                Track_Questions_Insights(9, true);
                
                timeoutnine = timeoutnine + 100;
            }
            
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_1").checked)
            {
                document.getElementById("fibrocentertool_question9_insightb").style.display = "block";
                
                FadeInInsight("p#insight9b",1800,timeoutnine);
                
                Track_Questions_Insights(9, true);
                
                timeoutnine = timeoutnine + 100;
            }
            
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_2").checked)
            {
                document.getElementById("fibrocentertool_question9_insightc").style.display = "block";
                
                FadeInInsight("p#insight9c",1800,timeoutnine);
                
                Track_Questions_Insights(9, true);
                
                timeoutnine = timeoutnine + 100;
            }
            
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_3").checked)
            {
                document.getElementById("fibrocentertool_question9_insightd").style.display = "block";
                
                FadeInInsight("p#insight9d",1800,timeoutnine);
                
                Track_Questions_Insights(9, true);
                
                timeoutnine = timeoutnine + 100;
            }
            
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question9sub_4").checked)
            {
                document.getElementById("fibrocentertool_question9_insighte").style.display = "block";
                
                FadeInInsight("p#insight9e",1800,timeoutnine);
                
                Track_Questions_Insights(9, true);
                
                timeoutnine = timeoutnine + 100;
            }

        }else{//No answer picked move on to next question
            document.getElementById("progress3_dot9").setAttribute("class", "progressDOt",0);
            document.getElementById("progress3_dot9").setAttribute("className", "progressDOt",0);
            document.getElementById("fibrocentertool_question9").style.display = "block";
            Track_Questions_Insights(9, false);
            document.getElementById("progress3q10").style.display = "none";
        }
        
        document.getElementById("fibrocentertool_question10").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question9suba").style.display != "none" 
    && document.getElementById("fibrocentertool_question9suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question9suba").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighta").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightb").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightc").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightd").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighte").style.display = "none";
        document.getElementById("fibrocentertool_question9sub").style.display = "block";
        
    }
    else if (document.getElementById("fibrocentertool_question9sub").style.display != "none" 
    && document.getElementById("fibrocentertool_question9sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question9sub").style.display = "none";
        document.getElementById("progress3_dot9").setAttribute("class", "progressDOt",0);
        document.getElementById("progress3_dot9").setAttribute("className", "progressDOt",0);
        document.getElementById("fibrocentertool_question9").style.display = "block";
        Track_Questions_Insights(10, false);
        document.getElementById("progress3q10").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question9").style.display != "none" 
        && document.getElementById("fibrocentertool_question9").style.display != "")
    {
    
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_0").checked)
        {
            document.getElementById("fibrocentertool_question8suba").style.display = "block";
            Track_Questions_Insights(8, true);
            FadeInInsight("p#insight8a",1800,0);
        }else{ 
            document.getElementById("fibrocentertool_question8").style.display = "block";
            Track_Questions_Insights(8, false);
            document.getElementById("progress3q9").style.display = "none";
            document.getElementById("progress2_dot8").setAttribute("class", "progressDot",0);
            document.getElementById("progress2_dot8").setAttribute("className", "progressDot",0);
        }
        
        document.getElementById("fibrocentertool_question9").style.display = "";
        //Swap Tab
        document.getElementById("tab2").setAttribute("class", "selected",0);
        document.getElementById("tab3").setAttribute("class", "",0);
        document.getElementById("tab2").setAttribute("className", "selected",0);
        document.getElementById("tab3").setAttribute("className", "",0);
        document.getElementById("progress2").style.display = "block";
        document.getElementById("progress3").style.display = "none";
        document.getElementById("back").style.display = "block";
        document.getElementById("next").style.display = "block";
        
        document.getElementById("progress2_dot7").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot7").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot6").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot6").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot5").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot5").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot4").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot4").setAttribute("className", "progressDotFull",0);
        
        document.getElementById("progress2q4").style.display = "block";
        document.getElementById("progress2q5").style.display = "block";
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("progress2q7").style.display = "block";
        document.getElementById("progress2q8").style.display = "block";
        
        SetTab3ProgressValues();
    }
    else if (document.getElementById("fibrocentertool_question8suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question8suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question8suba").style.display = "none";
        document.getElementById("fibrocentertool_question8sub").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question8sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question8sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question8sub").style.display = "none";
        document.getElementById("fibrocentertool_question8").style.display = "block";
        Track_Questions_Insights(8, false);
        document.getElementById("progress3q9").style.display = "none";
        document.getElementById("progress2_dot8").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot8").setAttribute("className", "progressDot",0);
        
        document.getElementById("progress2_dot7").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot7").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot6").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot6").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot5").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot5").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress2_dot4").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress2_dot4").setAttribute("className", "progressDotFull",0);
        
        document.getElementById("progress2q4").style.display = "block";
        document.getElementById("progress2q5").style.display = "block";
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("progress2q7").style.display = "block";
        document.getElementById("progress2q8").style.display = "block";
        
        SetTab3ProgressValues();
    }
    else if (document.getElementById("fibrocentertool_question8").style.display != "none" 
        && document.getElementById("fibrocentertool_question8").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_0").checked)
        {
            document.getElementById("fibrocentertool_question7suba").style.display = "block";
            FadeInInsight("p#insight7a",1800,0);
            Track_Questions_Insights(7, true);
        }else{ //No answer picked move on to next question
            document.getElementById("fibrocentertool_question7").style.display = "block";
            Track_Questions_Insights(7, false);
            document.getElementById("progress2q7").style.display = "block";
            document.getElementById("progress2_dot7").setAttribute("class", "progressDot",0);
            document.getElementById("progress2_dot7").setAttribute("className", "progressDot",0);
        }
        
        document.getElementById("progress2q8").style.display = "none";
        document.getElementById("fibrocentertool_question8").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question7suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question7suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question7suba").style.display = "none";
        document.getElementById("fibrocentertool_question7sub").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question7sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question7sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question7sub").style.display = "none";
        document.getElementById("fibrocentertool_question7").style.display = "block";
        Track_Questions_Insights(7, false);
        document.getElementById("progress2q7").style.display = "block";
        document.getElementById("progress2_dot7").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot7").setAttribute("className", "progressDot",0);
    }
    else if (document.getElementById("fibrocentertool_question7").style.display != "none" 
        && document.getElementById("fibrocentertool_question7").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6_0").checked)
        {
            document.getElementById("fibrocentertool_question6suba").style.display = "block";
            FadeInInsight("p#insight6a",1800,0);
            Track_Questions_Insights(6, true);
        }else{  
            document.getElementById("fibrocentertool_question6").style.display = "block";
            Track_Questions_Insights(6, false);
            document.getElementById("progress2q6").style.display = "block";
            document.getElementById("progress2_dot6").setAttribute("class", "progressDot",0);
            document.getElementById("progress2_dot6").setAttribute("className", "progressDot",0);
        }
        
        document.getElementById("progress2q7").style.display = "none";
        document.getElementById("fibrocentertool_question7").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question6suba").style.display != "none" 
        && document.getElementById("fibrocentertool_question6suba").style.display != "")
    {
        document.getElementById("fibrocentertool_question6suba").style.display = "none";
        document.getElementById("fibrocentertool_question6sub").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question6sub").style.display != "none" 
        && document.getElementById("fibrocentertool_question6sub").style.display != "")
    {
        document.getElementById("fibrocentertool_question6sub").style.display = "none";
        document.getElementById("fibrocentertool_question6").style.display = "block";
        Track_Questions_Insights(6, false);
        document.getElementById("progress2q6").style.display = "block";
        document.getElementById("progress2_dot6").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot6").setAttribute("className", "progressDot",0);
    }
    else if (document.getElementById("fibrocentertool_question6").style.display != "none" 
        && document.getElementById("fibrocentertool_question6").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_0").checked)
        {
            document.getElementById("fibrocentertool_question5a").style.display = "block";
            
            FadeInInsight("p#insight5a",1800,0);
            
            Track_Questions_Insights(5, true);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_1").checked)
        {
            document.getElementById("fibrocentertool_question5b").style.display = "block";
            
            FadeInInsight("p#insight5b",1800,0);
            
            Track_Questions_Insights(5, true);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_2").checked)
        {
            document.getElementById("fibrocentertool_question5c").style.display = "block";
            
            FadeInInsight("p#insight5c",1800,0);
            
            Track_Questions_Insights(5, true);
        }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5_3").checked)
        {
            document.getElementById("fibrocentertool_question5d").style.display = "block";
            
            FadeInInsight("p#insight5d",1800,0);
            
            Track_Questions_Insights(5, true);
        }
        else //No answer picked move on to next question
        {
            document.getElementById("fibrocentertool_question5a").style.display = "block";
            
            FadeInInsight("p#insight5a",1800,0);
            
            Track_Questions_Insights(5, true);
        }
        
        document.getElementById("progress2_dot5").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot5").setAttribute("className", "progressDot",0);
        document.getElementById("fibrocentertool_question6").style.display = "none";
        document.getElementById("progress2q6").style.display = "none";
    }
    else if ((document.getElementById("fibrocentertool_question5a").style.display != "none" 
        && document.getElementById("fibrocentertool_question5a").style.display != "")
        || (document.getElementById("fibrocentertool_question5b").style.display != "none" 
        && document.getElementById("fibrocentertool_question5b").style.display != "")
        || (document.getElementById("fibrocentertool_question5c").style.display != "none" 
        && document.getElementById("fibrocentertool_question5c").style.display != "")
        || (document.getElementById("fibrocentertool_question5d").style.display != "none" 
        && document.getElementById("fibrocentertool_question5d").style.display != ""))
    {
        document.getElementById("fibrocentertool_question5a").style.display = "none";
        document.getElementById("fibrocentertool_question5b").style.display = "none";
        document.getElementById("fibrocentertool_question5c").style.display = "none";
        document.getElementById("fibrocentertool_question5d").style.display = "none";
        
        document.getElementById("fibrocentertool_question5").style.display = "block";
        Track_Questions_Insights(5, false);
        document.getElementById("progress2_dot5").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot5").setAttribute("className", "progressDot",0);
    }
    else if (document.getElementById("fibrocentertool_question5").style.display != "none" 
        && document.getElementById("fibrocentertool_question5").style.display != "")
    {
        document.getElementById("progress2q5").style.display = "none";
        document.getElementById("fibrocentertool_question4a").style.display = "block";
        Track_Questions_Insights(4, true);
        
        FadeInInsight("p#insight4a",1800,0);
        
        document.getElementById("progress2_dot4").setAttribute("class", "progressDot",0);
        document.getElementById("progress2_dot4").setAttribute("className", "progressDot",0);
        document.getElementById("fibrocentertool_question5").style.display = "none";
    }
    else if (document.getElementById("fibrocentertool_question4a").style.display != "none" 
        && document.getElementById("fibrocentertool_question4a").style.display != "")
    {
        document.getElementById("fibrocentertool_question4a").style.display = "none";
        document.getElementById("fibrocentertool_question4").style.display = "block";
        Track_Questions_Insights(4, false);
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "block";
        document.getElementById("back").style.display = "block";
    }
    else if (document.getElementById("fibrocentertool_question4").style.display != "none" 
        && document.getElementById("fibrocentertool_question4").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_0").checked)
            {
                document.getElementById("fibrocentertool_question3a").style.display = "block";
                
                FadeInInsight("p#insight3a",1800,0);
                
                Track_Questions_Insights(3, true);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_1").checked)
            {
                document.getElementById("fibrocentertool_question3b").style.display = "block";
                
                FadeInInsight("p#insight3b",1800,0);
                
                Track_Questions_Insights(3, true);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_2").checked)
            {
                document.getElementById("fibrocentertool_question3c").style.display = "block";
                Track_Questions_Insights(3, true);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_3").checked)
            {
                document.getElementById("fibrocentertool_question3d").style.display = "block";
                
                FadeInInsight("p#insight3d",1800,0);
                
                Track_Questions_Insights(3, true);
            }
        else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question3_4").checked)
            {
                document.getElementById("fibrocentertool_question3e").style.display = "block";
                
                FadeInInsight("p#insight3e",1800,0);
                
                Track_Questions_Insights(3, true);
            }
        else  //No answer picked move on to next question
            {
                document.getElementById("fibrocentertool_question3a").style.display = "block";
                
                FadeInInsight("p#insight3a",1800,0);
                
                Track_Questions_Insights(3, true);
            }
        
        document.getElementById("fibrocentertool_question4").style.display = "none";
        
        //Swap Tab
        document.getElementById("tab1").setAttribute("class", "firstitemSelected",0);
        document.getElementById("tab2").setAttribute("class", "",0);
        document.getElementById("tab1").setAttribute("className", "firstitemSelected",0);
        document.getElementById("tab2").setAttribute("className", "",0);
        document.getElementById("progress1").style.display = "block";
        document.getElementById("progress2").style.display = "none";
        document.getElementById("back").style.display = "block";
        document.getElementById("next").style.display = "block";
        
        document.getElementById("progress1_dot1").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot1").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress1_dot2").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot2").setAttribute("className", "progressDotFull",0);
        document.getElementById("progress1_dot3").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot3").setAttribute("className", "progressDotFull",0);

        
        document.getElementById("progress1q1").style.display = "block";
        document.getElementById("progress1q2").style.display = "block";
        document.getElementById("progress1q3").style.display = "block";
    }
    else if ((document.getElementById("fibrocentertool_question3a").style.display != "none" 
        && document.getElementById("fibrocentertool_question3a").style.display != "")
        || (document.getElementById("fibrocentertool_question3b").style.display != "none" 
        && document.getElementById("fibrocentertool_question3b").style.display != "")
        || (document.getElementById("fibrocentertool_question3c").style.display != "none" 
        && document.getElementById("fibrocentertool_question3c").style.display != "")
        || (document.getElementById("fibrocentertool_question3d").style.display != "none" 
        && document.getElementById("fibrocentertool_question3d").style.display != "")
        || (document.getElementById("fibrocentertool_question3e").style.display != "none" 
        && document.getElementById("fibrocentertool_question3e").style.display != ""))
    {
        document.getElementById("fibrocentertool_question3a").style.display = "none";
        document.getElementById("fibrocentertool_question3b").style.display = "none";
        document.getElementById("fibrocentertool_question3c").style.display = "none";
        document.getElementById("fibrocentertool_question3d").style.display = "none";
        document.getElementById("fibrocentertool_question3e").style.display = "none";
        
        document.getElementById("fibrocentertool_question3").style.display = "block";
        Track_Questions_Insights(3, false);
    }
    else if (document.getElementById("fibrocentertool_question3").style.display != "none" 
        && document.getElementById("fibrocentertool_question3").style.display != "")
    {
        if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2_3").checked)
        {    
            document.getElementById("fibrocentertool_question2b").style.display = "block";
            
            FadeInInsight("p#insight2b",1800,0);
            
            Track_Questions_Insights(2, true);
            document.getElementById("progress1_dot3").setAttribute("class", "progressDot",0);
            document.getElementById("progress1_dot3").setAttribute("className", "progressDot",0);
            document.getElementById("progress1q3").style.display = "none";
            document.getElementById("progress1_dot2").setAttribute("class", "progressDot",0);
            document.getElementById("progress1_dot2").setAttribute("className", "progressDot",0);
            document.getElementById("fibrocentertool_question3").style.display = "none";
        }else{ 
            document.getElementById("fibrocentertool_question2a").style.display = "block";
            
            FadeInInsight("p#insight2a",1800,0);
            
            Track_Questions_Insights(2, true);
            document.getElementById("progress1_dot3").setAttribute("class", "progressDot",0);
            document.getElementById("progress1_dot3").setAttribute("className", "progressDot",0);
            document.getElementById("progress1q3").style.display = "none";
            document.getElementById("progress1_dot2").setAttribute("class", "progressDot",0);
            document.getElementById("progress1_dot2").setAttribute("className", "progressDot",0);
            document.getElementById("fibrocentertool_question3").style.display = "none";
       }
    }
    else if (document.getElementById("fibrocentertool_question2c").style.display != "none" 
        && document.getElementById("fibrocentertool_question2c").style.display != "")
    {
        document.getElementById("fibrocentertool_question2c").style.display = "none";
        document.getElementById("fibrocentertool_question2b").style.display = "block";
        document.getElementById("back").style.display = "block";
        document.getElementById("next").style.display = "block";
        
        FadeInInsight("p#insight2b",1800,0);
        
        Track_Questions_Insights(2, true);
    }
    else if ((document.getElementById("fibrocentertool_question2a").style.display != "none" 
        && document.getElementById("fibrocentertool_question2a").style.display != "")
        || (document.getElementById("fibrocentertool_question2b").style.display != "none" 
        && document.getElementById("fibrocentertool_question2b").style.display != ""))
    {
        document.getElementById("fibrocentertool_question2").style.display = "block";
        document.getElementById("fibrocentertool_question2a").style.display = "none";
        document.getElementById("fibrocentertool_question2b").style.display = "none";
        Track_Questions_Insights(2, false);
    }
    else if (document.getElementById("fibrocentertool_question2").style.display != "none" 
        && document.getElementById("fibrocentertool_question2").style.display != "")
    {
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_0").checked)
        {
            document.getElementById("fibrocentertool_question1a").style.display = "block";
            
            FadeInInsight("p#insight1a",1800,0);
            
            Track_Questions_Insights(1, true);
        }
        else if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question1_1").checked)
        {
            document.getElementById("fibrocentertool_question1b").style.display = "block";
            Track_Questions_Insights(1, true);
        }else{  //No answer picked move on to next question
            document.getElementById("fibrocentertool_question1a").style.display = "block";
            
            FadeInInsight("p#insight1a",1800,0);
            
            Track_Questions_Insights(1, true);
        }
        
        document.getElementById("progress1_dot2").setAttribute("class", "progressDotFull",0);
        document.getElementById("progress1_dot2").setAttribute("className", "progressDotFull",0);
        document.getElementById("fibrocentertool_question2").style.display = "none";
        document.getElementById("back").style.display = "block";
        document.getElementById("progress1q2").style.display = "none";
        document.getElementById("progress1_dot2").setAttribute("class", "progressDot",0);
        document.getElementById("progress1_dot2").setAttribute("className", "progressDot",0);
    }
    else if ((document.getElementById("fibrocentertool_question1a").style.display != "none" 
        && document.getElementById("fibrocentertool_question1a").style.display != "")
        || (document.getElementById("fibrocentertool_question1b").style.display != "none" 
        && document.getElementById("fibrocentertool_question1b").style.display != ""))
    {
        document.getElementById("fibrocentertool_question1a").style.display = "none";
        document.getElementById("fibrocentertool_question1b").style.display = "none";
        
        document.getElementById("fibrocentertool_question1").style.display = "block";
        Track_Questions_Insights(1, false);
        document.getElementById("progress1_dot1").setAttribute("class", "progressDot",0);
        document.getElementById("progress1_dot1").setAttribute("className", "progressDot",0);
        
        document.getElementById("next").style.display = "block";
        document.getElementById("back").style.display = "none";
    }
    return isCompleted;
}

function SetTab3ProgressValues()
{
    for(var i=0; i <= 6; i++)
    {
        if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question4_" + i).checked)
        {
            document.getElementById("progress2q4a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question4_" + i).value;
        }
    }
    document.getElementById("progress2q5a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question5",0);
    document.getElementById("progress2q6a").innerHTML = checkBoxListGet("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question6",0);
    if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_0").checked)
    {
        document.getElementById("progress2q7a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_0").value;
    }
    else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_1").checked)
    {
        document.getElementById("progress2q7a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question7_1").value;
    }
    if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_0").checked)
    {
        document.getElementById("progress2q8a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_0").value;
    }
    else if (document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_1").checked)
    {
        document.getElementById("progress2q8a").innerHTML = document.getElementById("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question8_1").value;
    }
}

function checkBoxListGet(elementId)
{
 var elementRef = document.getElementById(elementId);
 var checkBoxArray = elementRef.getElementsByTagName('input');
 var checkedValues = '';

 for (var i=0; i<checkBoxArray.length; i++)
 {
  var checkBoxRef = checkBoxArray[i];

  if ( checkBoxRef.checked == true )
  {
   var labelArray = checkBoxRef.parentNode.getElementsByTagName('label');

   if ( labelArray.length > 0 )
   {
    if ( checkedValues.length > 0 )
     checkedValues += ', ';

    checkedValues += labelArray[0].innerHTML;
   }
  }
 }

 return checkedValues;
}

function readCheckBoxList(cbListID)
{
    var checkedItems = checkBoxListGet(cbListID);
}

var lastTab = 0;

function ActivateTab(tabNum)
{
    var showresults = true;
    
    document.getElementById("tab1").setAttribute("class", "firstitem",0);
    document.getElementById("tab2").setAttribute("class", "",0);
    document.getElementById("tab3").setAttribute("class", "",0);
    document.getElementById("tab4").setAttribute("class", "lastitem",0);
    
    document.getElementById("tab1").setAttribute("className", "firstitem",0);
    document.getElementById("tab2").setAttribute("className", "",0);
    document.getElementById("tab3").setAttribute("className", "",0);
    document.getElementById("tab4").setAttribute("className", "lastitem",0);
    
    
    if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_fibrocentertool_questions")){
    
        document.getElementById("fibrocentertool_question4").style.display = "none";
        document.getElementById("fibrocentertool_question3a").style.display = "none";
        document.getElementById("progress1").style.display = "none";
        document.getElementById("progress2").style.display = "none";
        document.getElementById("progress3").style.display = "none";
        
        document.getElementById("fibrocentertool_question1").style.display = "none";
        document.getElementById("fibrocentertool_question1a").style.display = "none";
        document.getElementById("fibrocentertool_question1b").style.display = "none";
        document.getElementById("fibrocentertool_question2").style.display = "none";
        document.getElementById("fibrocentertool_question2a").style.display = "none";
        document.getElementById("fibrocentertool_question2b").style.display = "none";
        document.getElementById("fibrocentertool_question2c").style.display = "none";
        document.getElementById("fibrocentertool_question3").style.display = "none";
        document.getElementById("fibrocentertool_question3a").style.display = "none";
        document.getElementById("fibrocentertool_question3b").style.display = "none";
        document.getElementById("fibrocentertool_question3c").style.display = "none";
        document.getElementById("fibrocentertool_question3d").style.display = "none";
        document.getElementById("fibrocentertool_question3e").style.display = "none";
        document.getElementById("fibrocentertool_question4").style.display = "none";
        document.getElementById("fibrocentertool_question4a").style.display = "none";
        document.getElementById("fibrocentertool_question5").style.display = "none";
        document.getElementById("fibrocentertool_question5a").style.display = "none";
        document.getElementById("fibrocentertool_question5b").style.display = "none";
        document.getElementById("fibrocentertool_question5c").style.display = "none";
        document.getElementById("fibrocentertool_question5d").style.display = "none";
        document.getElementById("fibrocentertool_question6").style.display = "none";
        document.getElementById("fibrocentertool_question6sub").style.display = "none";
        document.getElementById("fibrocentertool_question6suba").style.display = "none";
        document.getElementById("fibrocentertool_question7").style.display = "none";
        document.getElementById("fibrocentertool_question7sub").style.display = "none";
        document.getElementById("fibrocentertool_question7suba").style.display = "none";
        document.getElementById("fibrocentertool_question8").style.display = "none";
        document.getElementById("fibrocentertool_question8sub").style.display = "none";
        document.getElementById("fibrocentertool_question8suba").style.display = "none";
        document.getElementById("fibrocentertool_question9").style.display = "none";
        document.getElementById("fibrocentertool_question9sub").style.display = "none";
        document.getElementById("fibrocentertool_question9suba").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighta").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightb").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightc").style.display = "none";
        document.getElementById("fibrocentertool_question9_insightd").style.display = "none";
        document.getElementById("fibrocentertool_question9_insighte").style.display = "none";
        document.getElementById("fibrocentertool_question10").style.display = "none";
        document.getElementById("fibrocentertool_question10sub").style.display = "none";
        document.getElementById("fibrocentertool_question10suba").style.display = "none";
        document.getElementById("fibrocentertool_question11").style.display = "none";
        document.getElementById("fibrocentertool_question11a").style.display = "none";
        document.getElementById("fibrocentertool_question11b").style.display = "none";
        document.getElementById("fibrocentertool_question11c").style.display = "none";
        document.getElementById("fibrocentertool_question12").style.display = "none";
        document.getElementById("fibrocentertool_question12a").style.display = "none";
        document.getElementById("progress1q1").style.display = "none";
        document.getElementById("progress1q2").style.display = "none";
        document.getElementById("progress1q3").style.display = "none";
        document.getElementById("progress2q4").style.display = "none";
        document.getElementById("progress2q5").style.display = "none";
        document.getElementById("progress2q6").style.display = "none";
        document.getElementById("progress2q7").style.display = "none";
        document.getElementById("progress2q8").style.display = "none";
        document.getElementById("progress3q9").style.display = "none";
        document.getElementById("progress3q10").style.display = "none";
        document.getElementById("progress3q11").style.display = "none";
        document.getElementById("progress3q12").style.display = "none";
    }
    
    switch (tabNum) 
    {
        case 1:
            document.getElementById("tab1").setAttribute("class", "firstitemSelected",0);
            document.getElementById("tab1").setAttribute("className", "firstitemSelected",0);
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_fibrocentertool_questions")){
                document.getElementById("fibrocentertool_question1").style.display = "block";
                document.getElementById("progress1").style.display = "block";
                document.getElementById("next").style.display = "block";
                document.getElementById("back").style.display = "none";
                document.getElementById("progress1q1").style.display = "block";
                //setTimeout("Track_Questions_Insights(1, false);",250);
                
            }
            break;
        case 2:
            document.getElementById("tab2").setAttribute("class", "selected",0);
            document.getElementById("tab2").setAttribute("className", "selected",0);
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_fibrocentertool_questions")){
                document.getElementById("fibrocentertool_question4").style.display = "block";
                document.getElementById("progress2").style.display = "block";
                document.getElementById("progress2q4").style.display = "block";
                document.getElementById("next").style.display = "block";
                document.getElementById("back").style.display = "block";
                //setTimeout("Track_Questions_Insights(4, false);",250);
            }
            break;
        case 3:
            document.getElementById("tab3").setAttribute("class", "selected",0);
            document.getElementById("tab3").setAttribute("className", "selected",0);
            document.getElementById("back").style.display = "block";
            if(document.getElementById("ctl00_bodyContent_FibrocenterTool1_fibrocentertool_questions")){
                document.getElementById("fibrocentertool_question9").style.display = "block";
                document.getElementById("progress3").style.display = "block";
                document.getElementById("progress3q9").style.display = "block";
                document.getElementById("progress3q10").style.display = "none";
                document.getElementById("next").style.display = "block";
                //setTimeout("Track_Questions_Insights(9, false);",250);
            }
            break;
        case 4:
            document.getElementById("tab4").setAttribute("class", "lastitemSelected",0);
            document.getElementById("tab4").setAttribute("className", "lastitemSelected",0);
            break;
        default:
            document.getElementById("tab1").setAttribute("class", "firstitemSelected",0);
            break;
    }
    
    if((lastTab < 4) && (tabNum < 4))
    {
        showresults = false;
    }else{
        if((lastTab == 4) && (tabNum == 4))
        {
            showresults = false;
        }
    }
    
    lastTab = tabNum;
    
    setTimeout("SetQuestionValues();",150);
    
    return showresults;
}



function Track_Questions_Insights(qNum, isInsight){
    try{
        if(!s_account)
        {
            setTimeout("Track_Questions_Insights(" + qNum + ", " + isInsight + ");",100);
        }else{
        
            var s = s_gi(s_account);
            s.linkTrackVars = 'prop1,prop2,prop3,prop12,prop13,eVar7,events'; 
            s.linkTrackEvents = 'event7';
            s.events = 'event7';
            s.eVar7 = '';
            s.channel='FibroCenter';
            s.prop1= s.channel + '/painassessment' 
            if(isInsight)
            {
                s.prop2= s.prop1 + '/painassessment' + qNum + 'insight';
            }else{
                s.prop2= s.prop1 + '/painassessment' + qNum;
            }
            s.prop12='painassessment';
            s.prop13='fibromyalgia';
            
            if(isInsight)
            {
                s.tl(true,'o','describemypainq' + qNum + 'insight');  // this, (d = download, e = exit, o = other), name
            }else{
                s.tl(true,'o','describemypainq' + qNum);  // this, (d = download, e = exit, o = other), name
            }
            
            s.linkTrackVars = "None"; 
            s.linkTrackEvents = "None"; 
            s.events = "";
        }
    }catch(e){
    
    }
}


function Track_Results(){
    try{
        if(!s_account)
        {
            setTimeout("Track_Results();",100);
        }else{
        
            var s = s_gi(s_account);
            s.linkTrackVars = 'prop1,prop2,prop3,prop12,prop13,eVar7,events'; 
            s.linkTrackEvents = 'event7';
            s.events = 'event7';
            s.eVar7 = '';
            s.channel='FibroCenter';
            s.prop1= s.channel + '/painassessment' 
            s.prop2= s.prop1 + '/results';
            s.prop12='painassessment';
            s.prop13='fibromyalgia';
            
            s.tl(true,'o','results');  // this, (d = download, e = exit, o = other), name
            
            s.linkTrackVars = "None"; 
            s.linkTrackEvents = "None"; 
            s.events = "";
        }
    }catch(e){
    
    }
}

function Track_Print()
{
    try {
        if(!s_account)
        {
            setTimeout("Track_Print();",100);
        }else{
             var s = s_gi(s_account);
            s.linkTrackVars = 'eVar36,events'; 
            s.linkTrackEvents = 'event11';
            
            s.events = "event11";
            s.eVar36 = "Pain Assessment Print";

            
            s.tl(true,'o','Pain Assessment Print');  // this, (d = download, e = exit, o = other), name
            
            s.linkTrackVars = "None"; 
            s.linkTrackEvents = "None"; 
            s.events = "";
            
            
        }
    }catch(e){
    
    }
    
}

function Print_Results()
{

    Track_Print();
    window.print();
}


function SetHiddenVal(objName,obj)
{
    var hdnObj = document.getElementById(objName);
    var tmpName = obj.id.replace("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_","");
    tmpName = tmpName.replace(/[_][0-9]*/,"");
    var tmpVal = "";
    
    if((obj.type.toLowerCase() == "checkbox") || (obj.type.toLowerCase() == "check"))
    {
       var labelArray = obj.parentNode.getElementsByTagName('label');

       if ( labelArray.length > 0 )
       {
         tmpVal = labelArray[0].innerHTML;
       }
        
        if((obj.checked) && (tmpVal != ""))
        {
            if(hdnObj.value.indexOf(tmpVal) < 0)
            {
                hdnObj.value = hdnObj.value + tmpVal + ",";
            }
        }else{
            hdnObj.value = hdnObj.value.replace(tmpVal + ",","");
        }
    }else{
        var  tmpSessionVal = GetSessionValue(tmpName);
        
        if((obj.value.toLowerCase() == "no") && (tmpSessionVal != false)){
            var qNum = parseInt(tmpName.toLowerCase().replace("question",""));
            if((qNum >= 6) && (qNum <= 10))
            {
                if(tmpSessionVal.toLowerCase() != "no")
                {
                    document.getElementById("hfibrocentertool_question" + qNum + "sub").value = "";
                    ClearSubElements("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question" + qNum + "sub_");
                }
            }
        }
        hdnObj.value = obj.value;
    }
}

function CheckHiddenVal(objName,objhdnName)
{
    var tmpName = objName.replace("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question","");
    var tmpVal = "";
    
    
    if((document.getElementById(objName).type.toLowerCase() == "checkbox") || (document.getElementById(objName).type.toLowerCase() == "check"))
    {
        var labelArray = document.getElementById(objName).parentNode.getElementsByTagName('label');

        if ( labelArray.length > 0 )
        {
          tmpVal = labelArray[0].innerHTML;
        }
        
        if(tmpVal != ""){
            if(document.getElementById(objhdnName).value.indexOf(tmpVal) >= 0)
            {
                document.getElementById(objName).checked = true;
            }
        }
    }else{
        if(document.getElementById(objhdnName).value == document.getElementById(objName).value)
        {
            
            document.getElementById(objName).checked = true;
        }
    }
}

function GetQuestionValuesFromSession(objName,hdnName)
{
    var tmpName = objName.replace("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_","");
    tmpName = tmpName.replace(/[_][0-9]*/,"");
    var tmpVal;
    var checkedValues = "";
    
    if((document.getElementById(objName).type.toLowerCase() == "checkbox") || (document.getElementById(objName).type.toLowerCase() == "check"))
    {
       var labelArray = document.getElementById(objName).parentNode.getElementsByTagName('label');

       if ( labelArray.length > 0 )
       {
         tmpVal = labelArray[0].innerHTML;
       }
    }else{
        tmpVal = document.getElementById(objName).value;
    }
    
    var tmpSessionVal = GetSessionValue(tmpName);
    
    if((tmpSessionVal != "") & (tmpSessionVal != false))
    {
        //alert(objName + "=" + GetSessionValue(tmpName) + " ||  " + tmpVal);
    
        if(tmpSessionVal.indexOf(tmpVal) >= 0)
        {
            if(document.getElementById(hdnName).value.length > 0)
            {
                if(document.getElementById(hdnName).value.indexOf(tmpVal) < 0)
                {
                    document.getElementById(hdnName).value += "," + tmpVal;
                }
            }else{
                document.getElementById(hdnName).value = tmpVal;
            }
        }
    }
}

function ClearSubElements(qName)
{
    var StopCheck = false;
    var checkCount = 0;
    do{
        if(!document.getElementById(qName + checkCount))
        {
            StopCheck = true;
        }else{
            document.getElementById(qName + checkCount).checked = false;
            checkCount = checkCount + 1;
        }
    }while(StopCheck != true);
}

function LoopThroughElements(qName,hName)
{
   
    var StopCheck = false;
    var checkCount = 0;
    do{
        if(!document.getElementById(qName + checkCount))
        {
            StopCheck = true;
        }else{
            CheckHiddenVal(qName + checkCount,hName)
            GetQuestionValuesFromSession(qName + checkCount,hName);
            checkCount = checkCount + 1;
        }
    }while(StopCheck != true);
    
}

function SetQuestionValues()
{
    //document.getElementById("buttons").style.display = "none";
    
    for(var i = 1; i <= 12; i ++)
    {
        LoopThroughElements("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question" + i + "_","hfibrocentertool_question" + i)
        switch(i)
        {
            case 2:
                LoopThroughElements("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question2b_","hfibrocentertool_question2b");
                break;
            default:
                if((i >= 6) && (i <= 10))
                {
                    LoopThroughElements("ctl00_bodyContent_FibrocenterTool1_qfibrocentertool_question" + i + "sub_","hfibrocentertool_question" + i + "sub")
                }
                break;
        }
    }

    //document.getElementById("buttons").style.display = "block";
}


