

//<![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 Maginot Line','Correct.  It was believed by France that this defensive line would prevent the invasion of France.',1,100,1);
I[0][3][1]=new Array('The Siegfried Line','Nope.  That wasn\'t the name.',0,0,1);
I[0][3][2]=new Array('The Atlantic Wall','Nope.  This referred to Hitler\'s defenses along the Atlantic coast of France.',0,0,1);
I[0][3][3]=new Array('The Paris Defenses','Nope.  No such defenses existed.',0,0,1);
I[0][3][4]=new Array('The Rhineland Line','Nope.  No such defenses existed.',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('Dunkirk','Correct.  More than 340,000 English soldiers were successfully evacuated over a nine-day period.',1,100,1);
I[1][3][1]=new Array('Paris','Nope.  This wasn\'t the city.',0,0,1);
I[1][3][2]=new Array('Normandy','Nope.  Normandy is where the Allied forces would come ashore in June of 1944.',0,0,1);
I[1][3][3]=new Array('Maginot','Nope.  This was the name of the defensive line between France and Germany at the start of the war.',0,0,1);
I[1][3][4]=new Array('Toulon','Nope.  This port city of southern France was not the site of this evacuation.',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('The Free French','Correct.  This was the main French resistance movement of the war.',1,100,1);
I[2][3][1]=new Array('The Vichy French','Sorry.  The Vichy French government was set up by the Germans after they captured France.',0,0,1);
I[2][3][2]=new Array('The Allied Underground','Nope.  This wasn\'t the name.',0,0,1);
I[2][3][3]=new Array('The French Freedom Fighters','Nope.  This wasn\'t the name.',0,0,1);
I[2][3][4]=new Array('The French Liberators','Nope.  This wasn\'t the name.',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('An air war over England between the Royal Air Force and the German Luftwaffe.','Correct.  It lasted over a year and resulted in a large number of casualties to English civilians as well as to the German Air Force.',1,100,1);
I[3][3][1]=new Array('A naval engagement off the coast of London between the British Channel Fleet and the German Navy.','Nope. There was never such an engagement.',0,0,1);
I[3][3][2]=new Array('A limited ground war between German amphibious troops and the British Army.','Nope. There was never such an engagement.',0,0,1);
I[3][3][3]=new Array('An invasion of England by Germans and their Irish supporters through Ireland.','Nope.  There was never such an engagement.',0,0,1);
I[3][3][4]=new Array('A German submarine campaign around the British home islands targeted at merchant shipping.','Nope.  While this went on, it wasn\'t called the Battle of Britain.',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('Admiral King','Correct.  He also became the Chief of Naval Operations in March 1942.',1,100,1);
I[4][3][1]=new Array('Admiral Donitz','Nope.  Admiral Donitz controlled the German submarine forces.',0,0,1);
I[4][3][2]=new Array('Admiral Rommel','Nope.  Rommel was a German Field Marshall.',0,0,1);
I[4][3][3]=new Array('Admiral Kent Hewitt','Nope.  Admiral Hewitt was the Amphibious Task force Commander for the invasion of North Africa.',0,0,1);
I[4][3][4]=new Array('Admiral Montgomery','Nope.  Montgomery was a British Field Marshall.',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('The German submarine campaign against Allied shipping in the Atlantic.','Correct.  This had a dramatic effect on the movement of war goods from the United States to England.',1,100,1);
I[5][3][1]=new Array('An air war over England between the Royal Air Force and the German Luftwaffe.','Nope.  This was the Battle of Britain.',0,0,1);
I[5][3][2]=new Array('A naval engagement off the coast of London between the British Channel Fleet and the German Navy.','Nope.  Such an engagement never took place.',0,0,1);
I[5][3][3]=new Array('An invasion of England by Germans and their Irish supporters through Ireland.','Sorry.  This event never took place.',0,0,1);
I[5][3][4]=new Array('A limited ground war between German amphibious troops and the British Army.','Sorry.  This event never took place.',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('A coordinated attack against a convoy by up to 30 or 40 German submarines.','Correct.  This would overwhelm the defenses of the convoy and give the subs a better chance of sinking merchant ships.',1,100,1);
I[6][3][1]=new Array('One submarine would "cry wolf" by using false radio transmissions to throw off the defending destroyers while the others attacked.','Nope.  Sounds good, but it didn\'t happen.',0,0,1);
I[6][3][2]=new Array('To trail convoys and pick off the weakest ships.','Nope.  This wasn\'t the wolf-pack tactic.',0,0,1);
I[6][3][3]=new Array('To sail out of a port in a pack, the split up to confuse the Allied search planes.','Nope.  This wasn\'t it.',0,0,1);
I[6][3][4]=new Array('To paint the faces of wolves on their submarines to terrorize the ships they were chasing.','Sorry.  The Germans did not do this.',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('It allowed the Germans to set up sub bases there and cut the transit time in half to their operating stations.','Correct.  This meant that the subs could spend more time looking for and sinking shipping.',1,100,1);
I[7][3][1]=new Array('Because the French coastal antisubmarine defenses could be taken out.','Nope.  This was never a factor.',0,0,1);
I[7][3][2]=new Array('Norway and France had the raw materials needed to build more submarines.','Nope.  The Germans had plenty of supplies to build submarines.',0,0,1);
I[7][3][3]=new Array('Norway and France had the fuel reserves to ensure that the submarine fleet never ran out of oil.','Nope.  This wasn\'t a factor.',0,0,1);
I[7][3][4]=new Array('The capture of French and Norwegian submarines gave Germany a technological lead in undersea warfare.','Sorry.  Neither France nor Norway had submarines as advanced as the Germans.',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('Murmansk','Correct.  Many historians believe that the supplies that made it through to the port were the critical element that kept Russia in the war.',1,100,1);
I[8][3][1]=new Array('Moscow','Nope.  Moscow was never a port city.',0,0,1);
I[8][3][2]=new Array('St. Petersburg','Nope.  Not even when it was called Leningrad.',0,0,1);
I[8][3][3]=new Array('Vladivostok','Nope.  This is a Pacific Ocean port and not a factor in the war in Europe.',0,0,1);
I[8][3][4]=new Array('Stalingrad','Nope.  While it was the site of a decisive land battle, Stalingrad was not a port city.',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('The capture of a German submarine.','Correct.  This was the first vessel captured by the U.S. Navy since the war of 1812.',1,100,1);
I[9][3][1]=new Array('The first use of Hedgehog weapons to destroy a submarine.','Nope.  They had already been around for some time by the time of this incident.',0,0,1);
I[9][3][2]=new Array('The first use of Sonar to locate a submarine.','Nope.  Sonar wasn\'t being used at this point.',0,0,1);
I[9][3][3]=new Array('The first use of a submarine to kill another submarine.','Nope.  This wasn\'t the exploit.',0,0,1);
I[9][3][4]=new Array('The first ramming of a submarine on the high seas.','Nope.  This wasn\'t it.',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('Snorkels','Correct.  This permitted them to operate diesel engines while submerged.',1,100,1);
I[10][3][1]=new Array('Sonar jamming systems','Nope.  No such systems existed.',0,0,1);
I[10][3][2]=new Array('Sonar','Nope.  German submarines never made use of sonar.',0,0,1);
I[10][3][3]=new Array('Nuclear propulsion','Nope.  This type of propulsion system wasn\'t developed until after World War II.',0,0,1);
I[10][3][4]=new Array('Anti-ship missiles which could be fired underwater.','Sorry.  The Germans never had such technology.',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 Allied amphibious landings in North Africa.','Correct.  This became the first Allied offensive operation against the Axis in the European-North African theater.',1,100,1);
I[11][3][1]=new Array('The Allied amphibious landings in Sicily.','Nope.  That operation had another name.',0,0,1);
I[11][3][2]=new Array('The Allied amphibious landings in Italy.','Nope.  That operation had another name.',0,0,1);
I[11][3][3]=new Array('The Allied amphibious landings in France.','Nope.  That operation had another name.',0,0,1);
I[11][3][4]=new Array('The Allied amphibious landings in England.','Sorry.  The Allies never invaded England.',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('Some resistance at Casablanca, but almost none elsewhere.','Correct.  Secret orders had been issued for their surrender to the Allies.',1,100,1);
I[12][3][1]=new Array('No resistance was give at all.','Sorry.  Although there was almost no resistance in most areas, there was some significant resistance in one spot.',0,0,1);
I[12][3][2]=new Array('A large amount at all landing points.','Nope.  At most points there was limited to no opposition.',0,0,1);
I[12][3][3]=new Array('A large amount at Casablanca and significant amounts at the others.','Nope.  Only Casablanca provided some limited defense.',0,0,1);
I[12][3][4]=new Array('They stopped the Allies at Casablanca but could not hold them off in the other areas.','Nope.  The Allied forces were quickly successful in all areas.',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('They were scuttled in Toulon, France.','Correct.  This was done to prevent their use by the Germans.',1,100,1);
I[13][3][1]=new Array('They surrendered to the Free French forces.','Nope.  This never occurred.',0,0,1);
I[13][3][2]=new Array('They reverted to German control and flew the German flag.','Nope.  This would have happened if not for some loyal French naval officers.',0,0,1);
I[13][3][3]=new Array('They lacked the fuel to put to sea and remained in port for the remainder of the war.','Nope.  This wasn\'t the way it turned out.',0,0,1);
I[13][3][4]=new Array('They sortied out to save the German forces and were defeated at sea by the British fleet.','Nope.  This never happened.',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('Stalingrad','Correct.  An entire German Army was surrounded and defeated here.',1,100,1);
I[14][3][1]=new Array('Casablanca','Nope.  While an important amphibious landing, this was not a major battle for the Allies.',0,0,1);
I[14][3][2]=new Array('Anzio','Nope.  While an important amphibious landing, this was not a major battle for the Allies.',0,0,1);
I[14][3][3]=new Array('Guadalcanal','Nope.  This was a Pacific battle.',0,0,1);
I[14][3][4]=new Array('Gallipoli','Nope.  This was a failed amphibious operation in World War I.',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('It largely eliminated Italy from the war.','Correct.  The Italians began private negotiations for surrender after the fall of Sicily.',1,100,1);
I[15][3][1]=new Array('Germany lost her only naval base in the Mediterranean Sea.','Germany never used Sicily as a naval base.',0,0,1);
I[15][3][2]=new Array('The Axis forces lost their primary source of food.','Nope.  Sicily did not produce a large amount of food.',0,0,1);
I[15][3][3]=new Array('The Axis forces lost their primary source of oil.','Nope.  Sicily did not produce a large amount of oil.',0,0,1);
I[15][3][4]=new Array('The capture of German Field Marshall Rommel.','Nope.  This never occurred.',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('Anzio','Correct.  Although there was little resistance to the initial landings, this beachhead became a stalemate for quite some time.',1,100,1);
I[16][3][1]=new Array('Salerno','Nope.  Salerno was the site of the first landings in Italy.',0,0,1);
I[16][3][2]=new Array('Naples','Nope.  Naples had been taken some time earlier.',0,0,1);
I[16][3][3]=new Array('Rome','Nope.  the site was another town some 37 miles from Rome.',0,0,1);
I[16][3][4]=new Array('Corsica','Nope.  Corsica is an island and not a part of the Italian mainland.',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('Normandy','Right.  This was the site of the D-Day landings.',1,100,1);
I[17][3][1]=new Array('Anzio','Nope.  Anzio was a landing site in Italy slightly before the Normandy landings.',0,0,1);
I[17][3][2]=new Array('Salerno','Nope.  The landings at Salerno were the first landings made in Italy.',0,0,1);
I[17][3][3]=new Array('Dunkirk','Nope.  this was the site of the evacuation of the English Army after the fall of France to Germany early in the war.',0,0,1);
I[17][3][4]=new Array('Casablanca','Nope.  Casablanca was one of the landing sites for the first North African landings.',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('To get favorable weather.','Right.  The weather on 5 June was not considered right for the landings.',1,100,1);
I[18][3][1]=new Array('To get all available forces in place.','Nope.  All Allied forces were ready to go on 5 June.',0,0,1);
I[18][3][2]=new Array('To ensure an adequate supply of fuel for the operation.','Nope.  Enough fuel was ready to go on 5 June.',0,0,1);
I[18][3][3]=new Array('To allow the navies another day to shell German coastal defenses.','Nope.  Enough preparation of the beaches had already been done.',0,0,1);
I[18][3][4]=new Array('Because of intelligence that a major German Division was pulling out on 5 June.','Nope.  This never occurred.',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('Control of the air.','Correct.  Air support of Allied forces proved to be the deciding factor once inland.',1,100,1);
I[19][3][1]=new Array('Faster tanks and trucks than the German Army had.','Nope.  Both sides were evenly matched in this regard.',0,0,1);
I[19][3][2]=new Array('The good road and rail systems in France.','Sorry.  The Germans took pains to blow up bridges, destroy railroads and other methods which might aid the Allies.',0,0,1);
I[19][3][3]=new Array('Control of the seas.','Nope.  Sea control did not have an impact on the movement of troops through France.',0,0,1);
I[19][3][4]=new Array('The German Army was not as strong as the Allies had thought.','Nope.  The Germans were strong and ready, they just didn\'t have the air support the Allies had.',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('The Battle of the Bulge','Right.  This was a last-chance gamble to try and push back the Allied armies in the west.',1,100,1);
I[20][3][1]=new Array('Stalingrad','Nope.  This was a decisive battle in the eastern front earlier in the war.',0,0,1);
I[20][3][2]=new Array('Normandy','Nope.  This was the major landing of Allied forces in France.',0,0,1);
I[20][3][3]=new Array('The Siegfried Line','Nope.  This was the last major line of German defenses before entering Germany itself.',0,0,1);
I[20][3][4]=new Array('The Blitzkrieg','Nope.  This is German for "Lighting War" and is the method Germany used to conquer Poland and France early in the war.',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('On 7 May 1945 in Reims, France.','Correct.  In the little red school house that served as Eisenhower\'s headquarters.',1,100,1);
I[21][3][1]=new Array('On 10 May, 1945 in Berlin.','Nope.  Wrong day and place.',0,0,1);
I[21][3][2]=new Array('On 7 May, 1945 in Paris France','Nope.  Wrong place.',0,0,1);
I[21][3][3]=new Array('On 10 May, 1945 in Reims, France','Nope.  Wrong day.',0,0,1);
I[21][3][4]=new Array('On 8 May, 1945 in London, England','Nope.  Wrong day and place.',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('Denmark and Norway','Correct.  This gave the Germans new ports for their submarine fleet.',1,100,1);
I[22][3][1]=new Array('Poland and France','Sorry.  Poland came earlier and France would come later.',0,0,1);
I[22][3][2]=new Array('Poland and Norway','Nope.  Poland came earlier',0,0,1);
I[22][3][3]=new Array('France and Denmark','Sorry.  France would come later',0,0,1);
I[22][3][4]=new Array('France and England','Nope.  France would come later and the Germans never invaded England.',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('Rommel','Excellent.  It was rumored that Field Marshall Rommel was Hitler\'s personal favorite.',1,100,1);
I[23][3][1]=new Array('Churchill','Nope.  Winston Churchill was the Prime Minister of England during the war.',0,0,1);
I[23][3][2]=new Array('De Gaulle','Sorry.  Charles de Gaulle was the leader of the Free French forces during the war.',0,0,1);
I[23][3][3]=new Array('P\u00E9tain','Sorry.  Philippe P\u00E9tain was the leader of the Vichy French Government during the war.',0,0,1);
I[23][3][4]=new Array('Blitzkrieg','Nope.  This is German for "lightning war".',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('June, 1941','Excellent!  Up until this time they had a nonaggression pact with the Soviets',1,100,1);
I[24][3][1]=new Array('September, 1939','Sorry.  This was the month that Germany invaded Poland.',0,0,1);
I[24][3][2]=new Array('April, 1940','Nope.  This was the month that Germany invaded Denmark and Norway.',0,0,1);
I[24][3][3]=new Array('May, 1940','Nope.  this was the month that Germany invaded France, Belgium and the Netherlands.',0,0,1);
I[24][3][4]=new Array('June, 1940','Sorry.  This was the month the Germans entered Paris and France surrendered to Germany.',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('Admiral Donitz','',1,100,1);
I[25][3][1]=new Array('Admiral Rommel','Sorry.  General Rommel was the German officer in charge of the Afrika Corps during World War II.',0,0,1);
I[25][3][2]=new Array('Admiral Goering','Sorry.  General Goering was the commander of the German Air Forces.',0,0,1);
I[25][3][3]=new Array('Admiral King','Nope.  Admiral King was the U.S. Chief of naval Operations during most of World War II.',0,0,1);
I[25][3][4]=new Array('Admiral Von Spee','Nope.  Admiral Graf Von Spee was a German Admiral during World War I.',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 USS Guadalcanal','Right.  She was commanded by Captain Dan Gallery.',1,100,1);
I[26][3][1]=new Array('The USS Hornet','Nope.  While the Hornet was a U.S. carrier, it was assigned duty in the Pacific.',0,0,1);
I[26][3][2]=new Array('The USS Langley','Nope.  The Langley was the first U.S. aircraft carrier but did not fight in World War II.',0,0,1);
I[26][3][3]=new Array('The USS Saratoga','Nope.  While the Saratoga was a U.S. carrier, it was assigned duty in the Pacific.',0,0,1);
I[26][3][4]=new Array('The USS Lexington','Nope.  While the Lexington was a U.S. carrier, it was assigned duty in the Pacific.',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 port of Casablanca','Right.  This would be the key first landing in North Africa.',1,100,1);
I[27][3][1]=new Array('The port of Naples','Nope.  Naples wasn\'t involved in Operation Torch.',0,0,1);
I[27][3][2]=new Array('The invasion of France','Sorry.  Operation Torch had to do with North Africa, not France.',0,0,1);
I[27][3][3]=new Array('The capture of General Rommel','Nope.  Operation Torch did not have the capture of one person as its objective.',0,0,1);
I[27][3][4]=new Array('The port of Algiers','Nope.  Right part of the world, wrong port.',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('Hitler ordered the occupation of the whole of France.','Right.  Up until that time the Vichy French Government had retained control of about 2/5ths of France.',1,100,1);
I[28][3][1]=new Array('Germany withdrew from France','Nope.  It would take the Allied Armies a few more years to make this happen.',0,0,1);
I[28][3][2]=new Array('Germany withdrew from North Africa','Sorry.   The landings in North Africa were only a part of the overall campaign to defeat German forces in North Africa.',0,0,1);
I[28][3][3]=new Array('Germany withdrew from the League of Nations.','Sorry.  This had happened well before the war started.',0,0,1);
I[28][3][4]=new Array('Sue for peace with the French.','Nope.  Germany had conquered France by this point.',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('England','Right.  England did not feel the Allies were ready for such a large operation in the Spring of 1942.',1,100,1);
I[29][3][1]=new Array('The United States','Nope.  The U.S. initially pushed for the invasion.',0,0,1);
I[29][3][2]=new Array('The Soviet Union','Nope.  The Soviet Union wanted the invasion to weaken the German armies attacking their country.',0,0,1);
I[29][3][3]=new Array('Japan','Sorry.  Japan was not an Allied power during World War II.',0,0,1);
I[29][3][4]=new Array('France','Sorry.  France was conquered by Germany by this point in the war.',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('The Casablanca Conference','Right.  This conference set the priority of antisubmarine operations in the Atlantic.',1,100,1);
I[30][3][1]=new Array('The Yalta Conference','Sorry.  The Yalta Conference would come later in the war.',0,0,1);
I[30][3][2]=new Array('The Paris Conference','Nope.  There was never a Paris Conference.',0,0,1);
I[30][3][3]=new Array('The Washington Conference','Sorry.  The Washington Conference was in 1921 and concerned naval armament agreements.',0,0,1);
I[30][3][4]=new Array('The Morocco Conference','Nope.  There was never a Morocco Conference.',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('Hewitt','Right.  Over 580 ships landed and supported some 470,000 Allied troops for Operation Husky.',1,100,1);
I[31][3][1]=new Array('Montgomery','Sorry.  Field Marshal Montgomery commanded the British Eighth Army.',0,0,1);
I[31][3][2]=new Array('King','Sorry.  Admiral King was the Chief of Naval Operations for most of World War II, but was not in charge of these operations.',0,0,1);
I[31][3][3]=new Array('Nimitz','Nope.  Admiral Nimitz was in charge of the U.S. naval Forces in the Pacific during World War II.',0,0,1);
I[31][3][4]=new Array('Churchill','Nope.  Winston Churchill was the Prime Minister of England during the war.',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('Italy','Right!  Although the Italian government had announced an armistice, the Germans still held Italy',1,100,1);
I[32][3][1]=new Array('North Africa','Sorry.  That was Operation Torch.',0,0,1);
I[32][3][2]=new Array('Sicily','Sorry.  That was Operation Husky.',0,0,1);
I[32][3][3]=new Array('France','Nope.  That was Operation Overlord.',0,0,1);
I[32][3][4]=new Array('Turkey','Nope.  There was never an Allied plan to invade Turkey in World War II.',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('Malta','Excellent.  Most of the Italian fleet sailed out of Italian ports and to Malta for the surrender.',1,100,1);
I[33][3][1]=new Array('Salerno','Sorry.  This was the site of an Allied amphibious landing, but not the spot where the Italian Fleet surrendered.',0,0,1);
I[33][3][2]=new Array('Genoa','Nope.  Many of the Italian Naval ships had come from this port to surrender, but they did not surrender here.',0,0,1);
I[33][3][3]=new Array('La Spezia','Nope.  Many of the Italian Naval ships had come from this port to surrender, but they did not surrender here.',0,0,1);
I[33][3][4]=new Array('Naples','Sorry.  Naples was the site of some significant fighting, but the Italian Fleet did not surrender here.',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('Operation Avalanche','Correct.  They were used to try and counter the effective Allied naval gunfire support.',1,100,1);
I[34][3][1]=new Array('Operation Husky','Sorry.  They were not used during the invasion of Sicily.',0,0,1);
I[34][3][2]=new Array('Operation Torch','Sorry.  There were not used during the invasion of North Africa.',0,0,1);
I[34][3][3]=new Array('Operation Overlord','Nope.  They had already been in use before the invasion of France.',0,0,1);
I[34][3][4]=new Array('Operation Anvil','Nope.  They had already been in use before the invasion of Southern France.',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('The Gustav Line','Right.  This line held until its key fortress, Monte Cassino, fell.',1,100,1);
I[35][3][1]=new Array('The Maginot Line','Sorry.  This was the defensive line set up by the French prior to World War II to stop a German invasion.',0,0,1);
I[35][3][2]=new Array('The Siegfried Line','Nope.  This was the final German defensive line between France and Germany.',0,0,1);
I[35][3][3]=new Array('The Luftwaffe Line','Sorry.  "Luftwaffe" is German for "Air Force".',0,0,1);
I[35][3][4]=new Array('The Blitzkrieg Line','Nope.  "Blitzkrieg" is German for "Lightning War" and was not a defensive line.',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('Omaha and Utah','Correct.  It makes sense that they would American names, doesn\'t it?!',1,100,1);
I[36][3][1]=new Array('Omaha and Gold','Nope.  One of these was a British target.',0,0,1);
I[36][3][2]=new Array('Omaha and Gold','Nope.  One of these was a British target.',0,0,1);
I[36][3][3]=new Array('Juno and Sword','Sorry.  These were both British targets.',0,0,1);
I[36][3][4]=new Array('Gold and Sword','Nope.  These were both British targets.',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('Mines','Correct.  Over 30 ships were sunk by mines during the invasion.',1,100,1);
I[37][3][1]=new Array('Torpedoes','Nope.  The Germans didn\'t use torpedoes against the Allied ships.',0,0,1);
I[37][3][2]=new Array('Submarines','Nope.  German submarines did not pose a significant threat to the Allied force.',0,0,1);
I[37][3][3]=new Array('Shore guns','Sorry.  While the Germans did use shore guns, they were not the most deadly weapons.',0,0,1);
I[37][3][4]=new Array('Tanks','Sorry.  Tanks did support the defense of the beaches but there were not the most deadly weapons used by the Germans.',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('Operation Anvil','Excellent!  These landings took place on the French Riviera near Mars',1,100,1);
I[38][3][1]=new Array('Operation Overlord','Sorry.  This was the invasion of France at Normandy.',0,0,1);
I[38][3][2]=new Array('Operation Torch','Sorry.  This was the initial Allied invasion of North Africa.',0,0,1);
I[38][3][3]=new Array('Operation Husky','Nope.  This was the Allied invasion of Sicily.',0,0,1);
I[38][3][4]=new Array('Operation Avalanche','Nope.  This was the Allied invasion of Italy.',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('A shortage of landing craft.','Excellent.  The D-Day landings had used up the bulk of landing craft and they needed to be moved south.',1,100,1);
I[39][3][1]=new Array('Bad weather.','Nope.  Weather was not the reason for the delay.',0,0,1);
I[39][3][2]=new Array('The German submarine threat.','Sorry.  German subs were not a significant threat to Allied ships by this point in the war.',0,0,1);
I[39][3][3]=new Array('The German battleship threat.','Sorry.  German battleships were not a threat to Allied ships by this point in the war.',0,0,1);
I[39][3][4]=new Array('There was no delay in the Allied landings here.','Nope.  There was a delay from June all the way through the middle of August.',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('Von Rundstedt','Correct.  The Germans made quick advances at first but were stopped at Bastogne.',1,100,1);
I[40][3][1]=new Array('Rommel','Sorry.  Field Marshal Rommel was not involved in this action.',0,0,1);
I[40][3][2]=new Array('Donitz','Sorry.  Admiral Donitz was in charge of the German submarine effort.',0,0,1);
I[40][3][3]=new Array('De Gaulle','Nope.  General De Gaulle was in charge of the Free French forces.',0,0,1);
I[40][3][4]=new Array('Montgomery','Nope.  Field Marshal Montgomery was in charge of the British 8th Army.',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('Bastogne','Correct.  This ended the German advance and proved to be Germany\'s last offensive action of the war.',1,100,1);
I[41][3][1]=new Array('Paris','Nope.  the German advance never made it that far.',0,0,1);
I[41][3][2]=new Array('Verdun','Sorry.  While Verdun was the scene of some significant fighting during World War I, it was not involved in the Battle of the Bulge.',0,0,1);
I[41][3][3]=new Array('Dijon','Nope.  The German advance did not make it this far.',0,0,1);
I[41][3][4]=new Array('Cherbourg','Nope.  Cherbourg, on the coast of France, was taken following the landings at Normandy.',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 Rhine River','Correct!  Navy landing craft helped ferry elements of General Bradley\'s armies over the river in most of their initial crossings.',1,100,1);
I[42][3][1]=new Array('Cherbourg','Nope.  The Navy saw direct action well after the capture of Cherbourg.',0,0,1);
I[42][3][2]=new Array('Naples','Sorry.  The Navy participated in several major actions after the capture of Naples.',0,0,1);
I[42][3][3]=new Array('Normandy','Sorry.  The Normandy landings were not the last of the actions for the U.S. Navy.',0,0,1);
I[42][3][4]=new Array('The Elbe River','Nope.  The Navy was not involved in the link-up of Allied forces at the Elbe River.',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 Soviet Union','Correct.  This marked the end of an offensive that started at Stalingrad.',1,100,1);
I[43][3][1]=new Array('England','Nope.  The Allied forces in the West did not enter Berlin first.',0,0,1);
I[43][3][2]=new Array('France','Nope.  The Allied forces in the West did not enter Berlin first.',0,0,1);
I[43][3][3]=new Array('The United States','Nope.  The Allied forces in the West did not enter Berlin first.',0,0,1);
I[43][3][4]=new Array('Canada','Nope.  The Allied forces in the West did not enter Berlin first.',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('Switzerland','Excellent.  He was captured and killed by Italian antifacist guerrillas.',1,100,1);
I[44][3][1]=new Array('France','Sorry.  He wouldn\'t have been too welcome in France!',0,0,1);
I[44][3][2]=new Array('Argentina','Nope.  He wasn\'t trying to make it to Argentina.',0,0,1);
I[44][3][3]=new Array('Bolivia','Nope.  Bolivia was not in his plans.',0,0,1);
I[44][3][4]=new Array('Turkey','Sorry.  Turkey was on the side of the Allied Powers by the end of the war.',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);
	}

}










//-->

//]]>


