

//<![CDATA[

<!--


function Client(){
//if not a DOM browser, hopeless
	this.min = false; if (document.getElementById){this.min = true;};

	this.ua = navigator.userAgent;
	this.name = navigator.appName;
	this.ver = navigator.appVersion;  

//Get data about the browser
	this.mac = (this.ver.indexOf('Mac') != -1);
	this.win = (this.ver.indexOf('Windows') != -1);

//Look for Gecko
	this.gecko = (this.ua.indexOf('Gecko') > 1);
	if (this.gecko){
		this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
		if (this.geckoVer < 20020000){this.min = false;}
	}
	
//Look for Firebird
	this.firebird = (this.ua.indexOf('Firebird') > 1);
	
//Look for Safari
	this.safari = (this.ua.indexOf('Safari') > 1);
	if (this.safari){
		this.gecko = false;
	}
	
//Look for IE
	this.ie = (this.ua.indexOf('MSIE') > 0);
	if (this.ie){
		this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
		if (this.ieVer < 5.5){this.min = false;}
	}
	
//Look for Opera
	this.opera = (this.ua.indexOf('Opera') > 0);
	if (this.opera){
		this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
		if (this.operaVer < 7.04){this.min = false;}
	}
	if (this.min == false){
		alert('Your browser may not be able to handle this page.');
	}
	
//Special case for the horrible ie5mac
	this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
}

var C = new Client();

//for (prop in C){
//	alert(prop + ': ' + C[prop]);
//}



//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS

//[strNavBarJS]
function NavBtnOver(Btn){
	if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
}

function NavBtnOut(Btn){
	Btn.className = 'NavButton';
}

function NavBtnDown(Btn){
	Btn.className = 'NavButtonDown';
}
//[/strNavBarJS]

function FuncBtnOver(Btn){
	if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
}

function FuncBtnOut(Btn){
	Btn.className = 'FuncButton';
}

function FuncBtnDown(Btn){
	Btn.className = 'FuncButtonDown';
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		if (document.getElementById('CheckButton2') != null){
			document.getElementById('CheckButton2').focus();
		}
		else{
			document.getElementsByTagName('button')[0].focus();
		}
	}
}




//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX

var topZ = 1000;

function ShowMessage(Feedback){
	var Output = Feedback + '<br /><br />';
	document.getElementById('FeedbackContent').innerHTML = Output;
	var FDiv = document.getElementById('FeedbackDiv');
	topZ++;
	FDiv.style.zIndex = topZ;
	FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
//IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
	if (C.gecko){
		document.getElementById('FeedbackOKButton').focus();
	}
	FDiv.style.display = 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');
	ShowElements(false, 'object');
	if (C.ie){
		document.getElementById('FeedbackOKButton').focus();
	}
	
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
	if (C.ie){
		var Els = document.getElementsByTagName(TagName);
		for (var i=0; i<Els.length; i++){
			if (Show == true){
				Els[i].style.display = 'inline';
			}
			else{
				Els[i].style.display = 'none';
			}
		}
	} 
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display = 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	ShowElements(true, 'object');
	if (Finished == true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W = 600;
	this.H = 400;
	this.W = document.getElementsByTagName('body')[0].clientWidth;
	this.H = document.getElementsByTagName('body')[0].clientHeight;
}

var pg = null;

function GetPageXY(El) {
	var XY = {x: 0, y: 0};
	while(El){
		XY.x += El.offsetLeft;
		XY.y += El.offsetTop;
		El = El.offsetParent;
	}
	return XY;
}

function GetScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop;
	}
	else{
		if (document.body){
 			return document.body.scrollTop;
		}
		else{
			return window.pageYOffset;
		}
	}
}

function GetViewportHeight(){
	if (window.innerHeight){
		return window.innerHeight;
	}
	else{
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function TopSettingWithScrollOffset(TopPercent){
	var T = Math.floor(GetViewportHeight() * (TopPercent/100));
	return GetScrollTop() + T; 
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
var InTextBox = false;

function SuppressBackspace(e){ 
	if (InTextBox == true){return;}
	if (C.ie) {
		thisKey = window.event.keyCode;
	}
	else {
		thisKey = e.keyCode;
	}

	var Suppress = false;

	if (thisKey == 8) {
		Suppress = true;
	}

	if (Suppress == true){
		if (C.ie){
			window.event.returnValue = false;	
			window.event.cancelBubble = true;
		}
		else{
			e.preventDefault();
		}
	}
}

if (C.ie){
	document.attachEvent('onkeydown',SuppressBackspace);
	window.attachEvent('onkeydown',SuppressBackspace);
}
else{
	window.addEventListener('keypress',SuppressBackspace,false);
}

function ReduceItems(InArray, ReduceToSize){
	var ItemToDump=0;
	var j=0;
	while (InArray.length > ReduceToSize){
		ItemToDump = Math.floor(InArray.length*Math.random());
		InArray.splice(ItemToDump, 1);
	}
}

function Shuffle(InArray){
	Temp = new Array();
	var Len = InArray.length;

	var j = Len;

	for (var i=0; i<Len; i++){
		Temp[i] = InArray[i];
	}

	for (i=0; i<Len; i++){
		Num = Math.floor(j  *  Math.random());
		InArray[i] = Temp[Num];

		for (var k=Num; k < j; k++) {
			Temp[k] = Temp[k+1];
		}
		j--;
	}
	return InArray;
}

function WriteToInstructions(Feedback) {
	document.getElementById('InstructionsDiv').innerHTML = Feedback;

}




function EscapeDoubleQuotes(InString){
	return InString.replace(/"/g, '&quot;')
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		document.getElementsByTagName('button')[0].focus();
	}
}

function TrimString(InString){
        var x = 0;

        if (InString.length != 0) {
                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
                        InString = InString.substring(0, InString.length - 1)
                }

                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
                        InString = InString.substring(1, InString.length)
                }

                while (InString.indexOf('  ') != -1) {
                        x = InString.indexOf('  ')
                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
                 }

                return InString;
        }

        else {
                return '';
        }
}

function FindLongest(InArray){
	if (InArray.length < 1){return -1;}

	var Longest = 0;
	for (var i=1; i<InArray.length; i++){
		if (InArray[i].length > InArray[Longest].length){
			Longest = i;
		}
	}
	return Longest;
}

//UNICODE CHARACTER FUNCTIONS
function IsCombiningDiacritic(CharNum){
	var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
	Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
	return Result;
}

function IsCJK(CharNum){
	return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
}

//SETUP FUNCTIONS
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
function ClearTextBoxes(){
	var NList = document.getElementsByTagName('input');
	for (var i=0; i<NList.length; i++){
		if ((NList[i].id.indexOf('Guess') > -1)||(NList[i].id.indexOf('Gap') > -1)){
			NList[i].value = '';
		}
		if (NList[i].id.indexOf('Chk') > -1){
			NList[i].checked = '';
		}
	}
}

//EXTENSION TO ARRAY OBJECT
function Array_IndexOf(Input){
	var Result = -1;
	for (var i=0; i<this.length; i++){
		if (this[i] == Input){
			Result = i;
		}
	}
	return Result;
}
Array.prototype.indexOf = Array_IndexOf;

//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
function RemoveBottomNavBarForIE(){
	if ((C.ie)&&(document.getElementById('Reading') != null)){
		if (document.getElementById('BottomNavBar') != null){
			document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
		}
	}
}




//HOTPOTNET-RELATED CODE

var HPNStartTime = (new Date()).getTime();
var SubmissionTimeout = 30000;
var Detail = ''; //Global that is used to submit tracking data

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store != null){
		Frm = document.store;
		Frm.starttime.value = HPNStartTime;
		Frm.endtime.value = (new Date()).getTime();
		Frm.mark.value = Score;
		Frm.detail.value = Detail;
		Frm.submit();
	}
}



//JQUIZ CORE JAVASCRIPT CODE

var CurrQNum = 0;
var CorrectIndicator = ':-)';
var IncorrectIndicator = 'X';
var YourScoreIs = 'Your score is ';
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';
var ShowCorrectFirstTime = false;
var ShuffleQs = true;
var ShuffleAs = true;
var DefaultRight = 'Correct!';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 10;
var Score = 0;
var Finished = false;
var Qs = null;
var QArray = new Array();
var ShowingAllQuestions = false;
var ShowAllQuestionsCaption = 'Show all questions';
var ShowOneByOneCaption = 'Show questions one by one';
var State = new Array();
var Feedback = '';
var TimeOver = false;
var strInstructions = '';

//The following variable can be used to add a message explaining that
//the question is finished, so no further marking will take place.
var strQuestionFinished = '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=0; QNum<I.length; QNum++){
//Only do this if not multi-select
		if (I[QNum][2] != '3'){
  		for (ANum = 0; ANum<I[QNum][3].length; ANum++){
  			if (I[QNum][3][ANum][1].length < 1){
  				if (I[QNum][3][ANum][2] > 0){
  					I[QNum][3][ANum][1] = DefaultRight;
  				}
  				else{
  					I[QNum][3][ANum][1] = DefaultWrong;
  				}
  			}
  		}
		}
	}
}

function SetUpQuestions(){
	var AList = new Array(); 
	var QList = new Array();
	var i, j;
	Qs = document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem = 0;
	while (QsToShow < QList.length){
		DumpItem = Math.floor(QList.length*Math.random());
		for (j=DumpItem; j<(QList.length-1); j++){
			QList[j] = QList[j+1];
		}
		QList.length = QList.length-1;
	}
	if (ShuffleQs == true){
		QList = Shuffle(QList);
	}
	if (ShuffleAs == true){
		var As;
		for (var i=0; i<QList.length; i++){
			As = QList[i].getElementsByTagName('ol')[0];
			if (As != null){
  			AList.length = 0;
				while (As.getElementsByTagName('li').length > 0){
					AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
				}
				AList = Shuffle(AList);
				for (j=0; j<AList.length; j++){
					As.appendChild(AList[j]);
				}
			}
		}
	}
	
	for (i=0; i<QList.length; i++){
		Qs.appendChild(QList[i]);
		QArray[QArray.length] = QList[i];
	}

//Show the first item
	QArray[0].style.display = '';
	
//Now hide all except the first item
	for (i=1; i<QArray.length; i++){
		QArray[i].style.display = 'none';
	}		
	SetQNumReadout();
}

function ChangeQ(ChangeBy){
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
	QArray[CurrQNum].style.display = 'none';
	CurrQNum += ChangeBy;
	QArray[CurrQNum].style.display = '';
	SetQNumReadout();
//if there's a textbox, set the focus in it
	if (QArray[CurrQNum].getElementsByTagName('input')[0] != null){
		QArray[CurrQNum].getElementsByTagName('input')[0].focus();
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
}

I=new Array();
I[0]=new Array();I[0][0]=100;
I[0][1]='';
I[0][2]='0';
I[0][3]=new Array();
I[0][3][0]=new Array('Cargo Capacity','Right.  While this might be an important consideration for merchant ships, it is not a major design factor in the construction of naval ships.',1,100,1);
I[0][3][1]=new Array('Mission','Sorry.  The mission, or main purpose, of a ship is the biggest consideration in its overall design.  Every ship, whether naval or merchant, is built for a specific mission.  Tradeoffs and compromises are made during it\'s construction are made to optimize it for its primary mission.',0,0,1);
I[0][3][2]=new Array('Seaworthiness','Sorry.  Seaworthiness is defined as the ship\'s ability to operate in all kinds of weather, high winds, and heavy seas.  The ability to perform well under these circumstances is of critical importance to both naval and merchant ships alike.',0,0,1);
I[0][3][3]=new Array('Protection','Nope.  Protection is the factor that takes into consideration all of the features that help a ship survive enemy attack.  While less important to a merchant ship than a naval ship, it is still a consideration taken into account in the construction of all ships.',0,0,1);
I[0][3][4]=new Array('Endurance','Nope.  Endurance is the maximum time a ship can steam at a given speed and this is an important consideration when building either a merchant or naval ship.',0,0,1);
I[1]=new Array();I[1][0]=100;
I[1][1]='';
I[1][2]='0';
I[1][3]=new Array();
I[1][3][0]=new Array('Technology','Correct!  While the latest technology is incorporated into naval ships as they are built, technology is not considered to be an independent factor in the construction of naval ships, but an included consideration within each of the major areas of construction.',1,100,1);
I[1][3][1]=new Array('Armament','Nope.  Armament refers to all of the offensive weapons used to fight an enemy on or under the sea, and in the air as well.  You build a naval ship to fight, and it fights with its armament.  That makes this a very important factor in naval ship construction.',0,0,1);
I[1][3][2]=new Array('Maneuverability','Sorry.  Maneuverability refers to the way a ship handles when turning, backing down or going alongside another ship.  Naval combatant ships must be able to quickly change course and speed when engaged, so this a very important consideration when building an warship.',0,0,1);
I[1][3][3]=new Array('Habitability','Sorry.  Habitability refers to the features designed to provide comfortable living conditions for the crew.  This is an important area to consider because it affects the crew\'s combat readiness and willingness to make the Navy a career.',0,0,1);
I[1][3][4]=new Array('Speed','Nope.  Speed gets a ship to the scene of action quickly and enables her to outmaneuver an enemy.  It is therefore a very important factor in naval ship construction and design.',0,0,1);
I[2]=new Array();I[2][0]=100;
I[2][1]='';
I[2][2]='0';
I[2][3]=new Array();
I[2][3][0]=new Array('Seaworthiness','Right!  The ability to perform well under these circumstances is of critical importance to both naval and merchant ships alike.',1,100,1);
I[2][3][1]=new Array('Maneuverability','Sorry.  Maneuverability refers to the way a ship handles when turning, backing down or going alongside another ship.  Naval combatant ships must be able to quickly change course and speed when engaged, so this a very important consideration when building an warship.',0,0,1);
I[2][3][2]=new Array('Endurance','Sorry.  Endurance is the maximum time a ship can steam at a given speed and this is an important consideration when building either a merchant or naval ship.',0,0,1);
I[2][3][3]=new Array('Habitability','Nope.  Habitability refers to the features designed to provide comfortable living conditions for the crew.  This is an important area to consider because it affects the crew\'s combat readiness and willingness to make the Navy a career.',0,0,1);
I[2][3][4]=new Array('Mission','Nope.  The mission, or main purpose, of a ship is the biggest consideration in its overall design.  Every ship, whether naval or merchant, is built for a specific mission.  Tradeoffs and compromises are made during it\'s construction are made to optimize it for its primary mission.',0,0,1);
I[3]=new Array();I[3][0]=100;
I[3][1]='';
I[3][2]='0';
I[3][3]=new Array();
I[3][3][0]=new Array('Endurance','Right!  For naval ships this can depend on a number of factors, including fuel capacity, freshwater capacity, fuel consumption, and storage space and refrigeration for food provisions.',1,100,1);
I[3][3][1]=new Array('Maneuverability','Sorry.  Maneuverability refers to the way a ship handles when turning, backing down or going alongside another ship.  Naval combatant ships must be able to quickly change course and speed when engaged, so this a very important consideration when building an warship.',0,0,1);
I[3][3][2]=new Array('Seaworthiness','Sorry.  Seaworthiness is defined as the ship\'s ability to operate in all kinds of weather, high winds, and heavy seas.  The ability to perform well under these circumstances is of critical importance to both naval and merchant ships alike.',0,0,1);
I[3][3][3]=new Array('Speed','Nope.  The consideration of the speed of the ship is only one element.  The questions asks for the name of the design factor that is concerned with the tradeoff between speed and the maximum amount of time a ship can steam.',0,0,1);
I[3][3][4]=new Array('Mission','Nope.  The mission, or main purpose, of a ship is the biggest consideration in its overall design, but it concerns the tradeoffs and compromises which must be made to the overall design so that the ship is optimized for the jobs for which it was built.',0,0,1);
I[4]=new Array();I[4][0]=100;
I[4][1]='';
I[4][2]='0';
I[4][3]=new Array();
I[4][3][0]=new Array('Maneuverability','Correct!  Naval combatants, such as carriers and destroyers, must be able to change course and speed rapidly to accomplish their missions.',1,100,1);
I[4][3][1]=new Array('Seaworthiness','Sorry.  Seaworthiness is defined as the ship\'s ability to operate in all kinds of weather, high winds, and heavy seas.  The ability to perform well under these circumstances is of critical importance to both naval and merchant ships alike.',0,0,1);
I[4][3][2]=new Array('Protection','Sorry.  Protection is the factor that takes into consideration all of the features that help a ship survive enemy attack.  While less important to a merchant ship than a naval ship, it is still a consideration taken into account in the construction of all ships.',0,0,1);
I[4][3][3]=new Array('Armament','Nope.  Armament refers to all of the offensive weapons used to fight an enemy on or under the sea, and in the air as well.  You build a naval ship to fight, and it fights with its armament.  That makes this a very important factor in naval ship construction.',0,0,1);
I[4][3][4]=new Array('Endurance','Nope.  Endurance is the maximum time a ship can steam at a given speed and this is an important consideration when building either a merchant or naval ship.',0,0,1);
I[5]=new Array();I[5][0]=100;
I[5][1]='';
I[5][2]='0';
I[5][3]=new Array();
I[5][3][0]=new Array('Endurance','Right!  Endurance is the maximum time a ship can steam at a given speed and this is an important consideration when building either a merchant or naval ship.',1,100,1);
I[5][3][1]=new Array('Seaworthiness','Sorry.  Seaworthiness is defined as the ship\'s ability to operate in all kinds of weather, high winds, and heavy seas.',0,0,1);
I[5][3][2]=new Array('Maneuverability','Sorry.  Maneuverability refers to the way a ship handles when turning, backing down or going alongside another ship. ',0,0,1);
I[5][3][3]=new Array('Habitability','Nope.  Habitability refers to the features designed to provide comfortable living conditions for the crew.  This is an important area to consider because it affects the crew\'s combat readiness and willingness to make the Navy a career.',0,0,1);
I[5][3][4]=new Array('Protection','Nope.  Cruising range is a term that deals with the distance a ship can go given a certain speed.  Protection is the factor that takes into consideration all of the features that help a ship survive enemy attack.',0,0,1);
I[6]=new Array();I[6][0]=100;
I[6][1]='';
I[6][2]='0';
I[6][3]=new Array();
I[6][3][0]=new Array('Oil','Correct.  Oil is still the most common form of fuel used to power ships today.  Due to the consumption rate at which it is burned and the average storage capacity of most naval ships, vessels using this power source must generally refuel once every one or two weeks.',1,100,1);
I[6][3][1]=new Array('Steam','Nope.  Steam is used to run the turbines of most ships today, but it is not itself a fuel.  Fuels are used to heat up water to create the steam to drive the turbines.',0,0,1);
I[6][3][2]=new Array('Nuclear','Nope.  Nuclear-powered ships use an energy source that lasts for decades.',0,0,1);
I[6][3][3]=new Array('Coal','Sorry.  Very few merchant ships, an no naval ships, are currently powered by coal.  Coal gave way to another form of fuel about 100 years ago.',0,0,1);
I[6][3][4]=new Array('Electric','Sorry.  Electric-driven ships are being designed for the Navy right now and will be the way of the future for the US Navy.  Any type of fuel can be used to generate the electricity, however.  Think about an older form of fuel.',0,0,1);
I[7]=new Array();I[7][0]=100;
I[7][1]='';
I[7][2]='0';
I[7][3]=new Array();
I[7][3][0]=new Array('30 days','Right.  When it is feasible to replenish stores of fresh provisions, this is done to provide the crew with fresh meats and vegetables.  When it is not feasible to do this, such as with submarines, canned goods are used when the fresh provisions run out.',1,100,1);
I[7][3][1]=new Array('One to two weeks','Sorry.  You may be thinking about the normal time that oil-powered ships need to refuel.  That\'s about one to two weeks.  Fresh provisions can generally last longer than this due to advances in refrigeration and storage capabilities.',0,0,1);
I[7][3][2]=new Array('Three months','Nope.  Despite advances in refrigeration and storage capabilities, you can\'t maintain fresh provisions this long.  You can, however, keep canned provisions this long and longer.',0,0,1);
I[7][3][3]=new Array('Six months','Nope.  Despite advances in refrigeration and storage capabilities, you can\'t maintain fresh provisions this long.  You can, however, keep canned provisions this long and longer.',0,0,1);
I[7][3][4]=new Array('Every other day','Sorry.  Fresh provisions don\'t get used up or spoil this rapidly.',0,0,1);
I[8]=new Array();I[8][0]=100;
I[8][1]='';
I[8][2]='0';
I[8][3]=new Array();
I[8][3][0]=new Array('Accommodations ladders','Correct!  These are a very important ladders to the crew, since it allows them to go off the ship on liberty while in port.',1,100,1);
I[8][3][1]=new Array('Jacob\'s ladders','Sorry.  Jacob\'s ladders are portable ladders made of rope or metal used to climb up the side of a ship.',0,0,1);
I[8][3][2]=new Array('Passageways','Sorry.  The term "Passageway" means "hallways" in naval jargon.',0,0,1);
I[8][3][3]=new Array('Fantail ladders','Nope.  There is no such term as "Fantail ladders".',0,0,1);
I[8][3][4]=new Array('Quarterdeck stairs','Nope.  Remember, stairs are called "ladders" onboard ships.',0,0,1);
I[9]=new Array();I[9][0]=100;
I[9][1]='';
I[9][2]='0';
I[9][3]=new Array();
I[9][3][0]=new Array('Jacob\'s Ladders','Right!  Once the most common form of ladders on a ship, they are used less and less today as they pose the most significant safety hazard of any ladder onboard a ship.',1,100,1);
I[9][3][1]=new Array('Accommodation Ladders','Sorry.  Accommodation ladders run from the ship to a pier and are the normal method for crewmembers to get on and off a ship while in port.',0,0,1);
I[9][3][2]=new Array('Athwartships Ladders','Nope.  There is no such thing as a "Athwartships Ladder"',0,0,1);
I[9][3][3]=new Array('Hawser Ladders','Sorry.  Although a Hawser is a large type of rope for nautical use, it is too large to make ladders.',0,0,1);
I[9][3][4]=new Array('Quarterdeck Ladders','Nope.  There is no such thing as a "Quarterdeck Ladder"',0,0,1);
I[10]=new Array();I[10][0]=100;
I[10][1]='';
I[10][2]='0';
I[10][3]=new Array();
I[10][3][0]=new Array('The Quarterdeck','Correct.  As a measure of security and control while pierside in port, everyone coming on or departing the ship moves through the quarterdeck.',1,100,1);
I[10][3][1]=new Array('The Forecastle','Sorry.  The Forecastle is the name given to the forward part of the main deck.',0,0,1);
I[10][3][2]=new Array('The Keel','Nope.  The keel is the structural member running the length of the boat at the bottom of the hull.',0,0,1);
I[10][3][3]=new Array('The Gunwale','Nope.  The gunwale is the intersection of the main deck with the shell or side plating of the ship.',0,0,1);
I[10][3][4]=new Array('The Bridge','Sorry.  The bridge is the place from which the ship is controlled and maneuvered.',0,0,1);
I[11]=new Array();I[11][0]=100;
I[11][1]='';
I[11][2]='0';
I[11][3]=new Array();
I[11][3][0]=new Array('Athwartships','Right.  Athwartships refers to something moving across the beam of a ship.',1,100,1);
I[11][3][1]=new Array('Fore','Nope.  Fore refers to something moving or located towards the bow of a ship.',0,0,1);
I[11][3][2]=new Array('Aft','Nope.  Aft refers to something moving or located towards the stern of a ship.',0,0,1);
I[11][3][3]=new Array('Transverse','Sorry.  While transverse beams do indeed run crosswise across the width of a ship, this is not the proper term used for their direction of travel.',0,0,1);
I[11][3][4]=new Array('Longitudinal','Sorry.  Longitudinal means along the long axis of the ship, running from bow to stern.',0,0,1);
I[12]=new Array();I[12][0]=100;
I[12][1]='';
I[12][2]='0';
I[12][3]=new Array();
I[12][3][0]=new Array('Beam','Correct!  The beam is the extreme width of a ship at its widest part.',1,100,1);
I[12][3][1]=new Array('Quarter','Nope.  The term "Quarter" is a direction relative to the bow of the ship and is located aft of the ships beam, toward the stern, on either the port or starboard side.',0,0,1);
I[12][3][2]=new Array('Fantail','Nope.  The fantail is the back deck or part of a ship.',0,0,1);
I[12][3][3]=new Array('Athwartships','Sorry.  This term refers to anything moving or located crosswise to this ships structure.',0,0,1);
I[12][3][4]=new Array('Transverse','Sorry.  The term "Transverse" generally refers to structuronal beams of ships which run athwartships, or across, the ship\'s structure.',0,0,1);
I[13]=new Array();I[13][0]=100;
I[13][1]='';
I[13][2]='0';
I[13][3]=new Array();
I[13][3][0]=new Array('Amidships','Right.  The name makes sense, doesn\'t it?  The area around the midpoint of the ship is "amidships".',1,100,1);
I[13][3][1]=new Array('Quarterdeck','Sorry.  The quarterdeck is similar to a building\'s entrance hall or foyer.  As a measure of security and control while pierside in port, everyone coming on or departing the ship moves through the quarterdeck.',0,0,1);
I[13][3][2]=new Array('Fantail','Nope.  The fantail is the back part of the ship\'s main deck.',0,0,1);
I[13][3][3]=new Array('Forecastle','Nope.  The forecastle is the forward part of the ship\'s main deck.',0,0,1);
I[13][3][4]=new Array('Beam','Sorry.  The beam is the extreme width of the ship at its widest part.  While it is normally around the midpoint area, it is not necessarily so.',0,0,1);
I[14]=new Array();I[14][0]=100;
I[14][1]='';
I[14][2]='0';
I[14][3]=new Array();
I[14][3][0]=new Array('Starboard','Correct!  Starboard is the nautical term for "right".',1,100,1);
I[14][3][1]=new Array('Port','Sorry.  This word refers to things located to the left of centerline.',0,0,1);
I[14][3][2]=new Array('Amidships','Nope.  Something located amidships would be situated near the center of the ship and could be on either side of the centerline.',0,0,1);
I[14][3][3]=new Array('Abaft','Sorry.  The term "abaft" refers to something located toward the stern of a ship.',0,0,1);
I[14][3][4]=new Array('Aloft','Nope.  The term "aloft" refers to areas above the solid structure of the ship.',0,0,1);
I[15]=new Array();I[15][0]=100;
I[15][1]='';
I[15][2]='0';
I[15][3]=new Array();
I[15][3][0]=new Array('Outboard','Right.  Outboard is a relative term and is used to describe things located farther from the center of a ship than something else.',1,100,1);
I[15][3][1]=new Array('Inboard','Sorry.  This term refers to things located closer to the center of the ship than something else.',0,0,1);
I[15][3][2]=new Array('Port','Nope.  The term port is only used for direction from the centerline towards the left side of the ship.',0,0,1);
I[15][3][3]=new Array('Starboard','Nope.  The term starboard is only used for direction from the centerline towards the right side of the ship.',0,0,1);
I[15][3][4]=new Array('Larboard','Sorry.  Larboard is the left side of a ship or aircraft to someone facing the bow or nose.  The term "port" is generally used instead of larboard today.',0,0,1);
I[16]=new Array();I[16][0]=100;
I[16][1]='';
I[16][2]='0';
I[16][3]=new Array();
I[16][3][0]=new Array('Quarter','Correct!  Something located aft of ship\'s beam toward the stern would be referred to as either off the Port or Starboard Quarter.',1,100,1);
I[16][3][1]=new Array('Beam','Sorry.  Beam is a physical term describing the extreme width of a ship at its widest part.',0,0,1);
I[16][3][2]=new Array('Bow','Nope.  The term bow is used to describe the location of something forward of the beam of the ship.',0,0,1);
I[16][3][3]=new Array('Abeam','Sorry.  Something is abeam when it is directly alongside the ship, either on the port or starboard side.',0,0,1);
I[16][3][4]=new Array('Below decks','Nope.  This term refers to something below the main deck of the ship.',0,0,1);
I[17]=new Array();I[17][0]=100;
I[17][1]='';
I[17][2]='0';
I[17][3]=new Array();
I[17][3][0]=new Array('Below','Right!  Rather than going downstairs, you go "below decks".',1,100,1);
I[17][3][1]=new Array('Aloft','Sorry.  Exactly the opposite.  The term aloft is used to describe anything located above the main deck of a ship.',0,0,1);
I[17][3][2]=new Array('Under','Nope.  While it sounds like this might be the case, "under" is not used to describe going downstairs on a ship.',0,0,1);
I[17][3][3]=new Array('Mainside','Nope.  The term mainside is used to describe the major, most active, part of a ship or station.',0,0,1);
I[17][3][4]=new Array('Abaft','Sorry.  ',0,0,1);
I[18]=new Array();I[18][0]=100;
I[18][1]='';
I[18][2]='0';
I[18][3]=new Array();
I[18][3][0]=new Array('Aloft','Correct!  This generally refers to masts, stacks and rigging.',1,100,1);
I[18][3][1]=new Array('Topside','Sorry.  Topside refers to decks or solid structures above the main deck of a ship.  The term we are looking for here are for things located above these decks or solid structures.',0,0,1);
I[18][3][2]=new Array('Below decks','Nope.  Things "below decks" are things located below the main deck of the ship.',0,0,1);
I[18][3][3]=new Array('Abaft','Sorry.  Abaft is a term used in directions to refer to something aft of the center of a ship, towards the stern.',0,0,1);
I[18][3][4]=new Array('Athwartships','Nope.  This term refers to anything moving or located crosswise to this ships structure.',0,0,1);
I[19]=new Array();I[19][0]=100;
I[19][1]='';
I[19][2]='0';
I[19][3]=new Array();
I[19][3][0]=new Array('Keel','Right.  The keel would connect at the bow to the stem post and at the stern to the stern post.',1,100,1);
I[19][3][1]=new Array('Transverse Frame','Sorry.  Transverse frames are structural walls or frames that run athwartships.',0,0,1);
I[19][3][2]=new Array('Longitudinal Bulkhead','Nope.  Longitudinal bulkheads are simply structural walls or frames that run in direction from the bow to the stern.',0,0,1);
I[19][3][3]=new Array('Void','Nope.  Voids are empty spaces filled with air generally in the honeycombed bottom of a ship called the "double bottom".',0,0,1);
I[19][3][4]=new Array('Bilge','Sorry.  The bilge is the lower internal part of the hull where the vertical sides meet the bottom.',0,0,1);
I[20]=new Array();I[20][0]=100;
I[20][1]='';
I[20][2]='0';
I[20][3]=new Array();
I[20][3][0]=new Array('Transverse frames','Correct.  Transverse frames support the watertight skin or "shell plating" of the ship',1,100,1);
I[20][3][1]=new Array('Longitudinal frames','Sorry.  Longitudinal frames are girders but they run fore and aft, not athwartships.',0,0,1);
I[20][3][2]=new Array('Bilge keels','Nope.  Bilge keels are projections at the joint between the side plating and the bottom plating of the ship.  Their purpose is to reduce rolling of the ship.',0,0,1);
I[20][3][3]=new Array('Stem posts','Sorry.  The stem post is the structural member that connects the keel to the bow of the ship.',0,0,1);
I[20][3][4]=new Array('Double bottoms','Nope.  Double bottoms are the honeycomb structures at the bottom of the ship, above the keel, that strengthen the bottom of the ship.',0,0,1);
I[21]=new Array();I[21][0]=100;
I[21][1]='';
I[21][2]='0';
I[21][3]=new Array();
I[21][3][0]=new Array('The Gunwale','Right!  This is also known as the "deck edge".',1,100,1);
I[21][3][1]=new Array('The Forecastle','Nope.  The forecastle is the forward part of the ship\'s main deck.',0,0,1);
I[21][3][2]=new Array('The Bilge Keel','Sorry.  Bilge keels are projections at the joint between the side plating and the bottom plating of the ship.  Their purpose is to reduce rolling of the ship.',0,0,1);
I[21][3][3]=new Array('The Stem Post','Sorry.  The stem post is the structural member that connects the keel to the bow of the ship.',0,0,1);
I[21][3][4]=new Array('The Quarterdeck','Nope.  The quarterdeck is similar to a building\'s entrance hall or foyer.  As a measure of security and control while pierside in port, everyone coming on or departing the ship moves through the quarterdeck.',0,0,1);
I[22]=new Array();I[22][0]=100;
I[22][1]='';
I[22][2]='0';
I[22][3]=new Array();
I[22][3][0]=new Array('Yaw','Correct!  Technically this is rotation around the ship\'s vertical axis.',1,100,1);
I[22][3][1]=new Array('Pitch','Sorry.  Pitch is the axis of movement which causes the ship to move up and down, fore and aft, around the beam of the ship.',0,0,1);
I[22][3][2]=new Array('Roll','Sorry.  Roll is the axis of movement which causes a ship to move from side to side along the longitudinal axis of the ship.',0,0,1);
I[22][3][3]=new Array('Break','Nope.  There is no such term as "break" when referring to axis of movement.',0,0,1);
I[22][3][4]=new Array('Outboard','Nope.  While the term outboard refers to anything located away from the centerline of a ship, this is not the name of the axis of movement which causes the bow of a ship to swing from port to starboard.',0,0,1);
I[23]=new Array();I[23][0]=100;
I[23][1]='';
I[23][2]='0';
I[23][3]=new Array();
I[23][3][0]=new Array('Draft','Right!  This is important because you don\'t want to run aground, which is what happens when your draft equals zero!',1,100,1);
I[23][3][1]=new Array('Freeboard','Nope.  Freeboard is the distance from the waterline to the main deck.',1,100,1);
I[23][3][2]=new Array('Transom','Sorry.  A transom is a horizontal transverse beam or bar in a frame.',0,0,1);
I[23][3][3]=new Array('Fathom','Nope.  A fathom is a measure of distance equal to six feet.  The depth of water is generally expressed in fathoms.',0,0,1);
I[23][3][4]=new Array('Depth','Sorry.  The term depth generally refers to the vertical distance from the waterline to the bottom of the sea or ocean.',0,0,1);
I[24]=new Array();I[24][0]=100;
I[24][1]='';
I[24][2]='0';
I[24][3]=new Array();
I[24][3][0]=new Array('Freeboard','Correct!  Generally the more loaded-down a ship is, the lower it sinks into the water and therefore the lower the freeboard distance.',1,100,1);
I[24][3][1]=new Array('Draft','Nope.  Draft is the vertical distance from the keel to the waterline.',0,0,1);
I[24][3][2]=new Array('Transom','Sorry.  A transom is a horizontal transverse beam or bar in a frame.',0,0,1);
I[24][3][3]=new Array('Fathom','Nope.  A fathom is a measure of distance equal to six feet.  The depth of water is generally expressed in fathoms.',0,0,1);
I[24][3][4]=new Array('Depth','Sorry.  The term depth generally refers to the vertical distance from the waterline to the bottom of the sea or ocean.',0,0,1);
I[25]=new Array();I[25][0]=100;
I[25][1]='';
I[25][2]='0';
I[25][3]=new Array();
I[25][3][0]=new Array('Compartments','Right.  All spaces on a ship are generally referred to as compartments and given a compartment number to identify them.',1,100,1);
I[25][3][1]=new Array('Decks','Nope.  Decks are the "floors" of a ship.',0,0,1);
I[25][3][2]=new Array('Voids','Nope.  Voids are empty spaces filled with air generally in the honeycombed bottom of a ship called the "double bottom".',0,0,1);
I[25][3][3]=new Array('Spaces','Sorry.  While sometimes the generic term "spaces" is used to refer to rooms onboard ships, this is not the proper term.',0,0,1);
I[25][3][4]=new Array('Staterooms','Sorry.  While some rooms onboard a ship are known as staterooms, this is just one type of room on a ship.  The most common type has another name.',0,0,1);
I[26]=new Array();I[26][0]=100;
I[26][1]='';
I[26][2]='0';
I[26][3]=new Array();
I[26][3][0]=new Array('The mess deck','Correct!  The mess deck is generally located on the main deck, but this is not always the case.  For officers the dining area is called the "wardroom".',1,100,1);
I[26][3][1]=new Array('The galley','Sorry.  The galley is the nautical term for the "kitchen" and it is where the food is prepared.  This is not the name for the dining area, however.',0,0,1);
I[26][3][2]=new Array('The main deck','Sorry.  The main deck is the uppermost of all decks that run continuously from bow to stern.',0,0,1);
I[26][3][3]=new Array('The forecastle','Nope.  The forecastle is the forward part of the ship\'s main deck.',0,0,1);
I[26][3][4]=new Array('The quarterdeck','Nope.  The quarterdeck is similar to a building\'s entrance hall or foyer.  As a measure of security and control while pierside in port, everyone coming on or departing the ship moves through the quarterdeck.',0,0,1);
I[27]=new Array();I[27][0]=100;
I[27][1]='';
I[27][2]='0';
I[27][3]=new Array();
I[27][3][0]=new Array('Complete Decks','Right!  There are generally several complete decks on a ship, including the main deck.',1,100,1);
I[27][3][1]=new Array('Main Decks','Sorry.  While main decks do extend from side to side and stem to stern, they are not the only decks to do so.  There is another, collective, term to describe these decks.',0,0,1);
I[27][3][2]=new Array('Flight Decks','Nope.  A flight deck is the uppermost complete deck of an aircraft carrier where flight operations are conducted.',0,0,1);
I[27][3][3]=new Array('Hangar Decks','Nope.  A hangar deck is the main deck of an aircraft carrier where aircraft are stowed and serviced.',0,0,1);
I[27][3][4]=new Array('Poop Decks','Sorry.  A poop deck is a partial deck above the main deck at the stern of the ship.',0,0,1);
I[28]=new Array();I[28][0]=100;
I[28][1]='';
I[28][2]='0';
I[28][3]=new Array();
I[28][3][0]=new Array('The Forecastle Deck','Correct.  Remember, the forecastle is always forward!',1,100,1);
I[28][3][1]=new Array('The Upper Deck','Sorry.  The upper deck is a partial deck above the main deck, but it is located amidships.',0,0,1);
I[28][3][2]=new Array('The Poop Deck','Sorry.  The poop deck is a partial deck above the main deck, but it is located at the stern of the ship.',0,0,1);
I[28][3][3]=new Array('The Quarter Deck','Nope.  The quarterdeck is similar to a building\'s entrance hall or foyer.  As a measure of security and control while pierside in port, everyone coming on or departing the ship moves through the quarterdeck.',0,0,1);
I[28][3][4]=new Array('The Transverse Deck','Sorry.  There is no transverse deck.  You might be thinking about transverse deck beams which strengthen the ship athwartships.',0,0,1);
I[29]=new Array();I[29][0]=100;
I[29][1]='';
I[29][2]='0';
I[29][3]=new Array();
I[29][3][0]=new Array('Above the main deck amidships.','Right.  Unlike the forecastle and poop decks, most Navy ships have an upper deck today.',1,100,1);
I[29][3][1]=new Array('Above the main deck at the bow.','Nope.   You\'ve got one of the two correct however.',0,0,1);
I[29][3][2]=new Array('Above the main deck at the stern.','Sorry.   You\'ve got one of the two correct however.',0,0,1);
I[29][3][3]=new Array('On the main deck amidships.','Sorry.  You\'ve got one of the two correct however.',0,0,1);
I[29][3][4]=new Array('On the main deck at the bow.','Nope.  You missed on both counts!',0,0,1);
I[30]=new Array();I[30][0]=100;
I[30][1]='';
I[30][2]='0';
I[30][3]=new Array();
I[30][3][0]=new Array('Platform Decks','Correct.  You can imagine that platform decks are pretty low in the ship since they are below the lowest complete deck!',1,100,1);
I[30][3][1]=new Array('Half Decks','Sorry.  Half Decks are any partial decks between complete decks.  They can be above or below the lowest complete deck on a ship.',0,0,1);
I[30][3][2]=new Array('Poop Decks','Sorry.  Poop Decks are partial decks above the main deck at the stern.',0,0,1);
I[30][3][3]=new Array('Forecastle Decks','Nope.  Forecastle Decks are partial decks above the main deck at the bow.',0,0,1);
I[30][3][4]=new Array('Upper Decks','Nope.  Upper Decks are partial decks above the main deck amidships.',0,0,1);
I[31]=new Array();I[31][0]=100;
I[31][1]='';
I[31][2]='0';
I[31][3]=new Array();
I[31][3][0]=new Array('Weather Decks','Right.  It makes sense when you think of it.  These are the decks that are exposed to "weather".',1,100,1);
I[31][3][1]=new Array('Bulwarks','Sorry.  Bulwarks are a type of low, solid-steel, fence along the gunwale of the main deck.',0,0,1);
I[31][3][2]=new Array('Scuppers','Nope.  Scuppers are rubber or metal drains that allow water to run off the deck during rain or heavy seas.',0,0,1);
I[31][3][3]=new Array('Superstructure Decks','Sorry.  Superstructure Decks are any decks that lie above the main, poop or forecastle decks.',0,0,1);
I[31][3][4]=new Array('Signal Bridges','Nope.  While signal bridges are exposed to the elements, this is not the generic term used for all decks that are so exposed.',0,0,1);
I[32]=new Array();I[32][0]=100;
I[32][1]='';
I[32][2]='0';
I[32][3]=new Array();
I[32][3][0]=new Array('Scuppers','Correct!  This is a necessity to avoid the top deck retaining too much water and making the ship top-heavy.',1,100,1);
I[32][3][1]=new Array('Bulwarks','Sorry.  Bulwarks are a type of low, solid-steel, fence along the gunwale of the main deck.',0,0,1);
I[32][3][2]=new Array('Holds','Nope.  Holds are the cargo compartments of cargo ships and the main storage spaces of all ships.',0,0,1);
I[32][3][3]=new Array('Padeyes','Nope.  Padeyes are holes or indentations on the flight and hangar decks which allow aircraft to be chained down during maintenance and heavy weather.',0,0,1);
I[32][3][4]=new Array('Hawsepipe','Sorry.  A hawsepipe is a large pipe through which a cable passes from the deck to the ship\'s side.',0,0,1);
I[33]=new Array();I[33][0]=100;
I[33][1]='';
I[33][2]='0';
I[33][3]=new Array();
I[33][3][0]=new Array('Superstructure Decks','Right!  The first level above the main deck is the 01 level, pronounced "oh-one".  The second is the "oh-two" and so on.',1,100,1);
I[33][3][1]=new Array('Upper Decks','Sorry.  While upper decks are above the main deck, they may not be above the forecastle or poop decks.',0,0,1);
I[33][3][2]=new Array('Platform Decks','Sorry.  Platform decks are partial decks below the lowest complete deck.',0,0,1);
I[33][3][3]=new Array('Half Decks','Nope.  Half decks are any partial deck between complete decks.',0,0,1);
I[33][3][4]=new Array('Aloft Decks','Nope.  There is no such term as "aloft deck".',0,0,1);
I[34]=new Array();I[34][0]=100;
I[34][1]='';
I[34][2]='0';
I[34][3]=new Array();
I[34][3][0]=new Array('Superstructure Decks','Correct!  Superstructure decks are decks above the main, forecastle or poop decks and are generally referred to by "levels".',1,100,1);
I[34][3][1]=new Array('Main Decks','Sorry.  The decks given in the question would be located well above the main deck.',0,0,1);
I[34][3][2]=new Array('Forecastle Decks','Sorry.  The forecastle deck is a partial deck located towards the bow above the main deck.  The examples given would generally be located above the forecastle deck.',0,0,1);
I[34][3][3]=new Array('Poop Decks','Nope.  The term "poop deck" refers to a partial deck located towards the stern above the main deck.  The examples given would generally be located above the poop deck.',0,0,1);
I[34][3][4]=new Array('Upper Decks','Nope.  The term "upper deck" refers to a partial deck amidships above the main deck.  The examples given would generally be located above the upper deck.',0,0,1);
I[35]=new Array();I[35][0]=100;
I[35][1]='';
I[35][2]='0';
I[35][3]=new Array();
I[35][3][0]=new Array('A ship\'s ability to resist flooding.','Right!  To ensure that this happens, a series of watertight bulkheads are built in naval ships to divide the hull into a series of watertight compartments.',1,100,1);
I[35][3][1]=new Array('A ship\'s ability to move through the water.','Sorry.  This term has nothing to do with the movement of the ship through the water.',0,0,1);
I[35][3][2]=new Array('A ship\'s ability to drain off rain water and sea spray.','Sorry.  Bulwarks with scuppers provide this ability on all weather decks, but this is not a major part of the ship\'s overall watertight integrity.',0,0,1);
I[35][3][3]=new Array('The resistance of a ship\'s hull to weather.','Nope.  This may be a minor consideration when using this term, but it is not its primary meaning.',0,0,1);
I[35][3][4]=new Array('The amount of buoyancy a ship has in the water.','Nope.  While a greater watertight integrity will ensure that you float better, the term is not about the buoyancy of a ship.',0,0,1);
I[36]=new Array();I[36][0]=100;
I[36][1]='';
I[36][2]='0';
I[36][3]=new Array();
I[36][3][0]=new Array('To be down by the head or stern, generally due to flooding.','Correct.  This is a dangerous condition in heavy seas and significantly endangers the ship.',1,100,1);
I[36][3][1]=new Array('To lose the ability to use your rudder in heavy weather.','Sorry.  Although the word "trim" is often associated with rudders, that is not the case this time.',0,0,1);
I[36][3][2]=new Array('To have too little freeboard and therefore be subject to rolling.','Sorry.  The term has nothing to do with the amount of freeboard available.',0,0,1);
I[36][3][3]=new Array('To have too much freeboard and therefore be subject to listing.','Nope.  The term has nothing to do with the amount of freeboard available.',0,0,1);
I[36][3][4]=new Array('To have too much freeboard and therefore be subject to capsizing.','Nope.  The term has nothing to do with the amount of freeboard available.',0,0,1);
I[37]=new Array();I[37][0]=100;
I[37][1]='';
I[37][2]='0';
I[37][3]=new Array();
I[37][3][0]=new Array('To help trim the ship.','Right!  These tanks are either flooded or pumped dry to keep the ship on an even trim fore and aft.',1,100,1);
I[37][3][1]=new Array('As fuel storage areas.','Sorry.  While they could be used as fuel storage tanks, they generally are not.  There is a much more important purpose to these tanks than their use as storage compartments.',0,0,1);
I[37][3][2]=new Array('To re-route water to avoid flooding.','Sorry.  Flood waters are not routed into or out of these tanks.',0,0,1);
I[37][3][3]=new Array('To store provisions.','Nope.  Provisions are not stored here.  There is a much more important purpose to these tanks than their use as storage compartments.',0,0,1);
I[37][3][4]=new Array('To store drinking water','Nope.  While this could be done, it generally is not and certainly is not the reason that these tanks are built in to most ships.',0,0,1);
I[38]=new Array();I[38][0]=100;
I[38][1]='';
I[38][2]='0';
I[38][3]=new Array();
I[38][3][0]=new Array('Stuffing tube','Correct!  There has to be a way for such cables to go in between watertight compartments while maintaining the watertight integrity of the compartments.  Stuffing tubes help accomplish this.  They are always located high on the bulkhead to minimize the chance of water moving through them from one compartment to another.',1,100,1);
I[38][3][1]=new Array('Collision bulkhead','Nope.  Collision bulkheads are strong, watertight, bulkheads located on the after side of the forepeak tank.  It is designed to collapse in such a way to prevent flooding of compartments aft of it in the event of a head-on collision.',0,0,1);
I[38][3][2]=new Array('Sealing tube','Sorry.  Sounds right but there is no such thing as a "sealing tube".',0,0,1);
I[38][3][3]=new Array('Watertight bulkhead','Sorry.  Watertight bulkheads are simply walls which will not allow the passage of water form one side to the other.  When some type of cable or duct has to go through this bulkhead, the cylinder type in the question is used.',0,0,1);
I[38][3][4]=new Array('Jacob\'s pipe','Nope.  There is no such thing as a "Jacob\'s Pipe".  You may be thinking of a "Jacob\'s Ladder", a rope or metal ladder which allows someone to go up or over the side of a ship.',0,0,1);
I[39]=new Array();I[39][0]=100;
I[39][1]='';
I[39][2]='0';
I[39][3]=new Array();
I[39][3][0]=new Array('Aft of it','Right!  The mainmast is usually the taller, making it normally the highest structure above the main deck.',1,100,1);
I[39][3][1]=new Array('Forward of it','Sorry.  The foremast gets it\'s name because it is the most forward mast.',0,0,1);
I[39][3][2]=new Array('Alongside it','Sorry.  These two masts are never alongside each other.',0,0,1);
I[39][3][3]=new Array('It can be anywhere on the ship','Nope.  There is a specific relationship between the location of the foremast and the mainmast.',0,0,1);
I[39][3][4]=new Array('A ship with a foremast will not have a mainmast','Nope.  If there are two or more masts, there will be a foremast and a mainmast.',0,0,1);
I[40]=new Array();I[40][0]=100;
I[40][1]='';
I[40][2]='0';
I[40][3]=new Array();
I[40][3][0]=new Array('The truck','Correct.  The same terminology is used for the top of a flagpole.',1,100,1);
I[40][3][1]=new Array('The pig-stick','Nope.  The pig-stick is the slender vertical extension above the mast from which the ship\'s commission pennant is flown.',0,0,1);
I[40][3][2]=new Array('The jackstaff','Sorry.  The jackstaff is the small vertical pole at the bow at the forecastle of the ship.  At anchor, a Navy ship flies the jack (the blue portion of the American Flag) from 0800 hours until sunset.',0,0,1);
I[40][3][3]=new Array('The flagstaff','Sorry.  The flagstaff is the small vertical pole at the stern of the ship.  At anchor, a Navy ship flies the national ensign on the flagstaff from 0800 hours until sunset.',0,0,1);
I[40][3][4]=new Array('The stack','Nope.  The stack of a ship supplies air to the main propulsion engines and exhausts smoke and hot gasses from them.',0,0,1);
I[41]=new Array();I[41][0]=100;
I[41][1]='';
I[41][2]='0';
I[41][3]=new Array();
I[41][3][0]=new Array('From the gaff','Right.  This small pole extends abaft 9to the rear of) the mainmast.',1,100,1);
I[41][3][1]=new Array('From the jackstaff','Nope.  The jack (the blue portion of the American Flag) is flown from the jackstaff while anchored or moored from 0800 hours until sunset.',0,0,1);
I[41][3][2]=new Array('From the flagstaff','Sorry.  It is flown from the flagstaff while anchored or moored from 0800 hours until sunset, but not while at sea.',0,0,1);
I[41][3][3]=new Array('From the mainmast','Sorry.  You are close, but it actually flown from a small pole abaft of the mainmast.  What is the name of that small pole?',0,0,1);
I[41][3][4]=new Array('From the foremast','Nope.  This isn\'t where you would look to find the national ensign at sea.',0,0,1);
I[42]=new Array();I[42][0]=100;
I[42][1]='';
I[42][2]='0';
I[42][3]=new Array();
I[42][3][0]=new Array('Electric plants','Correct!  Although the Navy of the future is envisioned to have "all-electric" ships, it will be a few years yet before we see them in the "Fleet".',1,100,1);
I[42][3][1]=new Array('Nuclear power plants','Sorry.  The U.S. Navy has a number of nuclear-powered aircraft carriers and submarines.',0,0,1);
I[42][3][2]=new Array('Steam plants','Sorry.  Steam plants are the most common types of propulsion systems used by the Navy and by the world\'s merchant fleets.',0,0,1);
I[42][3][3]=new Array('Gas-turbine engines','Nope.  Gas-turbine engines are relatively new, but used on such ships as Arliegh-Burke Destroyers.',0,0,1);
I[42][3][4]=new Array('These are all types of propulsion systems currently used by Navy ships today.','Nope.  One of them has not been developed yet, but there are plans for it to be in the future.',0,0,1);
I[43]=new Array();I[43][0]=100;
I[43][1]='';
I[43][2]='0';
I[43][3]=new Array();
I[43][3][0]=new Array('Reduction Gears','Right!  These reduction gears step down the velocity of the shafts so that they can be used by the propellers to drive the ship through the ocean.',1,100,1);
I[43][3][1]=new Array('Boilers','Sorry.  Boilers are box-like casings containing hundreds of water-filled steel tubes arranged so that heat from furnace-like fireboxes beneath them turn the water into steam.',0,0,1);
I[43][3][2]=new Array('Gas Turbine Engines','Nope.  Gas-turbine engines are a form of power plant very similar to that of a jet aircraft\'s engine.  The blades of the turbine spin far to rapidly to be used by propellers, so the resultant velocity needs to be slowed.  What does this?',0,0,1);
I[43][3][3]=new Array('Compressors','Sorry.  A compressor is a stage of a gas-turbine engine that compresses air to make it more efficient during the combustion stage.',0,0,1);
I[43][3][4]=new Array('Condensers','Nope.  Condensers and evaporators are used to distill fresh water for boilers from salt water.',0,0,1);
I[44]=new Array();I[44][0]=100;
I[44][1]='';
I[44][2]='0';
I[44][3]=new Array();
I[44][3][0]=new Array('Reduction gears','Correct.  Reduction gears come after the energy is produced and the shaft is rotating.  This is not considered to be a stage of the gas-turbine engine.',1,100,1);
I[44][3][1]=new Array('Combustion chamber','Sorry.  This is where the work gets done!  Compressed air mixes with atomized fuel, is ignited by a spark and burned to produce energy.',0,0,1);
I[44][3][2]=new Array('Compressor','Sorry.  This is the first stage of a gas-turbine engine.  In this stage the air is drawn in and compressed to make a more efficient fuel-air mixture for the combustion stage.',0,0,1);
I[44][3][3]=new Array('Turbine','Nope.  You have to have a "turbine" to have a "gas-turbine" engine.',0,0,1);
I[44][3][4]=new Array('These are all parts of a modern gas-turbine engine','Nope.  There is one of these that is not considered to be a part of a gas-turbine engine.',0,0,1);
I[45]=new Array();I[45][0]=100;
I[45][1]='';
I[45][2]='0';
I[45][3]=new Array();
I[45][3][0]=new Array('Nuclear','Right!  This consists of the reactor, loops or piping, primary coolant pumps, and steam generators.',1,100,1);
I[45][3][1]=new Array('Steam','Nope.  While water does circulate through a traditional steam plant, this is hardly a modern power plant design.',0,0,1);
I[45][3][2]=new Array('Gas-Turbine','Sorry.  There isn\'t a circulating water cycle in a gas-turbine engine.',0,0,1);
I[45][3][3]=new Array('Electric','Sorry.  This new form of propulsion hasn\'t been put to sea yet by our Navy in the form of an operational combatant ship.',0,0,1);
I[45][3][4]=new Array('Coal','Nope.  The Navy no longer uses coal-fueled power plants.',0,0,1);
I[46]=new Array();I[46][0]=100;
I[46][1]='';
I[46][2]='0';
I[46][3]=new Array();
I[46][3][0]=new Array('These are all parts of the circulating water cycle of a nuclear power plant.','Correct.  The reactor heats the water, the coolant pumps circulate the water through the loops or piping to the steam generators, where the steam is produced to turn the shafts to power the propellers.',1,100,1);
I[46][3][1]=new Array('The reactor','Sorry.  You have to have a reactor to heat the water-filled pipes to produce the steam.',0,0,1);
I[46][3][2]=new Array('Loops or piping','Nope.   The water and steam need to travel through something to make the process work.  They travel through loops and piping to make this process happen.',0,0,1);
I[46][3][3]=new Array('Coolant pumps','Nope.  Coolant pumps circulate the steam and coolant water throughout the plant to heat the water into steam and provide coolant water to the nuclear power plant.',0,0,1);
I[46][3][4]=new Array('Steam generators','Sorry.  This is the final stage of the cycle, where steam is produced to turn the shafts and provide power to the propellers.',0,0,1);
I[47]=new Array();I[47][0]=100;
I[47][1]='';
I[47][2]='0';
I[47][3]=new Array();
I[47][3][0]=new Array('It is relatively inexpensive to build and install the equipment.','Right!  Nuclear power plants are by far the most expensive form of power generation, and so are only used on aircraft carriers and submarines at this time.',1,100,1);
I[47][3][1]=new Array('Nuclear propulsion plants do not require oxygen.','Nope.  Nuclear propulsion plants do not require oxygen to run, as do the other types of current power plants.  This makes them the best choice for submarine propulsion, where being under water limits the available oxygen.',0,0,1);
I[47][3][2]=new Array('Nuclear propulsion plants have fuel resources that last for decades','Sorry.  Because they use a nuclear material for fuel that takes decades to run low, these ships do not require underway replenishment of fuel for steaming.',0,0,1);
I[47][3][3]=new Array('Nuclear power plants do not require several hours of warm-up time like steam plants.','Nope.  The lag time to warm-up a conventional steam power plant is a significant disadvantage.  Nuclear power plants do not have this lag time requirement.',0,0,1);
I[47][3][4]=new Array('Nuclear-powered ships require less underway replenishment for fuel.','Sorry.  Because they use a nuclear material for fuel that takes decades to run low, these ships do not require underway replenishment of fuel for steaming.',0,0,1);
I[48]=new Array();I[48][0]=100;
I[48][1]='';
I[48][2]='0';
I[48][3]=new Array();
I[48][3][0]=new Array('It is less expensive.','Correct!  Gas-turbine engines are more modern and more expensive than traditional steam plants.  The initial difference in price is somewhat narrowed in the long run, however, due to the fact that gas-turbine plants are more efficient and easier to maintain and repair.',1,100,1);
I[48][3][1]=new Array('It is more compact','Nope.  Gas-turbines are more compact than conventional steam plants and so take up less space on a ship.',0,0,1);
I[48][3][2]=new Array('It is easier to maintain and repair','Sorry.  Because they are smaller and more modern, they are easier to maintain and repair when contrasted with a conventional steam plant.',0,0,1);
I[48][3][3]=new Array('It doesn\'t require a warm-up period','Sorry.  This is a significant advantage of gas-turbine engines.  Ships can be ready to sail on very short notice instead of having to wait hours for a conventional steam plant to warm-up.',0,0,1);
I[48][3][4]=new Array('It is lighter','Nope.  Conventional steam pants are big things while gas-turbine engines are more like conventional jet engines.',0,0,1);
I[49]=new Array();I[49][0]=100;
I[49][1]='';
I[49][2]='0';
I[49][3]=new Array();
I[49][3][0]=new Array('Erecting the keel sections','Right!  The keel forms the backbone and framework for the rest of the ship, so this step has to come first.',1,100,1);
I[49][3][1]=new Array('Building the bow section','Sorry.  While the bow and stern sections are oftentimes completed independantly from the main ship structure and added at a later date, they are not the first things done when construction the ship.',0,0,1);
I[49][3][2]=new Array('Building the stern section','Sorry.  While the bow and stern sections are oftentimes completed independantly from the main ship structure and added at a later date, they are not the first things done when construction the ship.',0,0,1);
I[49][3][3]=new Array('Welding the longitudinal and transverse beams','Nope.  These beams are important, but they have to have something to be welded on to.  That has to be done first.',0,0,1);
I[49][3][4]=new Array('Framing the hull','Nope.  The hull needs to be attached to something, and that something has to be done first!',0,0,1);
I[50]=new Array();I[50][0]=100;
I[50][1]='';
I[50][2]='0';
I[50][3]=new Array();
I[50][3][0]=new Array('Dry-dock launch','Right.  This is a preferred method for larger ships.',1,100,1);
I[50][3][1]=new Array('Side launch','Sorry.  In the side-launch procedure, the ship is slid on it\'s side down a ramp and not floated out.',0,0,1);
I[50][3][2]=new Array('Float-off launch','Sorry.  While the ship floats out in this method, the dock itself is lowered (sunk) in deep water rather than having the interior of the dock flooded.',0,0,1);
I[50][3][3]=new Array('None of the answers listed are correct','Nope.  One of them is correct.  ',0,0,1);
I[50][3][4]=new Array('The ship is always floated out, the only difference is the method used to float it','Nope.  In one of the methods shown, the ship is slid down a ramp instead of floating off.',0,0,1);
I[51]=new Array();I[51][0]=100;
I[51][1]='';
I[51][2]='0';
I[51][3]=new Array();
I[51][3][0]=new Array('The Secretary of the Navy','Right!  The Secretary of the Navy will seek out and get advice from all of the other people/institutions listed here, as well as several others, but it is up to him or her to make the final selection.',1,100,1);
I[51][3][1]=new Array('The Chief of Naval Operations','Sorry.  The CNO makes recommendations as to the name, but he or she does not select it.',0,0,1);
I[51][3][2]=new Array('The Congress','Nope.  Congress can had a lot of influence in the choice of the name, but it is not a duty of Congress to choose the name.',0,0,1);
I[51][3][3]=new Array('The President','Nope.  While a President\'s desires would certainly carry weight, it is not the President that picks the name.',0,0,1);
I[51][3][4]=new Array('A vote is taken among active-duty Navy members','Sorry.  This is an interesting idea, but not one that happens.',0,0,1);
I[52]=new Array();I[52][0]=100;
I[52][1]='';
I[52][2]='0';
I[52][3]=new Array();
I[52][3][0]=new Array('"Bring the ship to life and set the watch!"','Correct!   This is an old Navy tradition.  The ship is brought to life as the crew moves aboard and sets the watches.  The watches will be continuously maintained until the ship is finally decommissioned.',1,100,1);
I[52][3][1]=new Array('"General Quarters, General Quarters, all hands man your stations!"','Sorry.  The call of General Quarters will certainly get people moving but this command is reserved for combat or other dangerous situations, or for the training for those situations.',0,0,1);
I[52][3][2]=new Array('"Now set the watch.  Relieve the wheel and the lookout!"','Sorry.  This is a common order given every day on board ship to announce when it is time to change the watch and relieve those who have been on watch.',0,0,1);
I[52][3][3]=new Array('"All hands on deck!"','Nope.  This isn\'t it.  This order dates from the days of sail when all hands would be called to the deck to repel boarders.',0,0,1);
I[52][3][4]=new Array('"Now make ready all stations and watches!"','Nope.  This isn\'t it, but it does address one of the most important parts of the first order, to set the watches.',0,0,1);
I[53]=new Array();I[53][0]=100;
I[53][1]='';
I[53][2]='0';
I[53][3]=new Array();
I[53][3][0]=new Array('After the christening and commissioning ceremonies','Right.  After these ceremonies, and when the ship has been fully outfitted and manned, the ship undergoes a shakedown cruise as a test run to ensure that she meets her design specifications and that everything works well.',1,100,1);
I[53][3][1]=new Array('After the christening but before the commissioning ceremonies','Sorry.  While the ship may be outfitted prior to the commissioning ceremony, it hasn\'t been "manned".  That is what the commissioning ceremony is all about.',0,0,1);
I[53][3][2]=new Array('Before the christening and commissioning ceremonies','Sorry.  Before you can take the ship to sea for the first time, it needs to be fully outfitted and ready to go.  Outfitting occurs after the christening ceremony.',0,0,1);
I[53][3][3]=new Array('After the commissioning but before the christening ceremonies','Nope.  Remember, the christening ceremony comes first, then the commissioning ceremony.  ',0,0,1);
I[53][3][4]=new Array('There is no set time to do the shakedown cruise,  It can come at any time before or after the christening and commissioning ceremonies.','Nope.  Before you can take the ship to sea for the first time, it needs to be fully outfitted and ready to go.',0,0,1);
I[54]=new Array();I[54][0]=100;
I[54][1]='';
I[54][2]='0';
I[54][3]=new Array();
I[54][3][0]=new Array('Amphibious ','Correct.  Amphibious warfare ships, such as LSTs, LKAs and LSDs all start with "L".',1,100,1);
I[54][3][1]=new Array('Logistics','Sorry.  There is no such designator as "logistics".',0,0,1);
I[54][3][2]=new Array('Military Sealift','Sorry.  Military Sealift ships have an "M" designator.',0,0,1);
I[54][3][3]=new Array('Auxiliary','Nope.  Auxiliary craft have a "A" designator.',0,0,1);
I[54][3][4]=new Array('Patrol','Nope.  Patrol craft have a "P" designator.',0,0,1);
I[55]=new Array();I[55][0]=100;
I[55][1]='';
I[55][2]='0';
I[55][3]=new Array();
I[55][3][0]=new Array('That the ship can fire guided missiles.','Right!  While this doesn\'t seem like a big deal nowadays, since every combatant can fire guided missiles, it is a legacy from the days when this wasn\'t the case.',1,100,1);
I[55][3][1]=new Array('That the ship is a part of a destroyer group.','Nope.  Navy ships change from one operational group to another all of the time.  Such a system would require a lot of painting and repainting of designators!',0,0,1);
I[55][3][2]=new Array('That the ship is the seventh ship of the series (A, B,C, D, E, F, G).','Sorry.  Ships use hull numbers to note the number within a series, not letters.',0,0,1);
I[55][3][3]=new Array('That the ship has been fitted with GPS navigational systems.','Nope.  All U.S. Navy ships have GPS capability, so adding a designation for this wouldn\'t make sense.',0,0,1);
I[55][3][4]=new Array('That the ship is powered by a Gas-turbine engine.','Sorry.  While the letter "N" is associated with nuclear ships, this is not the case for gas-turbine equipped ships.',0,0,1);
I[56]=new Array();I[56][0]=100;
I[56][1]='';
I[56][2]='0';
I[56][3]=new Array();
I[56][3][0]=new Array('That the ship belongs to the Military Sealift Command','Correct!  In recent years many Navy ships have been taken over by the Military Sealift Command and crewed by contract civilians.  When this happens the letter "T" is added to the front of that ship\'s designator to note this fact.',1,100,1);
I[56][3][1]=new Array('That the ship is able to fire the Tomahawk land attack missile','Sorry.  The "T" does not refer to the ability of a ship to fire this missile.',0,0,1);
I[56][3][2]=new Array('That the ship is a Tactical version of this model and type','Sorry.  Tactical and non-tactical are not official designators.',0,0,1);
I[56][3][3]=new Array('That this ship is a Tactical Assault Ship','Nope.  There is no specific designator for a tactical assault ship.',0,0,1);
I[56][3][4]=new Array('That this is an Amphibious Warfare Ship','Nope.  The designator for an amphibious ship is "L".',0,0,1);
I[57]=new Array();I[57][0]=100;
I[57][1]='';
I[57][2]='0';
I[57][3]=new Array();
I[57][3][0]=new Array('The CVN is nuclear powered.','Right!  The "N" stands for "nuclear".',1,100,1);
I[57][3][1]=new Array('The CVN is a newer version of an aircraft carrier.','Sorry.  The age of the ship is not reflected in the letters of the designation, but in the number.',0,0,1);
I[57][3][2]=new Array('Aircraft carriers after World War II were designated as CVNs.  Before WWII they were CVs.','Sorry.  While it\'s true that there were no CVNs prior to or during World War II, this isn\'t the reason behind the different designators.',0,0,1);
I[57][3][3]=new Array('CVNs are Navy ships, CVs are not.','Nope.  Both types are Navy ships.',0,0,1);
I[57][3][4]=new Array('CVNs belong to the United Nations, CVs belong to the United States.','Nope.  The "N" has nothing to do with ownership.',0,0,1);


function StartUp(){
	RemoveBottomNavBarForIE();

//If there's only one question, no need for question navigation controls
	if (QsToShow < 2){
		document.getElementById('QNav').style.display = 'none';
	}
	
//Stash the instructions so they can be redisplayed
	strInstructions = document.getElementById('InstructionsDiv').innerHTML;
	

	

	
	CompleteEmptyFeedback();

	SetUpQuestions();
	ClearTextBoxes();
	CreateStatusArray();
	

	
//Check search string for q parameter
	if (document.location.search.length > 0){
		if (ShuffleQs == false){
			var JumpTo = parseInt(document.location.search.substring(1,document.location.search.length))-1;
			if (JumpTo <= QsToShow){
				ChangeQ(JumpTo);
			}
		}
	}
}

function ShowHideQuestions(){
	FuncBtnOut(document.getElementById('ShowMethodButton'));
	document.getElementById('ShowMethodButton').style.display = 'none';
	if (ShowingAllQuestions == false){
		for (var i=0; i<QArray.length; i++){
				QArray[i].style.display = '';
			}
		document.getElementById('Questions').style.listStyleType = 'decimal';
		document.getElementById('OneByOneReadout').style.display = 'none';
		document.getElementById('ShowMethodButton').innerHTML = ShowOneByOneCaption;
		ShowingAllQuestions = true;
	}
	else{
		for (var i=0; i<QArray.length; i++){
				if (i != CurrQNum){
					QArray[i].style.display = 'none';
				}
			}
		document.getElementById('Questions').style.listStyleType = 'none';
		document.getElementById('OneByOneReadout').style.display = '';
		document.getElementById('ShowMethodButton').innerHTML = ShowAllQuestionsCaption;
		ShowingAllQuestions = false;	
	}
	document.getElementById('ShowMethodButton').style.display = 'inline';
}

function CreateStatusArray(){
	var QNum, ANum;
//For each item in the item array
	for (QNum=0; QNum<I.length; QNum++){
//Check if the question still exists (hasn't been nuked by showing a random selection)
		if (document.getElementById('Q_' + QNum) != null){
			State[QNum] = new Array();
			State[QNum][0] = -1; //Score for this q; -1 shows question not done yet
			State[QNum][1] = new Array(); //answers
			for (ANum = 0; ANum<I[QNum][3].length; ANum++){
				State[QNum][1][ANum] = 0; //answer not chosen yet; when chosen, will store its position in the series of choices
			}
			State[QNum][2] = 0; //tries at this q so far
			State[QNum][3] = 0; //incrementing percent-correct values of selected answers
			State[QNum][4] = 0; //penalties incurred for hints
			State[QNum][5] = ''; //Sequence of answers chosen by number
		}
		else{
			State[QNum] = null;
		}
	}
}



function CheckMCAnswer(QNum, ANum, Btn){
//if question doesn't exist, bail
	if (State[QNum].length < 1){return;}
	
//Get the feedback
	Feedback = I[QNum][3][ANum][1];
	
//Now show feedback and bail if question already complete
	if (State[QNum][0] > -1){
//Add an extra message explaining that the question
// is finished if defined by the user
		if (strQuestionFinished.length > 0){Feedback += '<br />' + strQuestionFinished;}
//Show the feedback
		ShowMessage(Feedback);
		return;
	}
	
//Hide the button while processing
	Btn.style.display = 'none';

//Increment the number of tries
	State[QNum][2]++;
	
//Add the percent-correct value of this answer
	State[QNum][3] += I[QNum][3][ANum][3];
	
//Store the try number in the answer part of the State array, for tracking purposes
	State[QNum][1][ANum] = State[QNum][2];
	State[QNum][5] += String.fromCharCode(65+ANum) + ',';
	
//Should this answer be accepted as correct?
	if (I[QNum][3][ANum][2] < 1){
//It's wrong

//Mark the answer
		Btn.innerHTML = IncorrectIndicator;
		
//Remove any previous score unless exercise is finished (6.0.3.8+)
		if (Finished == false){
			WriteToInstructions(strInstructions);
		}	
		
//Check whether this leaves just one MC answer unselected, in which case the Q is terminated
		var RemainingAnswer = FinalAnswer(QNum);
		if (RemainingAnswer > -1){
//Behave as if the last answer had been selected, but give no credit for it
//Increment the number of tries
			State[QNum][2]++;		
		
//Calculate the score for this question
			CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	else{
//It's right
//Mark the answer
		Btn.innerHTML = CorrectIndicator;
				
//Calculate the score for this question
		CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
		if (ContinuousScoring == true){
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	
//Show the button again
	Btn.style.display = 'inline';
	
//Finally, show the feedback	
	ShowMessage(Feedback);
	
//Check whether all questions are now done
	CheckFinished();
}

function CalculateMCQuestionScore(QNum){
	var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties
	var PercentCorrect = State[QNum][3];
	var TotAns = GetTotalMCAnswers(QNum);
	var HintPenalties = State[QNum][4];
	
//Make sure it's not already complete

	if (State[QNum][0] < 0){
//Allow for Hybrids
		if (HintPenalties >= 1){
			State[QNum][0] = 0;
		}
		else{
//This line calculates the score for this question
			if (TotAns == 1){
				State[QNum][0] = 1;
			}
			else{
				State[QNum][0] = ((TotAns-((Tries*100)/State[QNum][3]))/(TotAns-1));
			}
		}
		if (State[QNum][0] < 0){
			State[QNum][0] = 0;
		}
	}
}

function GetTotalMCAnswers(QNum){
	var Result = 0;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			Result++;
		}
	}
	return Result;
}

function FinalAnswer(QNum){
	var UnchosenAnswers = 0;
	var FinalAnswer = -1;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			if (State[QNum][1][ANum] < 1){ //This answer hasn't been chosen yet
				UnchosenAnswers++;
				FinalAnswer = ANum;
			}
		}
	}
	if (UnchosenAnswers == 1){
		return FinalAnswer;
	}
	else{
		return -1;
	}
}





function CalculateOverallScore(){
	var TotalWeighting = 0;
	var TotalScore = 0;
	
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] > -1){
				TotalWeighting += I[QNum][0];
				TotalScore += (I[QNum][0] * State[QNum][0]);
			}
		}
	}
	if (TotalWeighting > 0){
		Score = Math.floor((TotalScore/TotalWeighting)*100);
	}
	else{
//if TotalWeighting is 0, no questions so far have any value, so 
//no penalty should be shown.
		Score = 100; 
	}
}

function CheckFinished(){
	var FB = '';
	var AllDone = true;
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] < 0){
				AllDone = false;
			}
		}
	}
	if (AllDone == true){
	
//Report final score and submit if necessary
		CalculateOverallScore();
		FB = YourScoreIs + ' ' + Score + '%.';
		if (ShowCorrectFirstTime == true){
			var CFT = 0;
			for (QNum=0; QNum<State.length; QNum++){
				if (State[QNum] != null){
					if (State[QNum][0] >= 1){
						CFT++;
					}
				}
			}
			FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + QsToShow;
		}
		WriteToInstructions(FB);
		
		Finished == true;

		TimeOver = true;
		Locked = true;
		


		Finished = true;
		Detail = '<?xml version="1.0"?><hpnetresult><fields>';
		for (QNum=0; QNum<State.length; QNum++){
			if (State[QNum] != null){
				if (State[QNum][5].length > 0){
					Detail += '<field><fieldname>Question #' + (QNum+1) + '</fieldname><fieldtype>question-tracking</fieldtype><fieldlabel>Q ' + (QNum+1) + '</fieldlabel><fieldlabelid>QuestionTrackingField</fieldlabelid><fielddata>' + State[QNum][5] + '</fielddata></field>';
				}
			}
		}
		Detail += '</fields></hpnetresult>';
		setTimeout('Finish()', SubmissionTimeout);
	}
}










//-->

//]]>


