

//<![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 IE
	this.ie = (this.ua.indexOf('MSIE') > 0);
	if (this.ie){
		this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
		if (this.ieVer < 5.5){this.min = false;}
	}
//Look for Opera
	this.opera = (this.ua.indexOf('Opera') > 0);
	if (this.opera){
		this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
		if (this.operaVer < 7.04){this.min = false;}
	}
	if (this.min == false){
		alert('Your browser may not be able to handle this page.');
	}
//Special case for the horrible ie5mac
	this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
}

var C = new Client();

//for (prop in C){
//	alert(prop + ': ' + C[prop]);
//}



//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS

//[strNavBarJS]
function NavBtnOver(Btn){
	if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
}

function NavBtnOut(Btn){
	Btn.className = 'NavButton';
}

function NavBtnDown(Btn){
	Btn.className = 'NavButtonDown';
}
//[/strNavBarJS]

function FuncBtnOver(Btn){
	if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
}

function FuncBtnOut(Btn){
	Btn.className = 'FuncButton';
}

function FuncBtnDown(Btn){
	Btn.className = 'FuncButtonDown';
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		if (document.getElementById('CheckButton2') != null){
			document.getElementById('CheckButton2').focus();
		}
		else{
			document.getElementsByTagName('button')[0].focus();
		}
	}
}




//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX

var topZ = 1000;

function ShowMessage(Feedback){
	var Output = Feedback + '<br /><br />';
	document.getElementById('FeedbackContent').innerHTML = Output;
	var FDiv = document.getElementById('FeedbackDiv');
	topZ++;
	FDiv.style.zIndex = topZ;
	FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
//IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
	if (!C.ie){
		document.getElementById('FeedbackOKButton').focus();
	}
	FDiv.style.display = 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');

	if (C.ie){
		document.getElementById('FeedbackOKButton').focus();
	}
	
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
	if (C.ie){
		var Els = document.getElementsByTagName(TagName);
		for (var i=0; i<Els.length; i++){
			if (Show == true){
				Els[i].style.display = 'inline';
			}
			else{
				Els[i].style.display = 'none';
			}
		}
	} 
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display = 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	if (Finished == true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W = 600;
	this.H = 400;
	this.W = document.getElementsByTagName('body')[0].clientWidth;
	this.H = document.getElementsByTagName('body')[0].clientHeight;
}

var pg = null;

function GetPageXY(El) {
	var XY = {x: 0, y: 0};
	while(El){
		XY.x += El.offsetLeft;
		XY.y += El.offsetTop;
		El = El.offsetParent;
	}
	return XY;
}

function GetScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop;
	}
	else{
		if (document.body){
 			return document.body.scrollTop;
		}
		else{
			return window.pageYOffset;
		}
	}
}

function TopSettingWithScrollOffset(TopPercent){
	var T = Math.floor(document.getElementsByTagName('body')[0].clientHeight * (TopPercent/100));
	return GetScrollTop() + T; 
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
var InTextBox = false;

function SuppressBackspace(e){ 
	if (InTextBox == true){return;}
	if (C.ie) {
		thisKey = window.event.keyCode;
	}
	else {
		thisKey = e.keyCode;
	}

	var Suppress = false;

	if (thisKey == 8) {
		Suppress = true;
	}

	if (Suppress == true){
		if (C.ie){
			window.event.returnValue = false;	
			window.event.cancelBubble = true;
		}
		else{
			e.preventDefault();
		}
	}
}

if (C.ie){
	document.attachEvent('onkeydown',SuppressBackspace);
	window.attachEvent('onkeydown',SuppressBackspace);
}
else{
	window.addEventListener('keypress',SuppressBackspace,false);
}

function ReduceItems(InArray, ReduceToSize){
	var ItemToDump=0;
	var j=0;
	while (InArray.length > ReduceToSize){
		ItemToDump = Math.floor(InArray.length*Math.random());
		InArray.splice(ItemToDump, 1);
	}
}

function Shuffle(InArray){
	Temp = new Array();
	var Len = InArray.length;

	var j = Len;

	for (var i=0; i<Len; i++){
		Temp[i] = InArray[i];
	}

	for (i=0; i<Len; i++){
		Num = Math.floor(j  *  Math.random());
		InArray[i] = Temp[Num];

		for (var k=Num; k < j; k++) {
			Temp[k] = Temp[k+1];
		}
		j--;
	}
	return InArray;
}

function WriteToInstructions(Feedback) {
	Feedback = '<span class="FeedbackText">' + Feedback + '</span>';
	document.getElementById('InstructionsDiv').innerHTML = Feedback;

}




function EscapeDoubleQuotes(InString){
	return InString.replace(/"/g, '&quot;')
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		document.getElementsByTagName('button')[0].focus();
	}
}

function TrimString(InString){
        var x = 0;

        if (InString.length != 0) {
                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
                        InString = InString.substring(0, InString.length - 1)
                }

                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
                        InString = InString.substring(1, InString.length)
                }

                while (InString.indexOf('  ') != -1) {
                        x = InString.indexOf('  ')
                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
                 }

                return InString;
        }

        else {
                return '';
        }
}

function FindLongest(InArray){
	if (InArray.length < 1){return -1;}

	var Longest = 0;
	for (var i=1; i<InArray.length; i++){
		if (InArray[i].length > InArray[Longest].length){
			Longest = i;
		}
	}
	return Longest;
}

//UNICODE CHARACTER FUNCTIONS
function IsCombiningDiacritic(CharNum){
	var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
	Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
	return Result;
}

function IsCJK(CharNum){
	return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
}

//SETUP FUNCTIONS
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
function ClearTextBoxes(){
	var NList = document.getElementsByTagName('input');
	for (var i=0; i<NList.length; i++){
		if (NList[i].id.indexOf('Guess') > -1){
			NList[i].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){
		if (document.getElementById('BottomNavBar') != null){
			document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
		}
	}
}




//HOTPOTNET-RELATED CODE

var HPNStartTime = (new Date()).getTime();
var SubmissionTimeout = 30000;
var Detail = ''; //Global that is used to submit tracking data

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store != null){
		Frm = document.store;
		Frm.starttime.value = HPNStartTime;
		Frm.endtime.value = (new Date()).getTime();
		Frm.mark.value = Score;
		Frm.detail.value = Detail;
		Frm.submit();
	}
}



//JQUIZ CORE JAVASCRIPT CODE

var CurrQNum = 0;
var CorrectIndicator = ':-)';
var IncorrectIndicator = 'X';
var YourScoreIs = 'Your score is ';
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';
var ShowCorrectFirstTime = false;
var ShuffleQs = true;
var ShuffleAs = true;
var DefaultRight = 'Correct!';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 10;
var Score = 0;
var Finished = false;
var Qs = null;
var QArray = new Array();
var ShowingAllQuestions = false;
var ShowAllQuestionsCaption = 'Show all questions';
var ShowOneByOneCaption = 'Show questions one by one';
var State = new Array();
var Feedback = '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=0; QNum<I.length; QNum++){
		for (ANum = 0; ANum<I[QNum][3].length; ANum++){
			if (I[QNum][3][ANum][1].length < 1){
				if (I[QNum][3][ANum][2] > 0){
					I[QNum][3][ANum][1] = DefaultRight;
				}
				else{
					I[QNum][3][ANum][1] = DefaultWrong;
				}
			}
		}
	}
}

function SetUpQuestions(){
	var AList = new Array(); 
	var QList = new Array();
	var i, j;
	Qs = document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem = 0;
	while (QsToShow < QList.length){
		DumpItem = Math.floor(QList.length*Math.random());
		for (j=DumpItem; j<(QList.length-1); j++){
			QList[j] = QList[j+1];
		}
		QList.length = QList.length-1;
	}
	if (ShuffleQs == true){
		QList = Shuffle(QList);
	}
	if (ShuffleAs == true){
		var As;
		for (var i=0; i<QList.length; i++){
			As = QList[i].getElementsByTagName('ol')[0];
			if (As != null){
  			AList.length = 0;
				while (As.getElementsByTagName('li').length > 0){
					AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
				}
				AList = Shuffle(AList);
				for (j=0; j<AList.length; j++){
					As.appendChild(AList[j]);
				}
			}
		}
	}
	
	for (i=0; i<QList.length; i++){
		Qs.appendChild(QList[i]);
		QArray[QArray.length] = QList[i];
	}
	
//Now hide all except the first item
	for (i=1; i<QArray.length; i++){
		QArray[i].style.display = 'none';
	}		
	SetQNumReadout();
}

function ChangeQ(ChangeBy){
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
	QArray[CurrQNum].style.display = 'none';
	CurrQNum += ChangeBy;
	QArray[CurrQNum].style.display = '';
	SetQNumReadout();
//if there's a textbox, set the focus in it
	if (document.getElementById('Q_' + CurrQNum + '_Guess') != null){
		document.getElementById('Q_' + CurrQNum + '_Guess').focus();
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
}

I=new Array();
I[0]=new Array();I[0][0]=100;
I[0][1]='';
I[0][2]='0';
I[0][3]=new Array();
I[0][3][0]=new Array('Sea Power','Correct.  While a basic definition, this covers the major considerations when reviewing sea power.',1,100,1);
I[0][3][1]=new Array('Sea Control','Sorry.  While Sea Control comes close to this definition, sea control is only one aspect of the overall term we are looking for.',0,0,1);
I[0][3][2]=new Array('Maritime Freedom','Nope.  While it can be argued that this covers the first part of the definition, it doesn\'t adequately cover the second part.',0,0,1);
I[0][3][3]=new Array('Sea Strategy','Nope.  There is no such term as "Sea Strategy".',0,0,1);
I[0][3][4]=new Array('Global Reach','Sorry.  This is an Air Force term relating to the ability of USAF long-range bombers flown from the U.S. to strike anywhere on the Earth.',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('These are all components of Sea power.','Right.  As framed by a former Chief of Naval Operations, all of these things make up Sea power.',1,100,1);
I[1][3][1]=new Array('Naval Power','Nope.  The state of U.S. Naval Power and capabilities is fundamental to the discussion of our Sea power.',0,0,1);
I[1][3][2]=new Array('Ocean Industry','Sorry.  Ocean Industry, the study of the engineering necessary to harness the natural resources of the sea, is a critical component of overall U.S. Sea power.',0,0,1);
I[1][3][3]=new Array('Ocean Science','Nope.  Without an ongoing and active Ocean Science component, we would quickly fall behind the other developed nations of the world and perhaps lose our edge in Sea power.',0,0,1);
I[1][3][4]=new Array('Ocean Commerce','Sorry.  Ocean commerce, the free flow of goods to and from the U.S., is a key component in our overall Sea power strategy.',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('70','Right!  Never has a nation been so extensively committed to defense treaties in history.',1,100,1);
I[2][3][1]=new Array('10','Nope.  Quite a bit more than ten.',0,0,1);
I[2][3][2]=new Array('28','Nope.  Even more than 28.',0,0,1);
I[2][3][3]=new Array('57','Sorry.  That is a large number, but not large enough.',0,0,1);
I[2][3][4]=new Array('190','Sorry.  That is about how many nations there are in the United Nations.',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('The Antarctic','Right.  While very important from a scientific perspective, it is not considered a strategic ocean area.',1,100,1);
I[3][3][1]=new Array('The Atlantic','Nope.  The Atlantic, which includes the Mediterranean Sea, is of vital importance for our European trade and the protection of our allies.',0,0,1);
I[3][3][2]=new Array('The Pacific','Nope.  The vast Pacific Ocean is critically important given the number of allies, and potential enemies, located within it.',0,0,1);
I[3][3][3]=new Array('The Arctic','Sorry.  The shortest distance between the U.S. and Russia is over the north pole, so the Arctic Ocean remains a vital strategic ocean area.',0,0,1);
I[3][3][4]=new Array('The Afro-Asian','Sorry.  With the vast amount of oil and other resources that travel this ocean area, the Afro-Asian ocean will remain of vital interest to the U.S. for some time to come.',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 Pacific and the Afro-Asian','Right.  This narrow passage sees most of the oil from the Persian Gulf bound for Japan.',1,100,1);
I[4][3][1]=new Array('The Afro-Asian and the Atlantic','Nope.  The Atlantic is completely around the world from these straits.',0,0,1);
I[4][3][2]=new Array('The Pacific and the Arctic','Nope.  These straits are much closer to the equator than the arctic.',0,0,1);
I[4][3][3]=new Array('The Afro-Asian and the Antarctic','Sorry.  The Antarctic Ocean is not an ocean area of strategic importance to the U.S.',0,0,1);
I[4][3][4]=new Array('The Atlantic and the Pacific','Sorry.  The Atlantic is completely around the world from these straits.',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 Strait of Malacca.','Right.  Most of the oil used in Japan comes through this narrow passage from the Persian Gulf.',1,100,1);
I[5][3][1]=new Array('The Strait of Bab al Mandeb','Nope.  That strait separates the Red Sea from the Indian Ocean',0,0,1);
I[5][3][2]=new Array('The Strait of Hormuz','Nope.  That strait separates the Persian Gulf from the Indian Ocean',0,0,1);
I[5][3][3]=new Array('The Turkish Straits','Sorry.  These straits separate the Black Sea and the Mediterranean Sea.',0,0,1);
I[5][3][4]=new Array('The Sunda Straits','Sorry.  These straits are at the southern end of Indonesian Sumatra, but Malaysia is much farther north.',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('The Strait of Malacca ','Right.  This strait is important for the flow of Persian Gulf oil to Japan, not Europe.',1,100,1);
I[6][3][1]=new Array('The Suez Canal','Sorry.  Smaller, shallower draft tankers use the more direct route of the Suez canal to avoid the longer trip around Africa.',0,0,1);
I[6][3][2]=new Array('The Cape of Good Hope','Sorry.  Larger, deeper draft tankers cannot use the Suez Canal and must go around the Cape of Good Hope at the bottom of Africa to deliver their cargo to Europe.',0,0,1);
I[6][3][3]=new Array('All of these are important chokepoint areas for the passage of oil between the Persian Gulf and Europe.','Nope.  There is one that is not used to move oil between these two areas.',0,0,1);
I[6][3][4]=new Array('None of these are important chokepoint areas for the passage of oil between the Persian Gulf and Europe.','Nope.  Think about how oil has to travel by sea from the Persian Gulf to get to Europe and you will see that two of these are very important.',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('Sustainability','Right!  ',1,100,1);
I[7][3][1]=new Array('Geographic mobility','Sorry.  Geographic mobility is the advantage naval forces have because they do not have to follow the flow of terrain like land armies do.',0,0,1);
I[7][3][2]=new Array('Tactical mobility','Nope.  Tactical mobility refers to the ability of naval forces to quickly form or disperse based on the tactical situation.',0,0,1);
I[7][3][3]=new Array('Forward presence','Nope.  The forward presence maintained by our naval forces is dependant on our ability to resupply at sea, but this is not the term for that resupply.',0,0,1);
I[7][3][4]=new Array('Logistic independence','Sorry.  This sounds right, but there is no such thing as complete independence from logistics.',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('80','Right.  Although there was a time when the U.S. was nearly self-sufficient, the global marketplace has caused the U.S. to have to import a large number of minerals and other important materials that can\'t be found within the U.S.',1,100,1);
I[8][3][1]=new Array('200','Nope.  Although it is a lot, it isn\'t that much!',0,0,1);
I[8][3][2]=new Array('53','Nope.  It is quite a bit and you are getting close.',0,0,1);
I[8][3][3]=new Array('67','Sorry.  It is even more than this.',0,0,1);
I[8][3][4]=new Array('28','Sorry.  It is a much larger number.',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('Columbite ','Right.  We currently have to import over 90% of our needs from other countries.',1,100,1);
I[9][3][1]=new Array('Chromite ','Sorry.  While a critical and strategically important mineral we have to import from abroad, chromite is used to harden steel.',0,0,1);
I[9][3][2]=new Array('Bauxite','Sorry.  Bauxite is imported in large quantities, but it is used to refine aluminum.',0,0,1);
I[9][3][3]=new Array('Manganese ','Nope.  We do import quite a bit of this critical metal, but it is used in the production of steel.',0,0,1);
I[9][3][4]=new Array('Tin','Nope.  While we do import the majority of our requirement for tin from abroad, it is not put to these uses. ',0,0,1);
I[10]=new Array();I[10][0]=100;
I[10][1]='';
I[10][2]='0';
I[10][3]=new Array();
I[10][3][0]=new Array('The Geneva Conference on the Seas ','Right.  This and subsequent agreements on littoral nation rights have become increasingly important since then.',1,100,1);
I[10][3][1]=new Array('The Maritime Commerce Treaty','Nope.  No such treaty was enacted in 1958',0,0,1);
I[10][3][2]=new Array('The Law of the Sea Conference','Sorry.  There have been a number of conferences on the Law of the Sea, but this wasn\'t the name of the conference in 1958 that spelled out the rights of littoral nations.',0,0,1);
I[10][3][3]=new Array('The SALT treaties','Nope.  The SALT treaties dealt with the reduction of Strategic Weapons (Strategic Arms Limitation Treaties.)',0,0,1);
I[10][3][4]=new Array('The Seafloor Mining Agreements','Sorry.  There have been no international agreements by this name.',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 people in the Navy','Correct.  No matter how advanced the technology, you need skilled and intelligent people to operate and maintain it.  People will always be the centerpiece of the Navy.',1,100,1);
I[11][3][1]=new Array('The Aircraft Carrier Battle Groups','Sorry.  While these are extremely important in the Navy\'s application of Sea Power, they are not the most critical component.',0,0,1);
I[11][3][2]=new Array('The Amphibious Ready Groups','Sorry.  While these are extremely important in the Navy\'s application of Sea Power, they are not the most critical component.',0,0,1);
I[11][3][3]=new Array('The Navy\'s submarine forces','Nope.  While these are extremely important in the Navy\'s application of Sea Power, they are not the most critical component.',0,0,1);
I[11][3][4]=new Array('The Navy\'s ability to maintain a technological lead in power projection.','Nope.  This is certainly important, but not the most important component of those listed.',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 capability of sea power to reach far inland.','Right.  The other technological development since WWII has been the development of uses for nuclear power.',1,100,1);
I[12][3][1]=new Array('The United States has more commitments with more countries than any other nation in history.','Sorry.  While this is true, it is a political and technological development.',0,0,1);
I[12][3][2]=new Array('All of the other answers are major technological developments which have increased the importance of the oceans.','Nope.  Some of the other answers are political, instead of technological.',0,0,1);
I[12][3][3]=new Array('The creation of the United Nations','Sorry.  The creation and subsequent expansion of membership in the United Nations had been an important development, but a political one vice technological.',0,0,1);
I[12][3][4]=new Array('The rapid increase in the number of new nations.','Nope.  There has been a rapid increase in the number of new nations, but this is not a technological development.',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 Atlantic Ocean','Right.  NATO stands for the North Atlantic Treaty Organization.',1,100,1);
I[13][3][1]=new Array('The Afro-Indian Ocean','Nope.  NATO forces deploy to this area, but it is not their primary concern.',0,0,1);
I[13][3][2]=new Array('The Pacific Ocean','Nope.  This is the area covered by the Southeast Asia Treaty Organization (SEATO)',0,0,1);
I[13][3][3]=new Array('The Arctic Ocean','Sorry.  This is a secondary area of importance to NATO, however.',0,0,1);
I[13][3][4]=new Array('NATO members concern themselves with the defense of Europe and not an ocean area.','Sorry.  The defense of Europe is indeed the goal of NATO, but it has to consider a strategic ocean area to accomplish this mission.',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('Arctic Ocean.    ','Right.  Nuclear Ballistic Missile Submarines operating under the ice in the Arctic Ocean made this ocean strategically important. ',1,100,1);
I[14][3][1]=new Array('Indian Ocean.','Sorry.  The trade and commerce routes within the Indian Ocean made this an important naval operating area long ago.',0,0,1);
I[14][3][2]=new Array('Pacific Ocean','Nope.  The Pacific Ocean has been a naval operating area well before the invention of the nuclear submarine.',0,0,1);
I[14][3][3]=new Array('Atlantic Ocean','Sorry.  The Atlantic Ocean has been a naval operating area well before the invention of the nuclear submarine.',0,0,1);
I[14][3][4]=new Array('Afro-Asian Ocean.','Nope.  Sorry.  The trade and commerce routes within the Afro-Asian Ocean made this an important naval operating area long ago.',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 helicopter','Right.  Helos allow U.S. commanders to land forces well behind enemy lines, cutting off their supply lines and blocking reinforcements.',1,100,1);
I[15][3][1]=new Array('The parachute','Sorry.  While parachutes are used to land troops behind enemy lines, this is not the meaning of "vertical envelopment".',0,0,1);
I[15][3][2]=new Array('The jet aircraft','Nope.  You&#x2019;ve got the "vertical" part right, but not the "envelopment".',0,0,1);
I[15][3][3]=new Array('The observation balloon','Sorry.  The observation balloon was useful for vertical reconnaissance, not vertical envelopment.',0,0,1);
I[15][3][4]=new Array('The V-22 Osprey Aircraft','Nope.  The Osprey will be used by the Marine Corps in vertical envelopment maneuvers, but the tactic was in place long before the Osprey.',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('The Southern Atlantic Ocean','Right.  Currently this is considered a part of the Afro-Asian Ocean.',1,100,1);
I[16][3][1]=new Array('The Mediterranean Sea','Sorry.  The Mediterranean Sea is considered strategically to be a part of the Atlantic Ocean.',0,0,1);
I[16][3][2]=new Array('The North Atlantic Ocean','Nope.  In fact, this is probably the most vital part of the Atlantic Ocean from a Naval perspective since the majority of trade between the U.S. and Europe uses this area. ',0,0,1);
I[16][3][3]=new Array('The Western approaches to Europe','Nope.  The Western approaches to Europe are through the North Atlantic Ocean, and this is a critical area for the movement of good and supplies between Europe and the U.S.',0,0,1);
I[16][3][4]=new Array('The Straits of Gibraltar','Sorry.  The Mediterranean Sea is considered to be a part of the Atlantic Ocean from a tactical perspective, so the passage between the Atlantic and the Mediterranean Sea would also be included.',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('Aquaculture','Right.  Currently only 1 percent of the areas considered usable for aquaculture are being used for this purpose world-wide.',1,100,1);
I[17][3][1]=new Array('Water Farming','Nope.  Sounds right, but there is no such term in common usage.',0,0,1);
I[17][3][2]=new Array('Oceanography','Nope.  Oceanography is the scientific study of the sea for many purposes.  Sea-Farming is just one sub-area.',0,0,1);
I[17][3][3]=new Array('Fish Factory Ships','Sorry.  Factory ships harvest large quantities of fish for commercial sale, and this is not farming.',0,0,1);
I[17][3][4]=new Array('Fish Farming','Sorry.  The proper term has to do with the production of both fish and plant life for use by humans and land-animals.',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('Geopolitical','Right!  The Geopolitical reality of the world is unchanged, but it can be affected by sea power.  Outside of 12 nautical miles, the oceans and seas of the world are free and our naval forces do not require the permission of any country to sail upon them.',1,100,1);
I[18][3][1]=new Array('Geographical','Nope.  Geographical mobility is the concept that you can move by several routes on the oceans.  On land you have to deal with the ups and downs and curves of the landmass.',0,0,1);
I[18][3][2]=new Array('Sustainability','Sorry.  Sustainability has to do with the fact that it is easier to keep forces resupplied at sea than on land in many cases.',0,0,1);
I[18][3][3]=new Array('Tactical','Sorry.  Tactical mobility is the concept that it is far easier to disperse forces and then regroup at sea than on land.',0,0,1);
I[18][3][4]=new Array('These are all motilities we gain from control of the oceans.','Nope.  There is one that is not one of the three motilities.',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 Cape of Good Hope','Correct.  Though this body of water a large amount of oil from the Persian Gulf moves to markets in Europe.',1,100,1);
I[19][3][1]=new Array('The Turkish Straits','Nope.  These straits separate the Black and Mediterranean Seas.',0,0,1);
I[19][3][2]=new Array('The Strait of Malacca','Nope.  This is an important chokepoint in Southeast Asia for the flow of oil from the Persian Gulf to Japan.',0,0,1);
I[19][3][3]=new Array('The Suez Canal','Sorry.  The Suez Canal separates the Mediterranean and Red Seas.',0,0,1);
I[19][3][4]=new Array('The Strait of Gibraltar','Sorry.  The Strait of Gibraltar separates the Mediterranean Sea and the Atlantic Ocean.',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('Littoral','Right.  Littoral  nations have rights guaranteed by international law to the mineral and other resources that lie on their continental shelves.',1,100,1);
I[20][3][1]=new Array('Seacoast','Nope.  These nations have seacoasts, but that is not what they are called.',0,0,1);
I[20][3][2]=new Array('Oceanographic','Nope.  Many nations which do not border the ocean have oceanographic studies.',0,0,1);
I[20][3][3]=new Array('Aquacultural','Sorry.  Not all nations which border the ocean engage in aquaculture.',0,0,1);
I[20][3][4]=new Array('Sea Power','Sorry.  The term Sea Power deals with control of the seas, not to a nation\'s location on the sea.',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('Inland reach.','Right.  U.S. Navy ships and submarines have the capability to project power to any point in the world through the use of these missiles.',1,100,1);
I[21][3][1]=new Array('Vertical envelopment','Nope.  Vertical envelopment deals with the ability to transport U.S. forces behind enemy lines to cut off their resupply and reinforcement.',0,0,1);
I[21][3][2]=new Array('Nuclear power','Sorry.  While nuclear power is certainly involved in this, this is not the concept\'s name.',0,0,1);
I[21][3][3]=new Array('Oceanographic research','Nope.  The development of long-range ballistic missiles is not directly related to oceanographic research.',0,0,1);
I[21][3][4]=new Array('Sustainability','Sorry.  Sustainability deals with the ability of our Naval forces to stay on station and have the supplies they need delivered to them there.',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('The rapid increase in the number of new nations.','Right.  With more nations in the world, the diplomacy surrounding the legal use of the oceans has been greatly complicated.',1,100,1);
I[22][3][1]=new Array('The capability of sea power to reach far inland.','Sorry.  This is certainly a major area of development since World War II, but it is technological and not political.',0,0,1);
I[22][3][2]=new Array('The capability of sea power to reach far inland.','Nope.  Some are technological and not political.',0,0,1);
I[22][3][3]=new Array('The creation of the United Nations','Sorry.  You\'re close, but the creation of the UN was not the major development, the expansion of it was.',0,0,1);
I[22][3][4]=new Array('Nuclear weapons and nuclear powered ships and submarines.','Nope.  While there is no doubt that these are important developments that have taken place since WWII, they are technological developments and not political ones.',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('Magnesium','Right.  Some types of chemical fertilizers can be extracted commercially as well.',1,100,1);
I[23][3][1]=new Array('Bauxite ','Nope.  The U.S. currently has to import approximately 85% of its supply of the critical mineral.',0,0,1);
I[23][3][2]=new Array('Tin','Nope.  The U.S. currently has to import approximately 99% of its supply of the critical mineral.',0,0,1);
I[23][3][3]=new Array('Columbite ','Sorry.  The U.S. currently has to import approximately 90% of its supply of the critical mineral.',0,0,1);
I[23][3][4]=new Array('Aluminum ','Sorry.  Aluminum cannot be extracted from seawater.',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('All of the listed countries have tidal energy systems.','Correct.  These are the three primary nations that have developed this technology to date.  Expect many others to do the same over the next several years.',1,100,1);
I[24][3][1]=new Array('Canada','Sorry.  Canada does have tidal energy plants.',0,0,1);
I[24][3][2]=new Array('France','Nope.  France has the largest tidal energy plant in the world.',0,0,1);
I[24][3][3]=new Array('None of the listed countries have developed tidal energy plants.','Sorry.  Tidal plants are found in one or more of the countries listed.',0,0,1);
I[24][3][4]=new Array('Holland','Nope.  The oldest forms of harnessing tidal energy were developed in Holland.',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('One Percent','Right.  Around 20 species out of the over 20,000 available.',1,100,1);
I[25][3][1]=new Array('Ten Percent','Nope.  With over 20,000 species available, that would mean that over 2,000 are currently commercially harvested.  Does that number seem high or low?',0,0,1);
I[25][3][2]=new Array('Twenty Five Percent','Sorry.  With over 20,000 species available, that would mean that over 5,000 are currently commercially harvested.  Does that number seem high or low?',0,0,1);
I[25][3][3]=new Array('Fifty Percent','With over 20,000 species available, that would mean that over 10,000 are currently commercially harvested.  Does that number seem high or low?',0,0,1);
I[25][3][4]=new Array('Three Percent','With over 20,000 species available, that would mean that over 60 are currently commercially harvested.  Does that number seem high or low?',0,0,1);


function StartUp(){
	RemoveBottomNavBarForIE();
	

	

	
	CompleteEmptyFeedback();

	SetUpQuestions();
	ClearTextBoxes();
	CreateStatusArray();
	

	
}

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
		}
	}
}



function CheckMCAnswer(QNum, ANum, Btn){
//bail if question doesn't exist or exercise finished
	if ((State[QNum].length < 1)||(Finished == true)){return;}
	
//Get the feedback
	Feedback = I[QNum][3][ANum][1];
	
//Now show feedback and bail if question already complete
	if (State[QNum][0] > -1){
		ShowMessage(Feedback);
		return;
	}
	
//Hide the button while processing
	Btn.style.display = 'none';

//Increment the number of tries
	State[QNum][2]++;
	
//Add the percent-correct value of this answer
	State[QNum][3] += I[QNum][3][ANum][3];
	
//Store the try number in the answer part of the State array, for tracking purposes
	State[QNum][1][ANum] = State[QNum][2];
	State[QNum][5] += String.fromCharCode(65+ANum) + ',';
	
//Should this answer be accepted as correct?
	if (I[QNum][3][ANum][2] < 1){
//It's wrong

//Mark the answer
		Btn.innerHTML = IncorrectIndicator;
		
//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();
			Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
			WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
		}
	}
	else{
//It's right
//Mark the answer
		Btn.innerHTML = CorrectIndicator;
				
//Calculate the score for this question
		CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
		if (ContinuousScoring == true){
			CalculateOverallScore();
			Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
			WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
		}
	}
	
//Show the button again
	Btn.style.display = 'inline';
	
//Finally, show the feedback	
	ShowMessage(Feedback);
	
//Check whether all questions are now done
	CheckFinished();
}

function CalculateMCQuestionScore(QNum){
	var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties
	var PercentCorrect = State[QNum][3];
	var TotAns = GetTotalMCAnswers(QNum);
	var HintPenalties = State[QNum][4];
	
//Make sure it's not already complete

	if (State[QNum][0] < 0){
//Allow for Hybrids
		if (HintPenalties >= 1){
			State[QNum][0] = 0;
		}
		else{
			State[QNum][0] = ((TotAns-(Tries-1))/TotAns)*(PercentCorrect/(100*Tries));
		}
		if (State[QNum][0] < 0){
			State[QNum][0] = 0;
		}
	}
}

function GetTotalMCAnswers(QNum){
	var Result = 0;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			Result++;
		}
	}
	return Result;
}

function FinalAnswer(QNum){
	var UnchosenAnswers = 0;
	var FinalAnswer = -1;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			if (State[QNum][1][ANum] < 1){ //This answer hasn't been chosen yet
				UnchosenAnswers++;
				FinalAnswer = ANum;
			}
		}
	}
	if (UnchosenAnswers == 1){
		return FinalAnswer;
	}
	else{
		return -1;
	}
}





function CalculateOverallScore(){
	var TotalWeighting = 0;
	var TotalScore = 0;
	
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] > -1){
				TotalWeighting += I[QNum][0];
				TotalScore += (I[QNum][0] * State[QNum][0]);
			}
		}
	}
	Score = Math.floor((TotalScore/TotalWeighting)*100);
}

function CheckFinished(){
	var FB = '';

	var AllDone = true;
	for (var QNum=0; QNum<State.length; QNum++){
		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][0] >= 1){
					CFT++;
				}
			}
			FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + State.length;
		}
		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][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);
	}
}










//-->

//]]>



