// Correcting Strenght and Balance
// Copyright 2009 Chris Rennie for Senior Abilities Unlimited, LLC

            function start(){
                if (test=="OK"){
			         document.getElementById("start").style.display="none";
			         document.getElementById("startprompt").style.display="none";
                     document.getElementById("hospital").style.display="";
                     currentQ="1a";
                } else {alert(test);
                }
            }

            function hospitalY() {
               document.getElementById("hospital").style.display="none";
               document.getElementById("recentMedicare").style.display=""; 
               currentQ="1b";             
            }
            
            function hospitalN() {
               document.getElementById("hospital").style.display="none";
               document.getElementById("dementia").style.display="";
               currentQ="2";
            }           

            function recentMedicareY() {
               document.getElementById("recentMedicare").style.display="none";
               document.getElementById("private").style.display="";
               //reason a
               document.getElementById("reason").innerHTML="After Medicare physical therapy has finished, private-pay physical therapy focusing on strength and balance, is critical to help preventing falls.";
               
            }
            function recentMedicareN() {
               document.getElementById("recentMedicare").style.display="none";
               document.getElementById("medicare").style.display="";
               
            }          
            function dementiaY() {
               document.getElementById("dementia").style.display="none";
               document.getElementById("private").style.display=""; 
               //reason b
               document.getElementById("reason").innerHTML="Only a physical therapist has the medical knowledge, training and experience to retrain an older adult with a memory impairment. Quite often it will be under private-pay because Medicare does not allow the extra period of service needed to correct the strength and balance deficits.";
            }
            function dementiaN() {
               document.getElementById("dementia").style.display="none";
               document.getElementById("verypoorbalance").style.display="";
               currentQ="3";
            }
            function verypoorbalanceY() {
               document.getElementById("verypoorbalance").style.display="none";
               document.getElementById("private").style.display="";
                //reason c
               document.getElementById("reason").innerHTML="As you've indicated difficulty with transfers, it is recommended that balance training and targeted strength training be undertaken. This requires the expertise of a private-pay physical therapist focusing on strength and balance training. Having difficulty with transfers can limit independence as well as increasing risk for falls.";
            }
            
            function verypoorbalanceN() {
               document.getElementById("verypoorbalance").style.display="none";
               document.getElementById("fear").style.display="";
               currentQ="4";
            }            
            function fearY() {
               document.getElementById("fear").style.display="none";
               document.getElementById("private").style.display="";
               //reason d
               document.getElementById("reason").innerHTML="Strength and balance along with increased confidence is necessary to overcome the fear of falling. A private-pay physical therapist performing increasingly challenging balance activities in the comfort of the home environment, along with targeted strengthening, will overcome the fear of falling.";
                 
            }
            function fearN() {
               document.getElementById("fear").style.display="none";
               document.getElementById("poorbalance").style.display="";
               currentQ="6";
            }
            function poorbalanceY() {
               document.getElementById("poorbalance").style.display="none";
               document.getElementById("specificdiagnosis").style.display="";
               currentQ="5b";
            }
            function poorbalanceN() {
               document.getElementById("poorbalance").style.display="none";
               document.getElementById("feelsweak").style.display="";
            } 
            function specificdiagnosisY() {
               document.getElementById("specificdiagnosis").style.display="none";
               document.getElementById("private").style.display="";
               //reason d
               document.getElementById("reason").innerHTML="Only a physical therapist has the knowledge, training and experience to treat someone with a potentially complicated diagnosis and only a private-pay physical therapist has the means to treat them for strength and balance training for extended periods of time.";
            }
            
            function specificdiagnosisN() {
               document.getElementById("specificdiagnosis").style.display="none";
               document.getElementById("privateorexercises").style.display="";
            }
            function feelsweakY() {
               document.getElementById("feelsweak").style.display="none";
               document.getElementById("oneonone").style.display="";
            }
            function feelsweakN() {
               document.getElementById("feelsweak").style.display="none";
               document.getElementById("classandself").style.display="";
            }
            
            function buttonMouseIn(elm){
                elm.style.cursor="pointer"; 
                elm.style.borderWidth="2px";
                elm.style.padding="2px"; 
                elm.style.fontWeight="bold";          
            }
            
            function buttonMouseOut(elm){
                elm.style.cursor="auto"; 
                elm.style.borderWidth="1px"; 
                elm.style.padding="3px";
                elm.style.fontWeight="normal";                      
            }
            
            function reset(){
                elm=document.getElementById("quizzBoxContents");
                aChildren=elm.childNodes;                
                for (var nn=0;nn<aChildren.length;nn=nn+1){                    
                    var id=aChildren[nn].id;                    
                    if (id !=null){
                        aChildren[nn].style.display="none";
                    } 
                }                            
            }
            
            function backQ() {
                reset();
                switch(currentQ){
                    case "1a":
                        start();
                        break;
                    case "2":
                        hospitalN();
                        break;
                    case "1b":
                        hospitalY();
                        break;
                    case "3":
                        dementiaN();
                        break;
                    case "4":
                        verypoorbalanceN();
                        break;
                    case "5a":
                        fearN();
                        break;
                    case "5b":
                        poorbalanceY();
                        break;
                    case "6":
                        poorbalanceN();
                        break;
                
                }
            
            }

