/***********************************************
* JavaScriptKit.com Multiple Choice Quiz Script (http://www.javascriptkit.com)
* Copyright 2003 JavaScript Kit- http://www.javascriptkit.com
* This notice and footnote must stay intact for use
* Visit JavaScript Kit (http://www.javascriptkit.com/) for full source code
***********************************************/

//Enter total number of questions:
var totalquestions=20

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='c'
correctchoices[2]='b'
correctchoices[3]='c'
correctchoices[4]='c'
correctchoices[5]='d'
correctchoices[6]='d'
correctchoices[7]='a'
correctchoices[8]='c'
correctchoices[9]='a'
correctchoices[10]='c'
correctchoices[11]='b'
correctchoices[12]='c'
correctchoices[13]='c'
correctchoices[14]='b'
correctchoices[15]='a'
correctchoices[16]='d'
correctchoices[17]='d'
correctchoices[18]='a'
correctchoices[19]='a'
correctchoices[20]='c'

var references=new Array()
references[1]=' &nbsp; &nbsp; &nbsp; (Off Field Landings pg 4-10)' //question 1 solution
references[2]=' &nbsp; &nbsp; &nbsp; (Off Field Landings pg 4-10)' //question 1 solution
references[3]=' &nbsp; &nbsp; &nbsp; (Off Field Landings pg 16-6)'
references[4]=' &nbsp; &nbsp; &nbsp; (Airmains Information Manual pg 16-6)'
references[5]=' &nbsp; &nbsp; &nbsp; (FAR 91.130, 91.215 pg 15-4)'
references[6]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend pg 15-4)'
references[7]=' &nbsp; &nbsp; &nbsp; (FAR 91.129, FAR 91.215)'
references[8]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend pg 16-5)'
references[9]=' &nbsp; &nbsp; &nbsp; (FAR 91.155)'
references[10]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend pg 23)'
references[11]=' &nbsp; &nbsp; &nbsp; (FAR 91.135 b)'
references[12]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend, SFM pg 7-2)'
references[13]=' &nbsp; &nbsp; &nbsp; (Soaring Flight Manual pg 7-10)'
references[14]=' &nbsp; &nbsp; &nbsp; (Soaring Flight Manual pg 7-9)'
references[15]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend)'
references[16]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend)'
references[17]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend)'
references[18]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend)'
references[19]=' &nbsp; &nbsp; &nbsp; (Sectional Chart Legend)'
references[20]=' &nbsp; &nbsp; &nbsp; (Soaring Flight Manual pg 15-4)'

/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
	r = q + 80
	var thequestion=eval("document.bb5quiz.question"+q)
	for (c=0;c<thequestion.length;c++){
		if (thequestion[c].checked==true)
		actualchoices[q]=thequestion[c].value
		}
		
	if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
		if (incorrect==null)
		incorrect=r
		else
		incorrect+="/"+r
		}
	}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
window.location="bb5results.html"
}


function nextset() {
	window.location="bb6quiz.html"
}

function showsolution(){
var win2=window.open("","win2","width=420,height=650, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<font face="Arial">')
for (i=1;i<=totalquestions;i++){
    k = i + 80
    for (temp=0;temp<incorrect.length;temp++){
	if (k==incorrect[temp])
	    wrong=1
	}
	if (wrong==1){
	    win2.document.write("Question "+k+"="+correctchoices[i].fontcolor("red")+references[i].fontcolor("red")+"<br>")
	    wrong=0
	}
	else
  	    win2.document.write("Question "+k+"="+correctchoices[i].fontcolor("blue")+references[i].fontcolor("blue")+"<br>")
}
win2.document.write('</font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5><p align='center'><small><a href='http://www.javascriptkit.com' target='_new'>JavaScript Kit quiz script</a></small>")
win2.document.close()
}
