// this file was generated by Mike Capstick's Javascript Select Quiz Generator
var score=0; 

// The unselected function stops users from changing a selected answer
// It is called by an onfocus event. If an answer was picked it focus is sent to the window

function unselected(x){
        if (x.selectedIndex !=0){
            //    window.focus();  // make drop box lose focus
            document.getElementById('resetbutton').focus();
                alert('Your  answer is locked in and cannot be changed !');
        }
}

function assess(answer){
 // First we blur the current object to lock in the answer
 // we force loss of focus to prevent changes by focusing elsewhere
       // window.focus(); didn't work for ns - method below does
        document.getElementById('resetbutton').focus();
    // answer = this,  passed from onChange event by user selection
    // store option value 1 or 0 in response
    var response = answer.options[answer.selectedIndex].value;
    //check response, increment score if correct and display result
    if (response=='1')
         { score=score+1;
           document.forms[0].scorebox.value=score;
           answer.style.color='green';
         }
    else { answer.style.color='red'};

    }