

//<![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';

	FDiv.style.display = 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');
	ShowElements(false, 'object');
	ShowElements(true, 'object', 'FeedbackContent');

//Focus the OK button
	setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
	
//
}

function ShowElements(Show, TagName, ContainerToReverse){
// added third argument to allow objects in the feedback box to appear
//IE bug -- hide all the form elements that will show through the popup
//FF on Mac bug : doesn't redisplay objects whose visibility is set to visible
//unless the object's display property is changed

	//get container object (by Id passed in, or use document otherwise)
	TopNode = document.getElementById(ContainerToReverse);
	var Els;
	if (TopNode != null) {
		Els = TopNode.getElementsByTagName(TagName);
	} else {
		Els = document.getElementsByTagName(TagName);
	}

	for (var i=0; i<Els.length; i++){
		if (TagName == "object") {
			//manipulate object elements in all browsers
			if (Show == true){
				Els[i].style.visibility = 'visible';
				//get Mac FireFox to manipulate display, to force screen redraw
				if (C.mac && C.gecko) {Els[i].style.display = '';}
			}
			else{
				Els[i].style.visibility = 'hidden';
				if (C.mac && C.gecko) {Els[i].style.display = 'none';}
			}
		} 
		else {
			// tagName is either input or select (that is, Form Elements)
			// ie6 has a problem with Form elements, so manipulate those
			if (C.ie) {
				if (C.ieVer < 7) {
					if (Show == true){
						Els[i].style.visibility = 'visible';
					}
					else{
						Els[i].style.visibility = 'hidden';
					}
				}
			}
		}
	}
}



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 (typeof(window.pageYOffset) == 'number'){
		return window.pageYOffset;
	}
	else{
		if ((document.body)&&(document.body.scrollTop)){
			return document.body.scrollTop;
		}
		else{
			if ((document.documentElement)&&(document.documentElement.scrollTop)){
				return document.documentElement.scrollTop;
			}
			else{
				return 0;
			}
		}
	}
}

function GetViewportHeight(){
	if (typeof window.innerHeight != 'undefined'){
		return window.innerHeight;
	}
	else{
		if (((typeof document.documentElement != 'undefined')&&(typeof document.documentElement.clientHeight !=
     'undefined'))&&(document.documentElement.clientHeight != 0)){
			return document.documentElement.clientHeight;
		}
		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{
	if (window.addEventListener){
		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){
	var Num;
	var 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-1); 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 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 ';

//New for 6.2.2.0
var CompletedSoFar = 'Questions completed so far: ';
var ExerciseCompleted = 'You have completed the exercise.';
var ShowCompletedSoFar = true;

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 = '';
var Locked = false;

//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;
	if (QsToShow > QList.length){
		QsToShow = QList.length;
	}
	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();
	
	SetFocusToTextbox();
}

function SetFocusToTextbox(){
//if there's a textbox, set the focus in it
	if (QArray[CurrQNum].getElementsByTagName('input')[0] != null){
		QArray[CurrQNum].getElementsByTagName('input')[0].focus();
//and show a keypad if there is one
		if (document.getElementById('CharacterKeypad') != null){
			document.getElementById('CharacterKeypad').style.display = 'block';
		}
	}
	else{
  	if (QArray[CurrQNum].getElementsByTagName('textarea')[0] != null){
  		QArray[CurrQNum].getElementsByTagName('textarea')[0].focus();	
//and show a keypad if there is one
			if (document.getElementById('CharacterKeypad') != null){
				document.getElementById('CharacterKeypad').style.display = 'block';
			}
		}
//This added for 6.0.4.11: hide accented character buttons if no textbox
		else{
			if (document.getElementById('CharacterKeypad') != null){
				document.getElementById('CharacterKeypad').style.display = 'none';
			}
		}
	}
}

function ChangeQ(ChangeBy){
//The following line prevents moving to another question until the current
//question is answered correctly. Uncomment it to enable this behaviour. 
//	if (State[CurrQNum][0] == -1){return;}
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
	QArray[CurrQNum].style.display = 'none';
	CurrQNum += ChangeBy;
	QArray[CurrQNum].style.display = '';
//Undocumented function added 10/12/2004
	ShowSpecialReadingForQuestion();
	SetQNumReadout();
	SetFocusToTextbox();
}

var HiddenReadingShown = false;
function ShowSpecialReadingForQuestion(){
//Undocumented function for showing specific reading text elements which change with each question
//Added on 10/12/2004
	if (document.getElementById('ReadingDiv') != null){
		if (HiddenReadingShown == true){
			document.getElementById('ReadingDiv').innerHTML = '';
		}
		if (QArray[CurrQNum] != null){
//Fix for 6.0.4.25
			var Children = QArray[CurrQNum].getElementsByTagName('div');
			for (var i=0; i<Children.length; i++){
			if (Children[i].className=="HiddenReading"){
					document.getElementById('ReadingDiv').innerHTML = Children[i].innerHTML;
					HiddenReadingShown = true;
//Hide the ShowAllQuestions button to avoid confusion
					if (document.getElementById('ShowMethodButton') != null){
						document.getElementById('ShowMethodButton').style.display = 'none';
					}
				}
			}	
		}
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
	if ((CurrQNum+1) >= QArray.length){
		if (document.getElementById('NextQButton') != null){
			document.getElementById('NextQButton').style.visibility = 'hidden';
		}
	}
	else{
		if (document.getElementById('NextQButton') != null){
			document.getElementById('NextQButton').style.visibility = 'visible';
		}
	}
	if (CurrQNum <= 0){
		if (document.getElementById('PrevQButton') != null){
			document.getElementById('PrevQButton').style.visibility = 'hidden';
		}
	}
	else{
		if (document.getElementById('PrevQButton') != null){
			document.getElementById('PrevQButton').style.visibility = 'visible';
		}
	}
}

var 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('The Dutch East Indies','Right.  Many of the oil fields common in the Pacific today had not been developed at that time.',1,100,1);
I[0][3][1]=new Array('Saudi Arabia','Nope.  This modern-day source of oil had not been developed by this time.',0,0,1);
I[0][3][2]=new Array('China','Nope.  There weren\'t significant oil reserves in China.',0,0,1);
I[0][3][3]=new Array('Australia','Nope.  There weren\'t significant oil reserves in Australia.',0,0,1);
I[0][3][4]=new Array('Hawaii','Nope.  There weren\'t significant oil reserves in Hawaii other than those stored for the U.S. Fleet.',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('Oil depots, repair yards and the U.S. aircraft carriers.','Right.  These assets proved invaluable in maintaining the U.S. fleet over the next few, critical months.',1,100,1);
I[1][3][1]=new Array('U.S. aircraft on the ground.','Nope.  Over 250 U.S. aircraft were destroyed on the ground.',0,0,1);
I[1][3][2]=new Array('The row of U.S. Battleships.','Nope.  This was the prime target and every U.S. Battleship was sunk or damaged in the attack.',0,0,1);
I[1][3][3]=new Array('The USS Arizona and the USS Nevada.','Nope.  Both of these ships were hit in the attack.',0,0,1);
I[1][3][4]=new Array('The USS Oklahoma and USS California.','Nope.  Both of these ships were hit in the attack.',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('To hold the line against any further Japanese advance.','Right.  At this point in the war, holding the line was the best the U.S. could hope to do.',1,100,1);
I[2][3][1]=new Array('To find and defeat the Japanese Navy at sea.','Nope.  After the loss of <span lang="en-us"></span>our battleships at Pearl Harbor, this would have been an impossible task.',0,0,1);
I[2][3][2]=new Array('To conduct air strikes against mainland Japan.','Nope.  The U.S. fleet wasn\'t strong enough to carry this out.',0,0,1);
I[2][3][3]=new Array('To conduct amphibious landings against the home islands of Japan.','Nope.  The U.S. fleet wasn\'t strong enough to carry this out.',0,0,1);
I[2][3][4]=new Array('To lure the Japanese into a trap near Midway Island.','Nope.  The battle of Midway was still a long ways off at this point.',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('War Plan Orange','Right.  This plan had been studied and refined since the end of World War I.',1,100,1);
I[3][3][1]=new Array('Tora, Tora, Tora','Nope.  This was the radio call made by the Japanese at the start of the  attack on Pearl Harbor.',0,0,1);
I[3][3][2]=new Array('Operation Torch','Nope.  This was the code name of the North African landings.',0,0,1);
I[3][3][3]=new Array('Operation Anvil','Nope.  This was the code name for the landings in southern France.',0,0,1);
I[3][3][4]=new Array('Operation Anvil','Nope.  This was the code name for the landings in Italy.',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('The battle of the Java Sea.','Right.  The ABDA force could do little more than harass the Japanese as they moved through the Pacific.',1,100,1);
I[4][3][1]=new Array('The battle of Midway','Sorry.  The U.S. victory at Midway was still some time off.',0,0,1);
I[4][3][2]=new Array('The battle of the Coral Sea','Sorry.  The battle of the Coral Sea was still some time off.',0,0,1);
I[4][3][3]=new Array('The battle of Savo Island','Nope.  The Japanese victory at Savo Island was still some time off.',0,0,1);
I[4][3][4]=new Array('The battle of Rabaul','Nope.  This battle never happened.',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('Truk','Right.  They had years before the war to build up the facilities and defenses of this island.',1,100,1);
I[5][3][1]=new Array('Rabaul','Sorry.  though built up as a major forward base, Rabaul did not have the reputation of being Japan\'s Pearl harbor.',0,0,1);
I[5][3][2]=new Array('Kavieng','Nope.  While a major base, Kavieng was not the primary base.',0,0,1);
I[5][3][3]=new Array('Guam','Nope.  Guam was never developed extensively as a Japanese Naval Base.',0,0,1);
I[5][3][4]=new Array('Midway','Nope.  Japan never gained control of Midway Island.',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('Midway Island','Correct.  The Japanese Imperial Staff chose to ignore this threat early in the war.',1,100,1);
I[6][3][1]=new Array('Guam','Nope.  Japan occupied Guam early on and closed this gap.',0,0,1);
I[6][3][2]=new Array('Okinawa','Nope.  Okinawa was considered one of the Japanese main islands and had always been  occupied by the Japanese.',0,0,1);
I[6][3][3]=new Array('Wake Island','Nope.  Wake Island was taken by the Japanese early in the conflict.',0,0,1);
I[6][3][4]=new Array('The Kurile Islands','Nope.  The Kurile Islands had been in Japanese hands ever sine their war with Russia early in the century.',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('The Doolittle Raid','Correct.  Named after its lead pilot, Col. Jimmy Doolittle.',1,100,1);
I[7][3][1]=new Array('The Tokyo Express','Nope.  This was the name given to the Japanese resupply convoy bringing supplies to its troops on Guadalcanal.',0,0,1);
I[7][3][2]=new Array('The Tokyo Express','Nope.  It was to Tokyo, but that wasn\'t the name.',0,0,1);
I[7][3][3]=new Array('The Hornet Raid','Sorry.  The strike came from off of the USS Hornet, but it wasn\'t called the hornet Raid.',0,0,1);
I[7][3][4]=new Array('The Halsey Raid','Nope.  Admiral Halsey was in overall command of the operation, but this was not its name.',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('The U.S. had broken the Japanese cipher codes.','Correct.  Although not 100 percent perfect, the general intentions of the Japanese Navy were known in advance.',1,100,1);
I[8][3][1]=new Array('The U.S. had a spy in the higher circles of Japanese Naval planning.','Nope.  No such spy existed.',0,0,1);
I[8][3][2]=new Array('The U.S. had discovered the plan while interrogating Japanese survivors of the battle of the Coral Sea.','Nope.  No such information was given by POWs.',0,0,1);
I[8][3][3]=new Array('The U.S. had recovered Top Secret Japanese documents which told of the attack plan.','Nope.  No such papers were found.',0,0,1);
I[8][3][4]=new Array('A high-ranking Japanese defector gave the battle plans to the Americans.','Nope.  There was no Japanese defector.',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('Because of the Japanese loss of 4 Carriers and many of its combat-experienced pilots.','Right.  The replacement pilots couldn\'t match the U.S. pilot\'s experience and numbers.',1,100,1);
I[9][3][1]=new Array('Because the loss of Midway to the Japanese closed the last remaining gap in the Japanese line.','Nope.  The Japanese lost the battle of Midway and the gap remained.',0,0,1);
I[9][3][2]=new Array('Because battleships would once again rule the seas.','Nope.  Aircraft carriers had proven themselves to be the centerpiece of the fleet.',0,0,1);
I[9][3][3]=new Array('Because the Japanese never again could put a major Fleet to sea.','Nope.  The Japanese Fleet still outnumbered the Americans after the battle of Midway.',0,0,1);
I[9][3][4]=new Array('Because from this point on the Japanese would never score a victory over U.S. forces.','Nope.  the Japanese had a number of victories after Midway.',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('Guadalcanal','Right.  The U.S. forces victory on Guadalcanal greatly reduced the Japanese threat to Australia.',1,100,1);
I[10][3][1]=new Array('Truk','Nope.  Truk is not in the Solomon Island chain.',0,0,1);
I[10][3][2]=new Array('Iwo Jima','Nope.  Iwo Jima is not in the Solomon Island chain.',0,0,1);
I[10][3][3]=new Array('Guam','Nope.  Guam is not in the Solomon Island chain.',0,0,1);
I[10][3][4]=new Array('Midway','Nope.  A land battle was never fought on Midway Island, and it is not in the Solomon Island chain.',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('The Tokyo Express','Correct.  Many types of ships would be used to slip in and resupply the Japanese forces on Guadalcanal.',1,100,1);
I[11][3][1]=new Array('The Hirohito Express','Nope.  This was not the name.',0,0,1);
I[11][3][2]=new Array('Divine Wind','Nope.  This was not the name.',0,0,1);
I[11][3][3]=new Array('The Slot Convoy','Sorry.  This was not the name.',0,0,1);
I[11][3][4]=new Array('The Ironbottom Sound 500','Nope.  This was not the name.',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('The Aleutian Islands','Correct.  They were never again threatened during  the war.',1,100,1);
I[12][3][1]=new Array('The Marshall Islands','Nope.  These were not American home islands.',0,0,1);
I[12][3][2]=new Array('The Gilbert Islands','Nope.  These were not American home islands.',0,0,1);
I[12][3][3]=new Array('The Hawaiian Islands','Nope.  The Hawaiian islands were never occupied by Japan.',0,0,1);
I[12][3][4]=new Array('The Caroline Islands','Nope.  These were not American home islands.',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('The Japanese were slow to develop antisubmarine tactics.','Correct.  Unlike the Allied forces in the Atlantic, the Japanese were never able to effective counter the U.s. Submarine threat.',1,100,1);
I[13][3][1]=new Array('There wasn\'t much merchant shipping to go after in the Pacific.','Nope.  If anything, there was more.',0,0,1);
I[13][3][2]=new Array('Neither side made use of submarines in the Pacific.','Nope.  Both sides used submarines, but the U.S. did so much more effectively.',0,0,1);
I[13][3][3]=new Array('The wolf-pack tactic was never used in the Pacific.','Nope.  While true, it wasn\'t a fundamental difference because it wasn\'t needed like it was in the Atlantic.',0,0,1);
I[13][3][4]=new Array('Submarines had to dive deeper in the Pacific since it is a deeper ocean.','Sorry.  This isn\'t the case at all.',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('Saipan','Correct.  127,000 troops took part in this operation from 535 ships some 3,000 miles from Pearl Harbor.',1,100,1);
I[14][3][1]=new Array('Guadalcanal','Nope.  while a major battle in World War II, this happened much earlier.',0,0,1);
I[14][3][2]=new Array('Truk','Nope.  The battle for Truk, while important, was not the major event in the question.',0,0,1);
I[14][3][3]=new Array('Rabaul','Nope.  U.S. forces bypassed Rabaul, never landing forces there.',0,0,1);
I[14][3][4]=new Array('Iwo Jima','Nope.  Iwo Jim would come later in the war.',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('The Marianas Islands invasion was able to continue unopposed.','Correct.  The loss of Japans Mobile Fleet meant there would be no naval resistance to the landings.',1,100,1);
I[15][3][1]=new Array('The Japanese never again opposed the U.S. Navy on the seas.','Nope.  the Japanese Navy continued operations against the U.S. Navy until the end of the war.',0,0,1);
I[15][3][2]=new Array('The Japanese lost their last aircraft carriers.','Nope.  they still had aircraft carriers, but not many trained pilots.',0,0,1);
I[15][3][3]=new Array('The U.S. bought time to consolidate its defensive position.','Nope.  The U.S. was on the offensive at this point, not the defensive.',0,0,1);
I[15][3][4]=new Array('It meant that the Japanese troops on Saipan would surrender without a fight.','Nope.  Saipan had to be taken after a long and hard-fought campaign.',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('Defense in depth, away from the beaches.','Right.  The Japanese knew by this point that beach defenses would be taken out by naval gunfire and  air strikes.',1,100,1);
I[16][3][1]=new Array('To mass all available defenders on the beaches to oppose the initial landings.','Nope.  Quite the opposite, beach defense had proven to be the wrong way to go.',0,0,1);
I[16][3][2]=new Array('To sneak off the island at night and do a counterlanding against the Americans.','Nope.  No such strategy was ever tried.',0,0,1);
I[16][3][3]=new Array('To counterattack the main landing with an Banzai charge.','Nope.  This tactic was stopped early in the war.',0,0,1);
I[16][3][4]=new Array('To fight to the last man, never giving an inch.','Sorry.  This had been a general Japanese tactic throughout the war.',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('To stop Japanese fighters based there and to have an emergency base for crippled U.S. bombers returning from Japan.','Right.  Although a very costly battle for the U.S., more U.S. lives were saved in the long run form having taken this island.',1,100,1);
I[17][3][1]=new Array('To put the last major Japanese naval base out of action.','Nope.  Iwo Jima was not a Japanese naval base.',0,0,1);
I[17][3][2]=new Array('To prevent a Japanese sneak attack out of this island.','Nope.  Iwo Jima was isolated after the defeat of the Japanese Navy.',0,0,1);
I[17][3][3]=new Array('To prevent long-range Japanese bombers from hitting U.S. forces in Okinawa.','Nope.  Japan did not base any long-range bombers at Iwo Jima.',0,0,1);
I[17][3][4]=new Array('To demonstrate that no Japanese Island was safe from attack.','Nope.  The U.S. always bypassed heavily-defended island is they could.',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('The Japanese troops on Okinawa knew that they were the last obstacle to an Allied invasion of the Japanese home islands.','Right.  Many swore to fight to the death and did.',1,100,1);
I[18][3][1]=new Array('Because this was the home of the Emperor.','Nope.  The Emperor was in the main Japanese islands.',0,0,1);
I[18][3][2]=new Array('Because the last of Japan\'s war materials were located on Okinawa.','Nope.  Japan still had large armies all across the Pacific.',0,0,1);
I[18][3][3]=new Array('Because Okinawa was the religious center of Japan.','Nope.  This was not the case.',0,0,1);
I[18][3][4]=new Array('Because it was thought that a victory here would win the war for Japan.','Nope.  Most Japanese knew the war was lost by this point.',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('The Soviet Union','Right.  The Soviets did not inform the U.S. or Britain about this, but it was known because of the breaking of the Japanese codes.',1,100,1);
I[19][3][1]=new Array('The French','Nope.  The Japanese had no diplomatic relations with the French at this point.',0,0,1);
I[19][3][2]=new Array('The British','Nope.  The Japanese had no diplomatic relations with the British at this point.',0,0,1);
I[19][3][3]=new Array('The Australians','Nope.  The Japanese were actively fighting the Australians at this point.',0,0,1);
I[19][3][4]=new Array('The Canadians','Nope.  The Canadians were a part of the Allied forces fighting against the Japanese.',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('2 September 1945 in Tokyo Bay.','Right.  Onboard the USS Missouri.',1,100,1);
I[20][3][1]=new Array('20 August, 1945 onboard the USS Missouri.','Nope.  Right ship, wrong date.',0,0,1);
I[20][3][2]=new Array('20 August, 1945 in Nagasaki.','Sorry.  Wrong on both counts.',0,0,1);
I[20][3][3]=new Array('2 September, 1945 in Nagasaki.','Sorry. Right time, wrong place.',0,0,1);
I[20][3][4]=new Array('15 September, 1945 in Tokyo Bay.','Nope.  Right place, wrong time.',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('Admiral Doorman','Excellent.  This group tried several times to stop the Japanese advance but were defeated almost every time.',1,100,1);
I[21][3][1]=new Array('Admiral Nimitz','Sorry.  Admiral Nimitz commanded the U.S. Pacific Fleet.',0,0,1);
I[21][3][2]=new Array('Admiral King','Nope.  Admiral King was in overall command of both the Pacific and Atlantic Fleets.',0,0,1);
I[21][3][3]=new Array('Admiral Halsey','Nope.  Vice Admiral Halsey was in charge of the U.S. Carrier Task Force selected to strike the Japanese home islands.',0,0,1);
I[21][3][4]=new Array('Admiral Fletcher','Sorry.  Rear Admiral Fletcher commanded the U.S. forces during the Battle of the Coral Sea.',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('Admiral Nimitz','Excellent.  Admiral Nimitz would direct the U.S. Pacific Fleet\'s efforts throughout the war.',1,100,1);
I[22][3][1]=new Array('Admiral King','Nope.  Admiral King was in overall command of both the Pacific and Atlantic Fleets.',0,0,1);
I[22][3][2]=new Array('Admiral Doorman','Sorry.  Dutch Admiral Karel Doorman commanded the ABDA naval force.',0,0,1);
I[22][3][3]=new Array('Admiral Halsey','Nope.  Vice Admiral Halsey was in charge of the U.S. Carrier Task Force selected to strike the Japanese home islands.',0,0,1);
I[22][3][4]=new Array('Admiral Macarthur','Sorry.  General MacArthur was in charge of U.S. and later Allied ground forces in the Pacific.',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('General MacArthur','Right.  MacArthur made this statement as he left Corregidor on President Roosevelt\'s orders.',1,100,1);
I[23][3][1]=new Array('Admiral Nimitz','Nope.  It wasn\'t Admiral Nimitz.',0,0,1);
I[23][3][2]=new Array('Vice Admiral Halsey','Sorry.  It wasn\'t Admiral Halsey.',0,0,1);
I[23][3][3]=new Array('Rear Admiral Fletcher','Nope.  It wasn\'t Admiral Fletcher.',0,0,1);
I[23][3][4]=new Array('Admiral King','Sorry.  It wasn\'t Admiral King.',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('The USS Hornet','Right!  This raid greatly boosted the public\'s morale back in the United States.',1,100,1);
I[24][3][1]=new Array('The USS Nimitz','Nope.  The aircraft carrier USS Nimitz would not be built until long after World War II.',0,0,1);
I[24][3][2]=new Array('The USS Lexington','Nope.  It wasn\'t the Lexington..',0,0,1);
I[24][3][3]=new Array('The USS Saratoga','Nope.  It wasn\'t Saratoga.',0,0,1);
I[24][3][4]=new Array('The USS Wasp','Sorry.  It wasn\'t the Wasp.',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('The USS Lexington','Right!  Severely damaged in the battle, she had to be sunk by one of her own escort destroyers.',1,100,1);
I[25][3][1]=new Array('The USS Yorktown','Sorry.  The Yorktown was damaged during the battle but did not sink.',0,0,1);
I[25][3][2]=new Array('The USS Hornet','Nope.  The Hornet did not participate in this action.',0,0,1);
I[25][3][3]=new Array('The USS Wasp','Nope.  The Wasp did not participate in this action.',0,0,1);
I[25][3][4]=new Array('The USS Guadalcanal','Sorry.  The Guadalcanal had not been built at this time and operated in the Atlantic, not the Pacific.',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('Coral Sea','Excellent.  Even though the U.S. losses were greater, it was a strategic victory.',1,100,1);
I[26][3][1]=new Array('Midway','Close, but here was one before Midway.',0,0,1);
I[26][3][2]=new Array('Pearl Harbor','Nope.  The Japanese were not turned back at Pearl Harbor.',0,0,1);
I[26][3][3]=new Array('Java Sea','Nope.  The Japanese won a significant victory in the battle of the Java Sea.',0,0,1);
I[26][3][4]=new Array('Leyte Gulf','Sorry.  The Japanese were falling back all over the Pacific by the time of the battle of Leyte Gulf.',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('The diversionary attack on Dutch Harbor, Alaska.','Correct.  The two-day bombardment resulted in 43 American deaths.',1,100,1);
I[27][3][1]=new Array('The Japanese air attack on Pearl harbor.','Sorry.  This had occurred much earlier in the war.',0,0,1);
I[27][3][2]=new Array('The Japanese sinking of the USS Lexington.','Nope.  This had occurred following the battle of the Coral Sea.',0,0,1);
I[27][3][3]=new Array('The Japanese attack on the airfield at Midway island.','Close, but this wasn\'t the very first action of the battle.',0,0,1);
I[27][3][4]=new Array('The sinking of the USS Yorktown.','Sorry.  This was the final action of the battle.',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 Japanese lost 4 and the U.S. lost 1.','Excellent!  The U.S. lost Yorktown, while Japan lost Soryo, Kaga, Akagi and Hiryu.',1,100,1);
I[28][3][1]=new Array('The U.S. lost 3 and the Japanese lost 2.','Nope.  The Japanese losses were higher and the U.S. losses lower.',0,0,1);
I[28][3][2]=new Array('The Japanese lost 2 and the U.S. lost 2.','Sorry.  The Japanese losses were higher and the U.S. losses lower.',0,0,1);
I[28][3][3]=new Array('The Japanese lost 3 and the U.S. lost 1.','Nope.  The Japanese losses were higher.',0,0,1);
I[28][3][4]=new Array('The Japanese lost 4 and the U.S. did not lose any.','Nope.  The U.S. did lose a carrier in the battle.',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('Admiral Yamamoto','Correct!  The breaking of Japan\'s naval codes gave the U.S. the flight plan Yamamoto was taking.',1,100,1);
I[29][3][1]=new Array('Admiral Ozawa','Admiral Ozawa was the Japanese commander at the battle of the Philippine Sea.',0,0,1);
I[29][3][2]=new Array('Admiral Nagumo','Sorry.  Admiral Nagumo was the Japanese commander at the battle of Midway.',0,0,1);
I[29][3][3]=new Array('Admiral Toyoda','Nope.  Admiral Toyoda commanded the Japanese Combined Fleet after the death of Admiral Yamamoto.',0,0,1);
I[29][3][4]=new Array('Admiral Nimitz','Sorry.  Admiral Nimitz was a U.S. Navy Admiral.',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('Peleliu','Correct.  This was a ferocious battle lasting more than two months and costing over 12,000 lives on both sides.',1,100,1);
I[30][3][1]=new Array('Morotai','Nope.  Morotai was one of the easiest conquests of the war.',0,0,1);
I[30][3][2]=new Array('Iwo Jima','Sorry.  While the marines suffered significant casualties landing on Iwo Jima, it wasn\'t the highest combat  casualty rate of the war.',0,0,1);
I[30][3][3]=new Array('Guadalcanal','Nope.  The initial landings on Guadalcanal were generally unopposed.',0,0,1);
I[30][3][4]=new Array('Saipan','Sorry.  Significant casualties were sustained on Saipan, but not the worst casualty rate of the war.',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('23,000','Excellent.  For a very small island, this was a large number of dedicated and ready troops.',1,100,1);
I[31][3][1]=new Array('50,000','Nope.  Not this many.',0,0,1);
I[31][3][2]=new Array('10,000','Sorry.  There were more than that.',0,0,1);
I[31][3][3]=new Array('15,000','Nope.  There were more than that.',0,0,1);
I[31][3][4]=new Array('15,000','Sorry.  Not that many.',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('Four','Correct.  Sibuyan Sea, Surigao Strait, Cape Engano and Samar.',1,100,1);
I[32][3][1]=new Array('Three','Sorry.  Think higher.',0,0,1);
I[32][3][2]=new Array('Two','Nope.  There were more than two.',0,0,1);
I[32][3][3]=new Array('Five','Sorry.  Not that many.',0,0,1);
I[32][3][4]=new Array('Six','Nope.  There weren\'t that many.',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('Admiral Nimitz','Excellent.  Over 19,000 marines and sailors were wounded and nearly 7,000 were killed.',1,100,1);
I[33][3][1]=new Array('General MacArthur','Sorry.  It wasn\'t MacArthur.',0,0,1);
I[33][3][2]=new Array('President Roosevelt','Sorry.  President Roosevelt did not make this statement.',0,0,1);
I[33][3][3]=new Array('Admiral King','Nope.  It wasn\'t Admiral King.',0,0,1);
I[33][3][4]=new Array('General Tojo','Nope.  This statement was made by an American military leader.',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('Iwo Jima','Correct.  Over 26,000 U.S. troops and sailors were killed or wounded versus approximately 23,000 Japanese.',1,100,1);
I[34][3][1]=new Array('Saipan','Nope.  While the U.s. suffered significant casualties here, the Japanese suffered more.',0,0,1);
I[34][3][2]=new Array('Guadalcanal','Nope.  While the U.s. suffered significant casualties here, the  Japanese suffered more.',0,0,1);
I[34][3][3]=new Array('Morotai','Sorry.  Morotai was taken without significant U.S. casualties.',0,0,1);
I[34][3][4]=new Array('Okinawa','Nope.  While the U.S. suffered significant casualties here, the  Japanese suffered more.',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('Okinawa','Right.  The Japanese lost 100,000 men and 7,000 aircraft.',1,100,1);
I[35][3][1]=new Array('Iwo Jima','Sorry.  Iwo Jima was not the last.',0,0,1);
I[35][3][2]=new Array('Guadalcanal','Nope.  Guadalcanal came early in the war.',0,0,1);
I[35][3][3]=new Array('Morotai','Nope.  Morotai was not the last amphibious operation.',0,0,1);
I[35][3][4]=new Array('Saipan','Sorry.  The invasion of Saipan came in the middle of the war.',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('7,000','Right!  Okinawa was the end of the fighting for the Japanese.',1,100,1);
I[36][3][1]=new Array('500','Nope.  Significantly more than this.',0,0,1);
I[36][3][2]=new Array('1,500','Nope.  Significantly more than this.',0,0,1);
I[36][3][3]=new Array('2,700','Nope.  Significantly more than this.',0,0,1);
I[36][3][4]=new Array('4,200','Nope.  Even more than this amount.',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('Operation Downfall','Excellent.  The use of atomic bombs at Hiroshima and Nagasaki made these plans unnecessary.',1,100,1);
I[37][3][1]=new Array('Operation Orange','Sorry.  There was no such operation.',0,0,1);
I[37][3][2]=new Array('Operation Overlord','Nope.  Operation Overlord was the code name for the Normandy Invasion.',0,0,1);
I[37][3][3]=new Array('Operation Avalanche','Nope.  Operation Avalanche was the code name for the invasion of Italy.',0,0,1);
I[37][3][4]=new Array('Operation Setting Sun','Sorry.  There was no such operation.',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('Nagasaki and Hiroshima.','Right.  Hiroshima on 6 August and Nagasaki on 9 August, 1945.',1,100,1);
I[38][3][1]=new Array('Hiroshima and Tokyo.','Sorry.  Tokyo was not targeted with atomic weapons.',0,0,1);
I[38][3][2]=new Array('Tokyo and Nagasaki.','Nope.  Tokyo was not targeted with atomic weapons.',0,0,1);
I[38][3][3]=new Array('Hiroshima and Kyoto.','Sorry.  Kyoto was not targeted with atomic weapons.',0,0,1);
I[38][3][4]=new Array('Kyoto and Nagasaki.','Nope.  Kyoto was not targeted with atomic weapons.',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('That the imperial system and the Emperor be allowed to remain.','Correct.  The U.S. Secretary of State accepted this condition, subject to agreed upon stipulations.',1,100,1);
I[39][3][1]=new Array('That the Japanese keep control of Okinawa.','Sorry.  This was not the one condition insisted on by the Japanese.',0,0,1);
I[39][3][2]=new Array('That the Japanese Navy not be taken over by the Allies.','Nope.  The Japanese Navy was destroyed by this point.',0,0,1);
I[39][3][3]=new Array('That there would be no war crime trials after the war.','Sorry.  There were war crime trials in Tokyo after the war.',0,0,1);
I[39][3][4]=new Array('That the Kurile Islands not fall into the hands of the Soviet Union.','Nope.  The Soviet Union took possession of these islands after the war.',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('Savo Island','Correct.  The Allies lost over 1,000 sailors in this cruiser night action.',1,100,1);
I[40][3][1]=new Array('Midway Island','Sorry.  This was a U.S. victory.',0,0,1);
I[40][3][2]=new Array('Coral Sea','Nope.  Coral Sea was a strategic victory for the U.S.',0,0,1);
I[40][3][3]=new Array('Guadalcanal','Sorry.  U.S. forces won the battle of Guadalcanal.',0,0,1);
I[40][3][4]=new Array('Iwo Jima','Nope.  U.S. forces won the battle of Iwo Jima.',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('America, Britain, the Dutch and the Australians.','Right.  Headquartered in Java, it was never very effective because of its limited forces.',1,100,1);
I[41][3][1]=new Array('Australia, Britain, the Dutch and the Russians.','Nope.  The Russians did not take part.',0,0,1);
I[41][3][2]=new Array('America, Borneo, the Dutch and the Australians.','Nope.  Borneo had no naval forces.',0,0,1);
I[41][3][3]=new Array('America, Britain, the Dutch and the Chinese.','Nope.  The Chinese had no naval forces.',0,0,1);
I[41][3][4]=new Array('Australia, Britain, France and America.','Nope, The French Navy was not involved.',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('The Battle of the Coral Sea','Correct.  This marked the first time in history that naval ships fought against each other without ever getting sight of each other.',1,100,1);
I[42][3][1]=new Array('The Battle of Midway','Nope.  Midway was more decisive, but it wasn\'t the first.',0,0,1);
I[42][3][2]=new Array('The Battle of Guadalcanal','Nope.  The was primarily a land and sea battle.',0,0,1);
I[42][3][3]=new Array('The Battle of Guadalcanal','Nope.  this was a nighttime surface action between cruisers.',0,0,1);
I[42][3][4]=new Array('The Battle of the Java Sea','Nope.  This was an earlier engagement between ABDA forces and the Japanese.',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('The Battle of Leyte Gulf','Correct.  This last-ditch attempt at crippling the U.S. Fleet almost paid off for the Japanese.',1,100,1);
I[43][3][1]=new Array('The Battle of Midway','Nope.  Kamikazes did not occur at Midway.',0,0,1);
I[43][3][2]=new Array('The Battle of the Coral Sea','Nope.  The Japanese did not use the kamikaze tactic in this battle.',0,0,1);
I[43][3][3]=new Array('The Battle of the Java Sea','Nope.  The Japanese had not developed this tactic this early in the war.',0,0,1);
I[43][3][4]=new Array('The Battle of Savo Island','Nope.  This was a surface naval action and did not involve aircraft.',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('Kiska and Attu islands.','Correct.  These landings were unopposed.',1,100,1);
I[44][3][1]=new Array('Dutch Harbor.','Sorry.  Dutch Harbor was bombed but not invaded by Japanese land forces.',0,0,1);
I[44][3][2]=new Array('Anchorage and Whittier.','Nope.  Neither of these cities were targeted by the Japanese.',0,0,1);
I[44][3][3]=new Array('Seward.','Nope.  Seward never saw a Japanese invasion.',0,0,1);
I[44][3][4]=new Array('Shimia island.','Sorry.  While one of the Aleutian Islands, Shimia was not invaded by the Japanese.',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);
			}
		}
	}
//Undocumented function added 10/12/2004
	ShowSpecialReadingForQuestion();
}

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);
//New for 6.2.2.1: If you want to mark an answer as correct even when it's the final choice, uncomment this line.
//		if (I[QNum][3][ANum][2] >= 1){Btn.innerHTML = CorrectIndicator;}else{Btn.innerHTML = IncorrectIndicator;}	
		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];
	if (State[QNum][5].length > 0){State[QNum][5] += ' | ';}
	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();
//New for 6.2.2.1
			var QsDone = CheckQuestionsCompleted();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.' + '<br />' + QsDone;
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.' + '<br />' + QsDone);
			}
			else{
				WriteToInstructions(QsDone);
			}
		}
	}
	else{
//It's right
//Mark the answer
		Btn.innerHTML = CorrectIndicator;
				
//Calculate the score for this question
		CalculateMCQuestionScore(QNum);
		
//New for 6.2.2.0
		var QsDone = CheckQuestionsCompleted();

//Get the overall score and add it to the feedback
		if (ContinuousScoring == true){
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.' + '<br />' + QsDone;
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.' + '<br />' + QsDone);
			}
		}
		else{
			WriteToInstructions(QsDone);
		}
	}
	
//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));
			}
		}
//Fix for Safari bug added for version 6.0.3.42 (negative infinity problem)
		if ((State[QNum][0] < 0)||(State[QNum][0] == Number.NEGATIVE_INFINITY)){
			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; 
	}
}

//New for 6.2.2.0
function CheckQuestionsCompleted(){
	if (ShowCompletedSoFar == false){return '';}
	var QsCompleted = 0;
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] >= 0){
				QsCompleted++;
			}
		}
	}
//Fixes for 6.2.2.2
	if (QsCompleted >= QArray.length){
		return ExerciseCompleted;
	}
	else{
		return CompletedSoFar + ' ' + QsCompleted + '/' + QArray.length + '.';
	}
}

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;
		}
		
//New for 6.2.2.0
		FB += '<br />' + ExerciseCompleted;
		
		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);
	}

}










//-->

//]]>


