

//<![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');

//Focus the OK button
	setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
	
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
	if (C.ie){
		var Els = document.getElementsByTagName(TagName);
		for (var i=0; i<Els.length; i++){
			if (Show == true){
				Els[i].style.display = 'inline';
			}
			else{
				Els[i].style.display = 'none';
			}
		}
	} 
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display = 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	ShowElements(true, 'object');
	if (Finished == true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W = 600;
	this.H = 400;
	this.W = document.getElementsByTagName('body')[0].clientWidth;
	this.H = document.getElementsByTagName('body')[0].clientHeight;
}

var pg = null;

function GetPageXY(El) {
	var XY = {x: 0, y: 0};
	while(El){
		XY.x += El.offsetLeft;
		XY.y += El.offsetTop;
		El = El.offsetParent;
	}
	return XY;
}

function GetScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop;
	}
	else{
		if (document.body){
 			return document.body.scrollTop;
		}
		else{
			return window.pageYOffset;
		}
	}
}

function GetViewportHeight(){
	if (window.innerHeight){
		return window.innerHeight;
	}
	else{
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function TopSettingWithScrollOffset(TopPercent){
	var T = Math.floor(GetViewportHeight() * (TopPercent/100));
	return GetScrollTop() + T; 
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
var InTextBox = false;

function SuppressBackspace(e){ 
	if (InTextBox == true){return;}
	if (C.ie) {
		thisKey = window.event.keyCode;
	}
	else {
		thisKey = e.keyCode;
	}

	var Suppress = false;

	if (thisKey == 8) {
		Suppress = true;
	}

	if (Suppress == true){
		if (C.ie){
			window.event.returnValue = false;	
			window.event.cancelBubble = true;
		}
		else{
			e.preventDefault();
		}
	}
}

if (C.ie){
	document.attachEvent('onkeydown',SuppressBackspace);
	window.attachEvent('onkeydown',SuppressBackspace);
}
else{
	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 ';
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';
var ShowCorrectFirstTime = true;
var ShuffleQs = true;
var ShuffleAs = true;
var DefaultRight = 'Correct!';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 10;
var Score = 0;
var Finished = false;
var Qs = null;
var QArray = new Array();
var ShowingAllQuestions = false;
var ShowAllQuestionsCaption = 'Show all questions';
var ShowOneByOneCaption = 'Show questions one by one';
var State = new Array();
var Feedback = '';
var TimeOver = false;
var strInstructions = '';

//The following variable can be used to add a message explaining that
//the question is finished, so no further marking will take place.
var strQuestionFinished = '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=0; QNum<I.length; QNum++){
//Only do this if not multi-select
		if (I[QNum][2] != '3'){
  		for (ANum = 0; ANum<I[QNum][3].length; ANum++){
  			if (I[QNum][3][ANum][1].length < 1){
  				if (I[QNum][3][ANum][2] > 0){
  					I[QNum][3][ANum][1] = DefaultRight;
  				}
  				else{
  					I[QNum][3][ANum][1] = DefaultWrong;
  				}
  			}
  		}
		}
	}
}

function SetUpQuestions(){
	var AList = new Array(); 
	var QList = new Array();
	var i, j;
	Qs = document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem = 0;
	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){
			var Children = QArray[CurrQNum].childNodes;
			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';
		}
	}
}

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('Grand Strategy','Right!  It has been called the most important and least understood aspect of national defense.',1,100,1);
I[0][3][1]=new Array('Grand Preparedness','Sorry.  There is no such term as Grand Preparedness',0,0,1);
I[0][3][2]=new Array('Continental Strategy','Nope.  Continental School Strategy, first proposed by British geographer Sir Halford J. MacKinder, emphasizes the strategic importance of geographic landmasses.',0,0,1);
I[0][3][3]=new Array('Maritime Strategy','Nope.  Maritime School Strategy, first proposed by American naval strategist Alfred Thayer Mahan, advocates a large navy, overseas bases, and national greatness through sea power.',0,0,1);
I[0][3][4]=new Array('Aerospace Strategy','Sorry.  Aerospace School Strategy, championed by USAF Major Alexander de Seversky, believes that total air supremacy is possible and is the key to success in all future warfare.',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('Manpower','Right!  Since there were no weapons of mass destruction, greater manpower was a decisive factor in most engagements.',1,100,1);
I[1][3][1]=new Array('Intelligence','Sorry.  Intelligence has always been an important factor, but there is one that was even more important.',0,0,1);
I[1][3][2]=new Array('Training','Sorry.  Training is, of course, important but during this timeframe all militaries trained in similar ways.  There was a much more important factor.',0,0,1);
I[1][3][3]=new Array('Length of their swords','Nope.  The length or capability of any one weapon or weapon system did not make the greatest impact.',0,0,1);
I[1][3][4]=new Array('Weapons','Nope.  Although minor innovations in weapons did have a short-lived and limited affect on particular campaigns or battles, overall this was not the most important factor in military operations at this time.',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('Sun Tzu','Correct.  Written between 400 and 300 B.C., this book is still as relevant to military thought and action today as it was then.',1,100,1);
I[2][3][1]=new Array('Alexander the Great','Sorry.  While perhaps the greatest general of all time, Alexander did not author this work.',0,0,1);
I[2][3][2]=new Array('Scipio Africanus','Nope.  A great general of Rome during the period of the Punic Wars with Carthage, Scipio Africanus did not write this book.',0,0,1);
I[2][3][3]=new Array('Niccolo Machiavelli','Nope.  Machiavelli wrote the book "<i>The Prince</i>	", which deals with sources, applications and limits of power.',0,0,1);
I[2][3][4]=new Array('Karl von Clausewitz','Sorry.  Clausewitz\'s book, <i>On War</i>	, deals with much of the same subject area but it was written much later.',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('Alexander the Great','Correct.  Never known to have lost a battle, Alexander is considered by many to have been the greatest general of all time.',1,100,1);
I[3][3][1]=new Array('Scipio Africanus','Sorry.  While a great Roman general and statesman, Scipio Africanus was not the first Western grand strategist.',0,0,1);
I[3][3][2]=new Array('Hannibal','Nope.  A great Carthaginian general during the Punic Wars with Rome, Hannibal was not the first great Western grand strategist.',0,0,1);
I[3][3][3]=new Array('Julius Caesar','Sorry.  While a great general and statesman for Rome, Julius Caesar was not the first great Western grand strategist.',0,0,1);
I[3][3][4]=new Array('Frederick the Great','Nope.  Undoubtedly, Frederick the Great was one of the greatest grand strategists, but not the first.',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('<i>On War</i>	 by Karl von Clausewitz','Right!  Clausewitz showed that war "...is not merely a political act, but also a real political instrument, a continuation of policy carried out by other means."',1,100,1);
I[4][3][1]=new Array('<i>The Art of War</i>	 by Sun Tzu','Sorry.  While an important and influential discussion of strategy & tactics, this work was written much earlier.',0,0,1);
I[4][3][2]=new Array('<i>The Prince</i>	 by Niccolo Machiavelli','Nope.  Machiavelli\'s work deals more with political maneuvering and intrigue than strategy.',0,0,1);
I[4][3][3]=new Array('<i>The Art of War</i>	 by Antoine Jomini','Sorry.  While Jomini did publish an influential work by this name in 1862, it is not considered the most influential dissertation on strategy.',0,0,1);
I[4][3][4]=new Array('<i>History of the Art of War within the framework of political history</i>	  by Hans Delbr\u00FCck','Nope.  Delbr\u00FCck authored this work in the early part of the 20th century.  He was an important theorist on military strategy, but not the most influential.',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('These are all schools of strategic thought.','Right.',1,100,1);
I[5][3][1]=new Array('None of these represents one of the three classic schools of strategic thought.','Nope.  In fact, each of the three listed is one of the classic schools of strategic thought.',0,0,1);
I[5][3][2]=new Array('Maritime','Sorry.  The Maritime School of strategic thought stresses the significance of commerce in war and of economic warfare through the application of sea power.',0,0,1);
I[5][3][3]=new Array('Continental','Sorry.  The Continental School of strategic thought stresses the strategic importance of geographic landmasses',0,0,1);
I[5][3][4]=new Array('Aerospace','Nope.  The Aerospace School of strategic thought believes that absolute air supremacy is possible and essential to world domination.',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('Maritime Strategy','Right.  Mahan, a former president of the Naval War College, first set out this theory in his book, "<i>The Influence of Sea Power upon History, 1660-1783</i>	".',1,100,1);
I[6][3][1]=new Array('Continental Strategy','Sorry.  Mahan was not a believer in Continental Strategy, which believes in the strategic importance of geographic landmasses',0,0,1);
I[6][3][2]=new Array('Aerospace Strategy','Sorry.  The Aerospace Strategy School of strategic thought came well after Mahan\'s time.',0,0,1);
I[6][3][3]=new Array('Undersea Warfare Strategy','Nope.  There is no such school of strategic thought.',0,0,1);
I[6][3][4]=new Array('Political Strategy','Nope.  Political strategy, while a part of an overall national grand strategy, was not the primary interest of Mahan.',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('Continental Strategy','Correct.  In his work, "<i>Democratic Ideals and Reality</i>	", MacKinder put forward the theory that a nation that controlled the Asiatic Russia and Eastern Europe was in the best position to dominate the rest of the world.',1,100,1);
I[7][3][1]=new Array('Aerospace Strategy','Sorry.  The Aerospace Strategy School of strategic thought came well after MacKinder\'s work was published.',0,0,1);
I[7][3][2]=new Array('Maritime Strategy','Sorry.  Maritime Strategy, which supports the theory that sea power and sea control are the essential elements to control of world trade, was put forward 30 years ahead of MacKinder\'s theories.',0,0,1);
I[7][3][3]=new Array('Political Strategy','Nope.  Political strategy, while a part of an overall national grand strategy, was not the primary interest of MacKinder.',0,0,1);
I[7][3][4]=new Array('Undersea Warfare Strategy','Nope.  There is no such school of strategic thought.',0,0,1);
I[8]=new Array();I[8][0]=100;
I[8][1]='';
I[8][2]='0';
I[8][3]=new Array();
I[8][3][0]=new Array('The United States','Correct.  Areas outside of the "World Island" of Asia, Africa and Europe were labeled as part of the "Outer" or Insular Crescent" in MacKinder\'s theories.',1,100,1);
I[8][3][1]=new Array('Italy','Sorry.  Italy, located within Europe, would be a part of the "Inner" or "Marginal Crescent"',0,0,1);
I[8][3][2]=new Array('Russia','Sorry.  Russia, located within Asia, would be a part of the "Inner" or "Marginal Crescent"',0,0,1);
I[8][3][3]=new Array('Egypt','Nope.  Egypt, located within Africa, would be a part of the "Inner" or "Marginal Crescent"',0,0,1);
I[8][3][4]=new Array('Germany','Nope.  Germany, located within Europe, would be a part of the "Inner" or "Marginal Crescent"',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('Aerospace Strategy','Right.  The shortest flying distance between Eastern and Western nations is over the North Pole and the Arctic Ocean.',1,100,1);
I[9][3][1]=new Array('Continental Strategy','Nope.  The Continental Strategy see all important conflicts occurring within the "World Island" of Africa, Asia and Europe.',0,0,1);
I[9][3][2]=new Array('Maritime Strategy','Nope.  While current Maritime Strategy places a high importance in the Arctic Ocean, this area would not be the primary area of East-West confrontation.',0,0,1);
I[9][3][3]=new Array('Political Strategy','Sorry.  Political Strategy is not one of the classic schools of grand strategy.',0,0,1);
I[9][3][4]=new Array('Undersea Warfare Strategy','Sorry.  There is no such school of grand strategy.',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('World War I','Correct!  The evolution of modern warfare occurred during this war, which saw the first rapid and devastating use of emerging technology in warfare.',1,100,1);
I[10][3][1]=new Array('The Spanish-American War','Sorry.  While this conflict was one of the earliest of the twentieth century, it was fought between two individual countries, not coalitions.',0,0,1);
I[10][3][2]=new Array('The Sino-Russian War','Nope.  While this conflict was one of the earliest of the twentieth century, it was fought between two individual countries, not coalitions.',0,0,1);
I[10][3][3]=new Array('World War II','Nope.  This was a great coalition war in the twentieth century, but not the first one.',0,0,1);
I[10][3][4]=new Array('The Korean War','Sorry.  While the first coalition war fought by the United Nations in the twentieth century, it was not the first coalition war of the century.',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('Casablanca','Correct.  This important strategic conference in the early days of the war was attended by President Roosevelt and Prime Minister Churchill.',1,100,1);
I[11][3][1]=new Array('Moscow','Nope.  The name alone should tell you that the Soviets were there.  Moscow is, after all, their capital city.',0,0,1);
I[11][3][2]=new Array('Yalta','Nope.  Yalta, located in the Crimea, was a part of the Soviet Union.',0,0,1);
I[11][3][3]=new Array('Teheran','Sorry.  The conference held in Teheran, the capital city of Iran, was attended by Joseph Stalin, the leader of the Soviet Union.',0,0,1);
I[11][3][4]=new Array('Potsdam','Sorry.  Potsdam, located within Germany, was the site of one of the last of the great conferences of World War II and was attended by Joseph Stalin, the leader of the Soviet Union.',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('Preparedness','Right.  It isn\'t enough to have a well thought-out grand strategy.  You must be prepared and have the tools available to carry it out.',1,100,1);
I[12][3][1]=new Array('Responsiveness','Sorry.  The ability to rapidly respond to any crisis is important to grand strategy, but it doesn\'t describe the concept of readiness to implement grand strategy.',0,0,1);
I[12][3][2]=new Array('Democracy','Sorry.  Democracy is a form of government and different democracies will have different grand strategies and methods to use in carrying them out.',0,0,1);
I[12][3][3]=new Array('Heartland','Nope.  The concept of the Heartland comes from the Continental School of grand strategy and refers to central Asia and Eastern Europe.',0,0,1);
I[12][3][4]=new Array('Political center','Nope.  This is not a term which was covered in the reading or lectures and refers to the fundamental beliefs of a political party or ruling power.',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 knew that Japan would soon be defeated and they wanted to take part in the "spoils of war."','Correct.  Invading Manchuria and North Korea set the stage for Soviet backing of communist takeovers in China and North Korea after the war.',1,100,1);
I[13][3][1]=new Array('They felt a moral obligation to enter the war after Germany was defeated.','Sorry.  While Soviet "apologists" like to put forward this explanation, the Soviets could have easily have entered into the war against Japan earlier and only choose to enter once they knew the war would quickly end.',0,0,1);
I[13][3][2]=new Array('The Soviets never did enter the war against Japan.','Sorry.  While their participation in the war was late and limited, they did indeed enter into military conflict with Japan.',0,0,1);
I[13][3][3]=new Array('There was no valid strategic reason for the Soviets to enter the war against Japan.','Nope.  Their late entry into this part of World War II ensured that they would have a place at the peace talks and obtain their part of Japanese territory.',0,0,1);
I[13][3][4]=new Array('They wanted to free up American and British forces for use in the war against Germany.','Nope.  The war against Germany was already over by the time the Soviet Union entered into conflict against Japan.',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('Billy Mitchell','Correct.  His early theories of the impact of aircraft on warfare caused much controversy but were subsequently proven correct in World War II.',1,100,1);
I[14][3][1]=new Array('Giulio Douhet','Sorry.  Douhet, an Italian general, laid down the earliest theories of air warfare in his book "<i>Command of the Air</i>	" in 1921.',0,0,1);
I[14][3][2]=new Array('Erich Ludendorff','Sorry.  Ludendorff, a German strategist, developed the concept of total mobilization of a nation\'s manpower and resources under the command of a supreme military commander.',0,0,1);
I[14][3][3]=new Array('Alexander de Seversky','Nope.  Major de Seversky was the USAF strategist who first proposed the concepts and principals of the Aerospace School of classical grand strategy.',0,0,1);
I[14][3][4]=new Array('Jimmy Doolittle','Nope.  Col. Doolittle was a early pioneer of air warfare and the commander of bomber force that raided Tokyo early in World War II, but he was not the Army Air Corps General who first proved the ability of aircraft to inflict damage on naval ships.',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 Continental School','Right.  The Soviet Union represented the land power trying to control the "World Island" of Europe, Asia and Africa.  The United States and the NATO allies were the nations opposed to this and used their maritime power to prevent it.',1,100,1);
I[15][3][1]=new Array('The Maritime School','Sorry.  While the Soviet Union paid a great deal of attention to their navy and maritime strategy late in the Cold War years, the Maritime school strategy wasn\'t the primary one followed during the Cold War years.',0,0,1);
I[15][3][2]=new Array('The Aerospace School','Sorry.  The Soviets and the U.S. paid a lot of attention to air power, but the Aerospace School of strategy was not the one that held sway during this conflict.',0,0,1);
I[15][3][3]=new Array('The Undersea Warfare School.','Nope.  There is no such classic school of grand strategy.',0,0,1);
I[15][3][4]=new Array('The Political School','Nope.  There is no such classic school of grand strategy.',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('Maritime Strategy','Correct!  Roosevelt, a former Secretary of the Navy, knew the truth and importance of Mahan\'s theories.',1,100,1);
I[16][3][1]=new Array('Continental Strategy','Nope.  Continental strategy focused on control of Central Asia and Eastern Europe, neither of which the United States could control.',0,0,1);
I[16][3][2]=new Array('Aerospace Strategy','Nope.  Air power was in its infancy at this time and the grand strategy of Air Power had not been developed.',0,0,1);
I[16][3][3]=new Array('Undersea Warfare Strategy','Sorry.  There is no such school of grand strategy.',0,0,1);
I[16][3][4]=new Array('Political Strategy','Sorry.  There is no such school of grand strategy.',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('Antoine Jomini','Right!  This French strategist began a systematic study of the subject of war, particularly the maneuvering of troops to occupy territory.',1,100,1);
I[17][3][1]=new Array('Karl von Clausewitz','Sorry.  While Clausewitz\'s works were known to U.S. and Confederate generals of the time, they were not the ones most closely followed.',0,0,1);
I[17][3][2]=new Array('Hans Delbr\u00FCck','Sorry.  Delbr\u00FCck was an important theorist on military strategy, but his works were published after the Civil War, not before it.',0,0,1);
I[17][3][3]=new Array('Karl Marx','Nope.  Marx\'s "<i>Das Kapital</i>	" is the basis for the modern Communist movement.',0,0,1);
I[17][3][4]=new Array('Alfred Thayer Mahan','Nope.  Mahan\'s writings were the foundation of the Maritime School of grand strategy and occurred after the Civil War.',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('Napoleon Bonaparte','Correct.  There was much interest in the mid-19th century in studies related to Napoleon\'s successes and failures in his various campaigns.',1,100,1);
I[18][3][1]=new Array('Alexander the Great','Nope.  The lack of numerous independent historical accounts of Alexander\'s campaign make them hard to study.',0,0,1);
I[18][3][2]=new Array('Adolph Hitler','Nope.  While Hitler\'s politics and political maneuvering prior to World War II are of interest to scholars, his military strategies are inferior overall and get little attention.',0,0,1);
I[18][3][3]=new Array('Julius Caesar','Sorry.  While the campaigns of Julius Caesar are the subject of much study even today, they weren\'t the ones that created the schools of strategic thought we have today.',0,0,1);
I[18][3][4]=new Array('Fredrick the Great','Sorry.  While intensively studied today for his political skill as much as for his military genius, the campaigns of Fredrick the Great were not the material out of which came the current theories of grand strategy.',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 Industrial Revolution','Right.  Advanced propulsion systems, communications, and means to project power overseas are just some of the major areas where industrial revolution inventions impacted global strategies.',1,100,1);
I[19][3][1]=new Array('The era of Ancient Strategies','Nope.  There were very few inventions and innovations during this period and basic strategy remained the same for thousands of years.',0,0,1);
I[19][3][2]=new Array('The era of Flight','Nope.  While the development of the airplane and its transition to use in war is significant, it was only one aspect of a larger technological revolution.',0,0,1);
I[19][3][3]=new Array('The Computer Revolution','Sorry.  While the rapidly growing use of computers in both weapon systems and the design of new systems is radically changing the face of modern warfare and strategy, it was not the first such revolution nor the one that first allowed warfare on a global scale.',0,0,1);
I[19][3][4]=new Array('The Bronze Age','Sorry.  While the discovery of the means to produce bronze tools and weapons was a significant step in the evolution of mankind and warfare, it didn\'t allow for warfare on a global scale.',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);
		return;
	}
	
//Hide the button while processing
	Btn.style.display = 'none';

//Increment the number of tries
	State[QNum][2]++;
	
//Add the percent-correct value of this answer
	State[QNum][3] += I[QNum][3][ANum][3];
	
//Store the try number in the answer part of the State array, for tracking purposes
	State[QNum][1][ANum] = State[QNum][2];
	State[QNum][5] += String.fromCharCode(65+ANum) + ',';
	
//Should this answer be accepted as correct?
	if (I[QNum][3][ANum][2] < 1){
//It's wrong

//Mark the answer
		Btn.innerHTML = IncorrectIndicator;
		
//Remove any previous score unless exercise is finished (6.0.3.8+)
		if (Finished == false){
			WriteToInstructions(strInstructions);
		}	
		
//Check whether this leaves just one MC answer unselected, in which case the Q is terminated
		var RemainingAnswer = FinalAnswer(QNum);
		if (RemainingAnswer > -1){
//Behave as if the last answer had been selected, but give no credit for it
//Increment the number of tries
			State[QNum][2]++;		
		
//Calculate the score for this question
			CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	else{
//It's right
//Mark the answer
		Btn.innerHTML = CorrectIndicator;
				
//Calculate the score for this question
		CalculateMCQuestionScore(QNum);

//Get the overall score and add it to the feedback
		if (ContinuousScoring == true){
			CalculateOverallScore();
			if ((ContinuousScoring == true)||(Finished == true)){
				Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
		}
	}
	
//Show the button again
	Btn.style.display = 'inline';
	
//Finally, show the feedback	
	ShowMessage(Feedback);
	
//Check whether all questions are now done
	CheckFinished();
}

function CalculateMCQuestionScore(QNum){
	var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties
	var PercentCorrect = State[QNum][3];
	var TotAns = GetTotalMCAnswers(QNum);
	var HintPenalties = State[QNum][4];
	
//Make sure it's not already complete

	if (State[QNum][0] < 0){
//Allow for Hybrids
		if (HintPenalties >= 1){
			State[QNum][0] = 0;
		}
		else{
//This line calculates the score for this question
			if (TotAns == 1){
				State[QNum][0] = 1;
			}
			else{
				State[QNum][0] = ((TotAns-((Tries*100)/State[QNum][3]))/(TotAns-1));
			}
		}
//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; 
	}
}

function CheckFinished(){
	var FB = '';
	var AllDone = true;
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] < 0){
				AllDone = false;
			}
		}
	}
	if (AllDone == true){
	
//Report final score and submit if necessary
		CalculateOverallScore();
		FB = YourScoreIs + ' ' + Score + '%.';
		if (ShowCorrectFirstTime == true){
			var CFT = 0;
			for (QNum=0; QNum<State.length; QNum++){
				if (State[QNum] != null){
					if (State[QNum][0] >= 1){
						CFT++;
					}
				}
			}
			FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + QsToShow;
		}
		WriteToInstructions(FB);
		
		Finished == true;

		TimeOver = true;
		Locked = true;
		


		Finished = true;
		Detail = '<?xml version="1.0"?><hpnetresult><fields>';
		for (QNum=0; QNum<State.length; QNum++){
			if (State[QNum] != null){
				if (State[QNum][5].length > 0){
					Detail += '<field><fieldname>Question #' + (QNum+1) + '</fieldname><fieldtype>question-tracking</fieldtype><fieldlabel>Q ' + (QNum+1) + '</fieldlabel><fieldlabelid>QuestionTrackingField</fieldlabelid><fielddata>' + State[QNum][5] + '</fielddata></field>';
				}
			}
		}
		Detail += '</fields></hpnetresult>';
		setTimeout('Finish()', SubmissionTimeout);
	}
}










//-->

//]]>


