function NewWindow1() {window1=window.open("agoraphobia.htm", "NewWindow", "resizable=no,top=50,left=50,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,directories=no,width=400,height=200");}

function NewWindow2() {window1=window.open("cognitive_therapy.htm", "NewWindow", "resizable=no,top=50,left=50,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,directories=no,width=400,height=200");}


  QUIZ_QUESTION_CLASS_NAME = 'question';
    QUIZ_QUESTION_OPTIONS_CLASS_NAME = 'questionoptions';
    QUIZ_CORRECT_ANSWER_CLASS_NAME = 'correctanswer';
    QUIZ_INCORRECT_ANSWER_CLASS_NAME = 'incorrectanswer';
    QUIZ_QUESTION_OPTION_CLASS_NAME = 'questionoption';
           
    
    function Quiz_ShowAnswer( optionDiv, showCorrectAnswer )
    {                 
        if( optionDiv )
        {           
            var ShowClassName = ( showCorrectAnswer ) ? QUIZ_CORRECT_ANSWER_CLASS_NAME : QUIZ_INCORRECT_ANSWER_CLASS_NAME;
            
            var Parent = optionDiv.parentNode;

            while( ( Parent ) && (Parent.className.toLowerCase() != QUIZ_QUESTION_OPTIONS_CLASS_NAME ) )
            {
                Parent = Parent.parentNode;              
            }
            
             
            if( Parent )
            {
                var SiblingNodes = Parent.children;
                var NumberOfSiblings = SiblingNodes.length;
                for( ii = 0; ii < NumberOfSiblings; ii++ )
                {
                    if( SiblingNodes[ii].className.toLowerCase() != ShowClassName )
                    {
                   
                        if(
                           ( SiblingNodes[ii].className.toLowerCase() == QUIZ_CORRECT_ANSWER_CLASS_NAME) ||
                           ( SiblingNodes[ii].className.toLowerCase() == QUIZ_INCORRECT_ANSWER_CLASS_NAME) ||
                           ( SiblingNodes[ii].className.toLowerCase() == QUIZ_QUESTION_OPTION_CLASS_NAME)
                        )
                        {
                            SiblingNodes[ii].style.display = 'none';
                        }
                    }
                    else
                    {
                        SiblingNodes[ii].style.display = 'block';
                    }               
                }
            }
        }        
    }
    
    function Quiz_ResetQuestion( answerDiv )
    {
        
        var Parent = answerDiv.parentNode;
        while( ( Parent ) && (Parent.className.toLowerCase() != QUIZ_QUESTION_OPTIONS_CLASS_NAME ) )
        {
            Parent = Parent.parentNode;
        }
        if( Parent )
        {
            var SiblingNodes = Parent.children;
            var NumberOfSiblings = SiblingNodes.length;
            
            for( ii = 0; ii < NumberOfSiblings; ii++ )
            {
                if( 
                    ( SiblingNodes[ii].className.toLowerCase() == QUIZ_CORRECT_ANSWER_CLASS_NAME) ||
                    ( SiblingNodes[ii].className.toLowerCase() == QUIZ_INCORRECT_ANSWER_CLASS_NAME)
                )
                {
                    SiblingNodes[ii].style.display = 'none';
                }
                else if( SiblingNodes[ii].className.toLowerCase() == QUIZ_QUESTION_OPTION_CLASS_NAME )
                {
                    SiblingNodes[ii].style.display = 'block';
                }         
            }
        }
    }
    
    function Quiz_ResetQuiz()
    {
        var NumberOfNodes = document.all.length;
        for( ii = 0; ii < NumberOfNodes; ii++ )
        {
         
            if( document.all[ ii ].className  )
            {
                if( 
                    ( document.all[ ii ].className.toLowerCase() == QUIZ_CORRECT_ANSWER_CLASS_NAME) ||
                    ( document.all[ ii ].className.toLowerCase() == QUIZ_INCORRECT_ANSWER_CLASS_NAME)
                )
                {
                    document.all[ ii ].style.display = 'none';
                }
                else if( document.all[ ii ].className.toLowerCase() == QUIZ_QUESTION_OPTION_CLASS_NAME )
                {
                    document.all[ ii ].style.display = 'block';
                } 
            }
        }
    }
    
