

//<![CDATA[

<!--


function Client(){
//if not a DOM browser, hopeless
	this.min = false; if (document.getElementById){this.min = true;};

	this.ua = navigator.userAgent;
	this.name = navigator.appName;
	this.ver = navigator.appVersion;  

//Get data about the browser
	this.mac = (this.ver.indexOf('Mac') != -1);
	this.win = (this.ver.indexOf('Windows') != -1);

//Look for Gecko
	this.gecko = (this.ua.indexOf('Gecko') > 1);
	if (this.gecko){
		this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
		if (this.geckoVer < 20020000){this.min = false;}
	}
	
//Look for Firebird
	this.firebird = (this.ua.indexOf('Firebird') > 1);
	
//Look for Safari
	this.safari = (this.ua.indexOf('Safari') > 1);
	if (this.safari){
		this.gecko = false;
	}
	
//Look for IE
	this.ie = (this.ua.indexOf('MSIE') > 0);
	if (this.ie){
		this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
		if (this.ieVer < 5.5){this.min = false;}
	}
	
//Look for Opera
	this.opera = (this.ua.indexOf('Opera') > 0);
	if (this.opera){
		this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
		if (this.operaVer < 7.04){this.min = false;}
	}
	if (this.min == false){
		alert('Your browser may not be able to handle this page.');
	}
	
//Special case for the horrible ie5mac
	this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
}

var C = new Client();

//for (prop in C){
//	alert(prop + ': ' + C[prop]);
//}



//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS

//[strNavBarJS]
function NavBtnOver(Btn){
	if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
}

function NavBtnOut(Btn){
	Btn.className = 'NavButton';
}

function NavBtnDown(Btn){
	Btn.className = 'NavButtonDown';
}
//[/strNavBarJS]

function FuncBtnOver(Btn){
	if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
}

function FuncBtnOut(Btn){
	Btn.className = 'FuncButton';
}

function FuncBtnDown(Btn){
	Btn.className = 'FuncButtonDown';
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') != null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		if (document.getElementById('CheckButton2') != null){
			document.getElementById('CheckButton2').focus();
		}
		else{
			document.getElementsByTagName('button')[0].focus();
		}
	}
}




//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX

var topZ = 1000;

function ShowMessage(Feedback){
	var Output = Feedback + '<br /><br />';
	document.getElementById('FeedbackContent').innerHTML = Output;
	var FDiv = document.getElementById('FeedbackDiv');
	topZ++;
	FDiv.style.zIndex = topZ;
	FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
//IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
	if (C.gecko){
		document.getElementById('FeedbackOKButton').focus();
	}
	FDiv.style.display = 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');
	ShowElements(false, 'object');
	if (C.ie){
		document.getElementById('FeedbackOKButton').focus();
	}
	
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
	if (C.ie){
		var Els = document.getElementsByTagName(TagName);
		for (var i=0; i<Els.length; i++){
			if (Show == true){
				Els[i].style.display = 'inline';
			}
			else{
				Els[i].style.display = 'none';
			}
		}
	} 
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display = 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	ShowElements(true, 'object');
	if (Finished == true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W = 600;
	this.H = 400;
	this.W = document.getElementsByTagName('body')[0].clientWidth;
	this.H = document.getElementsByTagName('body')[0].clientHeight;
}

var pg = null;

function GetPageXY(El) {
	var XY = {x: 0, y: 0};
	while(El){
		XY.x += El.offsetLeft;
		XY.y += El.offsetTop;
		El = El.offsetParent;
	}
	return XY;
}

function GetScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop;
	}
	else{
		if (document.body){
 			return document.body.scrollTop;
		}
		else{
			return window.pageYOffset;
		}
	}
}

function GetViewportHeight(){
	if (window.innerWidth){
		return window.innerWidth;
	}
	else{
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function TopSettingWithScrollOffset(TopPercent){
	var T = Math.floor(GetViewportHeight() * (TopPercent/100));
	return GetScrollTop() + T; 
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
var InTextBox = false;

function SuppressBackspace(e){ 
	if (InTextBox == true){return;}
	if (C.ie) {
		thisKey = window.event.keyCode;
	}
	else {
		thisKey = e.keyCode;
	}

	var Suppress = false;

	if (thisKey == 8) {
		Suppress = true;
	}

	if (Suppress == true){
		if (C.ie){
			window.event.returnValue = false;	
			window.event.cancelBubble = true;
		}
		else{
			e.preventDefault();
		}
	}
}

if (C.ie){
	document.attachEvent('onkeydown',SuppressBackspace);
	window.attachEvent('onkeydown',SuppressBackspace);
}
else{
	window.addEventListener('keypress',SuppressBackspace,false);
}

function ReduceItems(InArray, ReduceToSize){
	var ItemToDump=0;
	var j=0;
	while (InArray.length > ReduceToSize){
		ItemToDump = Math.floor(InArray.length*Math.random());
		InArray.splice(ItemToDump, 1);
	}
}

function Shuffle(InArray){
	Temp = new Array();
	var Len = InArray.length;

	var j = Len;

	for (var i=0; i<Len; i++){
		Temp[i] = InArray[i];
	}

	for (i=0; i<Len; i++){
		Num = Math.floor(j  *  Math.random());
		InArray[i] = Temp[Num];

		for (var k=Num; k < j; k++) {
			Temp[k] = Temp[k+1];
		}
		j--;
	}
	return InArray;
}

function WriteToInstructions(Feedback) {
//	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].id.indexOf('Gap') > -1)){
			NList[i].value = '';
		}
		if (NList[i].id.indexOf('Chk') > -1){
			NList[i].checked = '';
		}
	}
}

//EXTENSION TO ARRAY OBJECT
function Array_IndexOf(Input){
	var Result = -1;
	for (var i=0; i<this.length; i++){
		if (this[i] == Input){
			Result = i;
		}
	}
	return Result;
}
Array.prototype.indexOf = Array_IndexOf;

//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
function RemoveBottomNavBarForIE(){
	if ((C.ie)&&(document.getElementById('Reading') != null)){
		if (document.getElementById('BottomNavBar') != null){
			document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
		}
	}
}




//HOTPOTNET-RELATED CODE

var HPNStartTime = (new Date()).getTime();
var SubmissionTimeout = 30000;
var Detail = ''; //Global that is used to submit tracking data

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store != null){
		Frm = document.store;
		Frm.starttime.value = HPNStartTime;
		Frm.endtime.value = (new Date()).getTime();
		Frm.mark.value = Score;
		Frm.detail.value = Detail;
		Frm.submit();
	}
}



//JQUIZ CORE JAVASCRIPT CODE

var CurrQNum = 0;
var CorrectIndicator = ':-)';
var IncorrectIndicator = 'X';
var YourScoreIs = 'Your score is ';
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';
var ShowCorrectFirstTime = false;
var ShuffleQs = true;
var ShuffleAs = true;
var DefaultRight = 'Correct!';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 10;
var Score = 0;
var Finished = false;
var Qs = null;
var QArray = new Array();
var ShowingAllQuestions = false;
var ShowAllQuestionsCaption = 'Show all questions';
var ShowOneByOneCaption = 'Show questions one by one';
var State = new Array();
var Feedback = '';
var TimeOver = false;

//The following variable can be used to add a message explaining that
//the question is finished, so no further marking will take place.
var strQuestionFinished = '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=0; QNum<I.length; QNum++){
//Only do this if not multi-select
		if (I[QNum][2] != '3'){
  		for (ANum = 0; ANum<I[QNum][3].length; ANum++){
  			if (I[QNum][3][ANum][1].length < 1){
  				if (I[QNum][3][ANum][2] > 0){
  					I[QNum][3][ANum][1] = DefaultRight;
  				}
  				else{
  					I[QNum][3][ANum][1] = DefaultWrong;
  				}
  			}
  		}
		}
	}
}

function SetUpQuestions(){
	var AList = new Array(); 
	var QList = new Array();
	var i, j;
	Qs = document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem = 0;
	while (QsToShow < QList.length){
		DumpItem = Math.floor(QList.length*Math.random());
		for (j=DumpItem; j<(QList.length-1); j++){
			QList[j] = QList[j+1];
		}
		QList.length = QList.length-1;
	}
	if (ShuffleQs == true){
		QList = Shuffle(QList);
	}
	if (ShuffleAs == true){
		var As;
		for (var i=0; i<QList.length; i++){
			As = QList[i].getElementsByTagName('ol')[0];
			if (As != null){
  			AList.length = 0;
				while (As.getElementsByTagName('li').length > 0){
					AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
				}
				AList = Shuffle(AList);
				for (j=0; j<AList.length; j++){
					As.appendChild(AList[j]);
				}
			}
		}
	}
	
	for (i=0; i<QList.length; i++){
		Qs.appendChild(QList[i]);
		QArray[QArray.length] = QList[i];
	}

//Show the first item
	QArray[0].style.display = '';
	
//Now hide all except the first item
	for (i=1; i<QArray.length; i++){
		QArray[i].style.display = 'none';
	}		
	SetQNumReadout();
}

function ChangeQ(ChangeBy){
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
	QArray[CurrQNum].style.display = 'none';
	CurrQNum += ChangeBy;
	QArray[CurrQNum].style.display = '';
	SetQNumReadout();
//if there's a textbox, set the focus in it
	if (QArray[CurrQNum].getElementsByTagName('input')[0] != null){
		QArray[CurrQNum].getElementsByTagName('input')[0].focus();
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
}

I=new Array();
I[0]=new Array();I[0][0]=100;
I[0][1]='';
I[0][2]='0';
I[0][3]=new Array();
I[0][3][0]=new Array('Justices on the International Court of Justice at the Hague.','Nope.  There is no similarity between these two groups at all.',0,0,1);
I[0][3][1]=new Array('Private citizens on international travel visas.','Sorry.  The privileges and responsibilities of Commanding Officers of warships are significantly greater than those of a private citizen.',0,0,1);
I[0][3][2]=new Array('Charg\u00E9s d\u2019 Affairs heading up foreign missions.','Sorry.  While Charg&#x00E9;s d? Affairs do share many of the same diplomatic privileges as Commanding Officers of warships, their actions do not reflect the actions of their nations as do those of warship CO\'s.',0,0,1);
I[0][3][3]=new Array('Senior Military Attach\u00E9s at overseas embassies.','Nope.  While Military Attach&#x00E9;s do share many of the same diplomatic privileges as Commanding Officers of warships, their actions do not reflect the actions of their nations as do those of warship CO\'s.',0,0,1);
I[0][3][4]=new Array('Ambassadors heading up overseas legations.','Correct!  The immunities granted are the same as for ambassadors, while the responsibilities are similar in that both are considered to be the personal representatives of their governments.',1,100,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('Naval bombardment intended to inflict wanton destruction of populated places','Sorry.  This is specifically prohibited under international law.',0,0,1);
I[1][3][1]=new Array('Attacks on hospital ships','Nope.  The Geneva Conventions specifically prohibit this.',0,0,1);
I[1][3][2]=new Array('The use of Chemical, Biological and/or Radiological Weapons.','Correct!  While the U.S. has halted the production of biological and chemical weapons, many other nations have not.  They have not been banned under international treaties an so could be used legally in times of war under certain conditions.',1,100,1);
I[1][3][3]=new Array('The aerial bombardment of undefended cities open for immediate occupation','Nope.  Although this was done by all sides during World War II, it is considered illegal under international law.',0,0,1);
I[1][3][4]=new Array('Unrestricted submarine warfare','Sorry.  While conducted by all sides during World War II, this is specifically prohibited.  It is a complicated issue, given that following the rules of international law puts the submarine in a position where it can be discovered and sunk easily.',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('An Embargo','Sorry.  An embargo is a governmental order prohibiting the entry or departure of commercial vessels or goods at its ports.  This is a term related to commerce and not to warfare.',0,0,1);
I[2][3][1]=new Array('A Tariff','Nope.  A tariff is duty (or tax) levied upon goods transported from one customs area to another.  It is a term related to commerce and not to warfare.',0,0,1);
I[2][3][2]=new Array('An Injunction','Nope.  An injunction is a court order prohibiting a person from doing something or requiring a person to do something.  This term is not used or connected with legal naval blockades. ',0,0,1);
I[2][3][3]=new Array('A Restriction','Sorry.  While all forms of naval blockades are restrictive in nature, this is not the term used to legally describe the type of blockade listed.',0,0,1);
I[2][3][4]=new Array('A Quarantine','Correct.  Perhaps the best example of this was the quarantine carried out by the U.S. Navy against Cuba to prevent more Soviet missiles from being delivered to Cuba.',1,100,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('Precautions must be taken when laying the minefield for the security of peaceful neutral shipping.','Nope.  Any lawful minefield must consider the safety of neutral shipping.',0,0,1);
I[3][3][1]=new Array('Unanchored contact mines are forbidden unless they become harmless within one hour after they cannot be controlled','Sorry.  This type of mine must self-destruct within one hour of loss of control.  This type of mine has proven to be the most used, due to its low cost and low technology requirements.  It was improperly used over and over again by communist forces during the cold war and once-again by Iran during the Iran-Iraq war in the 1980\'s.',0,0,1);
I[3][3][2]=new Array('Automatic minefields are not to be laid solely for the purpose of intercepting commercial shipping.','Sorry.  While commercial shipping may suffer as a result of the minefield, the destruction of such shipping cannot be the sole reason for the laying of the minefield.',0,0,1);
I[3][3][3]=new Array('Minefields which could have an adverse affect on neutral commercial shipping are prohibited.','Right.  The laying of a minefield will always adversely affect shipping, both of the belligerents and the neutral countries as well.  The only restrictions are that commercial shipping cannot be the sole reason for the minefield and that precautions are taken to ensure the security of peaceful neutral shipping.',1,100,1);
I[3][3][4]=new Array('The rules for the use of minefields in war were specified in the Hague Conventions.','Nope.  This is where many of the rules of modern warfare were first laid down.',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('Files a formal complaint through diplomatic channels.','Right!  This is the normal route taken to register complaints against warships.  The host government would work with the U.S. government to right the situation.  It would be investigated and the conduct of the warship and her Commanding Officer would be reviewed for misconduct.',1,100,1);
I[4][3][1]=new Array('Authorizes its police or armed forces to board the warship.','Sorry.  This is not allowed under international law.  A ship is considered the sovereign territory of its country and cannot be boarded without the permission of its Commanding Officer.',0,0,1);
I[4][3][2]=new Array('Files charges in the International Court of Justice  against the warship\'s Commanding Officer.','Nope.  The International Court of Justice does not hear such cases and, under all but the most unusual circumstances, there are more appropriate ways of dealing with such issues.',0,0,1);
I[4][3][3]=new Array('Files charges in admiralty court against the warship\'s Commanding Officer.','Nope.  Admiralty courts hear cases concerning violations of the International Rules of the Road or the Law of the Sea Agreements, not specific charges against individuals.',0,0,1);
I[4][3][4]=new Array('Cancels further visits to the port by U.S. warships.','Sorry.  While this could occur in extreme cases, it is not the normal response.',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 Geneva Conventions','Sorry.  The Geneva Conventions deal primarily with the Laws of Warfare between belligerent states.',0,0,1);
I[5][3][1]=new Array('The International Incident Agreements.','Nope.  There is no set of agreements by this name.',0,0,1);
I[5][3][2]=new Array('The Asylum Rights Agreement','Nope.  There is no set of agreements by this name.',0,0,1);
I[5][3][3]=new Array('The Status of Forces Agreement','Right!  These agreements vary from nation to nation and in some foreign ports the U.S. hasn\'t yet negotiated such agreements.  It is always advisable for personnel on leave or liberty in a foreign country to be well advised on the local law and what to do should they get into trouble.',1,100,1);
I[5][3][4]=new Array('The International Law of the Seas Agreements','Sorry.  These agreements deal with commerce and territorial issues and not with the legal rights and responsibilities of warships in foreign ports.',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('Merchants only','Sorry.  While it is true that merchant vessels are subject to the rules, other classes of vessels are as well.',0,0,1);
I[6][3][1]=new Array('Warships only','Sorry.  While it is true that warships are subject to the rules, other classes of vessels are as well.',0,0,1);
I[6][3][2]=new Array('Commercial merchant vessels and warships','Nope.  While these two classes of vessels are subject to these rules, they are not the only ones.',0,0,1);
I[6][3][3]=new Array('To all vessels','Right!  Large or small, warship or merchant, all vessels are subject to these rules and regulations.',1,100,1);
I[6][3][4]=new Array('Merchant vessels above 500 tons and all warships','Nope.  There is no size restriction when dealing with the International Rules of the Road.',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('There is no "private property" in sea warfare if the fighting occurs in international waters.','Nope.  Although the majority of naval warfare does occur on the high seas, private property still exists as a legal concept.',0,0,1);
I[7][3][1]=new Array('There is no legal difference between the treatment of private property in land or sea warfare.','Sorry.  There is a number of significant differences between the treatment of private property in land and sea warfare.',0,0,1);
I[7][3][2]=new Array('Private property must be returned to its owners in sea warfare.','Sorry.  International law allows for the legal confiscation of private property if such property is deemed contraband, such as in the case of a quarantine or blockade.',0,0,1);
I[7][3][3]=new Array('In land warfare, private property is generally required to be left undisturbed.','Correct!  In some instances, for example, neutral property is subject to confiscation by belligerent warships.  Contraband good taken from a neutral merchant ship during a blockade or quarantine is an example of this.',1,100,1);
I[7][3][4]=new Array('Private property must be left undisturbed during sea warfare.','Nope.  In some instances, for example, neutral property is subject to legal confiscation by a belligerent warship, such as in the case of a quarantine or blockade.',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('International Rules of the Road generally apply in territorial seas and national waters, unless special internal rules have been adopted by a nation.','Right!  The U.S. is an example of a country with slightly different rules within its inland waters.  When this is the case, the rules of the nation\'s inland waters take <a href="javascript:alert(\'Status established in order of importance or urgency.\')">precedence.</a>',1,100,1);
I[8][3][1]=new Array('International Rules of the Road only apply on the High Seas, not in territorial seas or national waters.','Sorry.  Generally these rules do apply in territorial seas and national waters.',0,0,1);
I[8][3][2]=new Array('International Rules of the Road only apply in national waters.','Nope.  They apply in other waters as well.',0,0,1);
I[8][3][3]=new Array('International Rules of the Road apply in territorial seas and all national waters.','Sorry.  While this is generally true, there are exceptions.',0,0,1);
I[8][3][4]=new Array('International Rules of the Road only apply in territorial seas.','Nope.  They apply in other waters as well.',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 crew of the vessel must be subject to military discipline.','Sorry.  This is part of the requirements under international law.',0,0,1);
I[9][3][1]=new Array('The ship or vessel must have armaments and be capable of engaging in combat operations.','Correct.  The definition under international law of a warship does not speak to specific armor or armaments.',1,100,1);
I[9][3][2]=new Array('The vessel must be authorized to display an appropriate flag or pennant identifying her as a commissioned naval vessel.','Nope.  The official authorization to fly the appropriate flag or pennant from the state commissioning the vessel as a warship is a requirement.',0,0,1);
I[9][3][3]=new Array('The ship must be commissioned as a part of the naval forces of a state.','Nope.  A ship or vessel that isn\'t so commissioned is not considered a warship under international law.',0,0,1);
I[9][3][4]=new Array('The vessel must be commanded by a member of a state\'s military forces.','Sorry.  This is part of the requirements under international law.',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('To comply with harbor regulations concerning sewage disposal.','Sorry.  This is a safety consideration and is considered a responsibility of the warship while in the foreign port.',0,0,1);
I[10][3][1]=new Array('To comply with harbor regulations concerning quarantine restrictions.','Sorry.  This is a safety consideration and is considered a responsibility of the warship while in the foreign port.',0,0,1);
I[10][3][2]=new Array('To comply with harbor regulations concerning traffic control.','Nope.  This is a safety consideration and is considered a responsibility of the warship while in the foreign port.',0,0,1);
I[10][3][3]=new Array('To comply with harbor regulations concerning speed control.','Nope.  This is a safety consideration and is considered a responsibility of the warship while in the foreign port.',0,0,1);
I[10][3][4]=new Array('To comply with harbor regulations concerning routine searches or inspections of the ship.','Correct.  A warship is considered to be the home soil of its nation, and even routine searches or inspections cannot be made unless specifically authorized by the warship\'s Commanding Officer.',1,100,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 International Court of Justice at the Hague','Nope.  The International Court of Justice has recognized the authority of lower-level local courts in these matter, as long as they follow international law.',0,0,1);
I[11][3][1]=new Array('A prize court','Correct!  This prize court would normally be held at the neutral port where the ship in question was taken following the discovery of the contraband.  The prize court would hear the case and apply the appropriate international law in determining the liability.',1,100,1);
I[11][3][2]=new Array('The Commanding Officer of the warship that discovered the contraband','Sorry.  He or she would hardly be considered an impartial party in this case.',0,0,1);
I[11][3][3]=new Array('An appeals court of the United Nations','Nope.  No such appeals courts of the United Nations exist.',0,0,1);
I[11][3][4]=new Array('The boarding officer of the warship that discovered the contraband','Sorry.  He or she would hardly be considered an impartial party in this case.',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('1995','Nope.  While the current set did come into effect in the modern era, it wasn\'t that recently.',0,0,1);
I[12][3][1]=new Array('1972','Sorry.  While the most current set of these laws were revised in 1972, that wasn\'t the year that they came into effect.',0,0,1);
I[12][3][2]=new Array('1977','Correct!  Revised in 1972 and coming into effect in 1977, this was only the third revision since 1895.',1,100,1);
I[12][3][3]=new Array('1895','Sorry.  This was the year when the British and French first set sailing rules that gained international acceptance.',0,0,1);
I[12][3][4]=new Array('2003','Nope.  They have been in place for some time now.',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('Render assistance to any person found at sea in danger of being lost.','Nope.  This is a specific requirement under international law.',0,0,1);
I[13][3][1]=new Array('Following a collision at sea, render assistance to the other ship.  ','Nope.  This is a requirement for all vessels under international law.',0,0,1);
I[13][3][2]=new Array('To prevent confrontations between warships of other nations on the high seas.','Right.  It is not a responsibility of any nation\'s warships to "break up fights".',1,100,1);
I[13][3][3]=new Array('Rescue persons in distress if informed of their need of assistance.','Sorry.  Warships need to proceed with all possible speed in these cases and render such action as may reasonably be expected.',0,0,1);
I[13][3][4]=new Array('To suppress piracy on the high seas.','Sorry.  This is a recognized duty of all warships under international law.',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('In the International Court of Justice at the Hague','Nope.  The number of these cases would overwhelm the International Court of Justice, so other courts are approved under international law to hear these cases.',0,0,1);
I[14][3][1]=new Array('In an admiralty court of the maritime nation having jurisdiction.','Correct!  Admiralty courts and admiralty law is recognized under international agreements.  this allows international law to be uniformly applied to ships of all nationalities.',1,100,1);
I[14][3][2]=new Array('In a civil court conducted by the International Maritime Organization (IMO)','Sorry.  The IMO is a specialized agency of the United Nations charged with the development of the International Rules of the Road.  It does not get involved with trying cases under those laws, however.',0,0,1);
I[14][3][3]=new Array('In a civil court of the maritime nation having jurisdiction.','Sorry.  Civil courts do not have the jurisdiction to try international cases and civil law varies significantly from nation to nation.',0,0,1);
I[14][3][4]=new Array('In an admiralty court of the United Nations','Nope.  The UN does not convene admiralty courts.',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('Merchant ships are subject to the jurisdiction of the nation being visited.','Correct.  Merchant ships are not considered to be the sovereign territory of the ship\'s nation, and fall under local jurisdiction when in a foreign port.  They can be boarded, searched and inspected without having to obtain the Commanding Officer\'s permission.',1,100,1);
I[15][3][1]=new Array('Merchant shipping owners must negotiate their own Status of Forces Agreements.','Sorry.  While merchant ships do not negotiate such agreements, this is not the primary difference.',0,0,1);
I[15][3][2]=new Array('There is not difference between the protections afforded the two under international law.','Nope.  There is a significant difference in terms of the degree of protection and immunity provided for crew members.',0,0,1);
I[15][3][3]=new Array('Merchant ship personnel retain protections even when ashore on leave or liberty.','Nope.  In fact their protections are much less than those afforded to warship crew members.',0,0,1);
I[15][3][4]=new Array('Merchant ships cannot be inspected, even with the Commanding Officer\'s permission, unless the owners permission is also obtained.','Sorry.  Under international law, the ship\'s master\'s and or owner\'s permission is not required for local authorities to board the vessel.',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 United Nations','Correct!  The IMO is the specialized agency of the UN charged with the ongoing development of these rules and regulations.',1,100,1);
I[16][3][1]=new Array('The League of Nations','Sorry.  The League of Nations ceased to exist after World War II.',0,0,1);
I[16][3][2]=new Array('The North Atlantic Treaty Organization (NATO)','Sorry.  NATO is primarily a pact between North American and European nations for collective defense that began as a result of the pressures exerted in Europe by the Soviet Union following World War II.',0,0,1);
I[16][3][3]=new Array('The Hague Convention','Nope.  The Hague Peace Convention was the first modern attempt to broadly detail the rules of warfare.',0,0,1);
I[16][3][4]=new Array('The World Trade Organization (WTO)','Nope.  The WTO is certainly interested in the International Rules of the Road in their relation to world commerce, but this organization does not have the IMO as one of its agencies.',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('India','Nope.  This prohibition was approved by a vote in the United Nations in 1970, but it was not proposed by India.',0,0,1);
I[17][3][1]=new Array('The United States','Right!  This proposal was later voted into international law by the United Nations in 1970.',1,100,1);
I[17][3][2]=new Array('Canada','Sorry.  While this resolution was supported by Canada, this country was not the one that proposed it.',0,0,1);
I[17][3][3]=new Array('France','Nope.  This prohibition was approved by a vote in the United Nations in 1970, but it was not proposed by France.',0,0,1);
I[17][3][4]=new Array('Great Britain','Sorry.  While this resolution was supported by Great Britain, this country was not the one that proposed it.',0,0,1);
I[18]=new Array();I[18][0]=100;
I[18][1]='';
I[18][2]='0';
I[18][3]=new Array();
I[18][3][0]=new Array('The use of admiralty and prize courts to quickly administer justice in these cases.','Sorry.  These courts deal primarily with laws related to commerce and not to the laws of war.',0,0,1);
I[18][3][1]=new Array('The publication of the facts by the wronged nation.','Right!  This has proven to be an effective method of influencing world opinion against the offending belligerent power.  With the rapid and world-wide flow of information to all countries, the power of simply getting the facts out there through diplomatic protest remains a significant deterrent.',1,100,1);
I[18][3][2]=new Array('Using UN observers in tension hotspots to report violations of the laws to an international tribunal.','Nope.  While this is done in many placed around the world and has had some positive effect, it is not considered to be the most effective method.',0,0,1);
I[18][3][3]=new Array('Reprisal attacks','Sorry.  While legal under international law, this is not the most effective method.',0,0,1);
I[18][3][4]=new Array('War crimes trials held by the victorious nations after the conflict.','Nope.  This has, of course, been done and the results have no doubt had some affect on the actions of other countries.  Still, this is not considered to be the most effective method of enforcing these laws.',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 Commanding Officer\'s permission.','Right!  The Commanding Officer is never required to submit to a search of his or her ship, and one cannot be conducted without his or her permission.',1,100,1);
I[19][3][1]=new Array('A formal request from the elected official or ruler of the government of the host nation.','Nope.  Under international law, they cannot come aboard even if they had such a request unless something else were to occur.',0,0,1);
I[19][3][2]=new Array('A written order from that country\'s ambassador.','Sorry.  While the ambassador\'s order would carry some weight, he or she does not have the authority to order this under international law.',0,0,1);
I[19][3][3]=new Array('A international subpoena.','Nope.  There is no such thing as a international subpoena.',0,0,1);
I[19][3][4]=new Array('They do not need anything special as the warship is subject to local laws and rules while in the foreign port.','Sorry.  While a warship must abide by the laws and harbor regulations of the country being visited, they cannot be legally boarded by local authorities unless something else occurs.',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('Military necessity','Sorry.  The principles permits a belligerent to apply only the degree and kind of regulated force not otherwise prohibited by the laws of war.',0,0,1);
I[20][3][1]=new Array('Mercy','Correct!  This concept and principal is a part of "chivalry".',1,100,1);
I[20][3][2]=new Array('Chivalry','Sorry.  Chivalry involves the qualities of bravery, honor, courtesy, respect for women, protection of the weak, generosity, and fairness to enemies.',0,0,1);
I[20][3][3]=new Array('Humanity','Nope.  Humanity is considered the most important of these principles.  It forms the basis of all prohibitions imposed by international law on belligerents for the purpose of limiting excessive violence.',0,0,1);
I[21]=new Array();I[21][0]=100;
I[21][1]='';
I[21][2]='0';
I[21][3]=new Array();
I[21][3][0]=new Array('The doctrine of asylum does not apply to merchant ships.','Sorry.  The doctrine of asylum applies to warships only, not to merchant ships.',0,0,1);
I[21][3][1]=new Array('Local police cannot come onboard a warship without the Commanding Officer\'s permission.','Nope.  A warship is considered the territory of its home country and local authorities have no right under international law to board the warship without the CO\'s permission.',0,0,1);
I[21][3][2]=new Array('Local police can come onboard a merchant ship to arrest an accused offender.','Nope.  A merchant ship is not considered the official territory of its home country, so there are no international protections from local authorities boarding the vessel.',0,0,1);
I[21][3][3]=new Array('A foreign national seeking asylum onboard a U.S. merchant ship must be turned over to local authorities.','Sorry.  Local authorities have the right under international law to board a merchant ship currently in port and to arrest and remove anyone for breaking local laws.',0,0,1);
I[21][3][4]=new Array('A foreign national seeking asylum onboard a U.S. warship must be turned over to local authorities.','Right!  While physically onboard the U.S. warships, the foreign national has the same rights that he or she would have if they were in the United States.  Local authorities cannot, under international law, come onboard to arrest or remove that individual unless given the permission of the Commanding Officer.',1,100,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 League of Nations','Nope.  The League of Nations ceased to exist after World War II and never did exercise this kind of control over the High Seas.',0,0,1);
I[22][3][1]=new Array('The High Seas are not under the sovereignty of any state.','Correct.  No nation, state or group of states has sovereignty over the High Seas.',1,100,1);
I[22][3][2]=new Array('The United States','Nope.  While the U.S. has the world\'s strongest Navy, it doesn\'t exercise sovereignty over the High Seas.',0,0,1);
I[22][3][3]=new Array('The International Court of Justice at the Hague','Sorry.  While this judicial body hears international law cases, they do not have sovereignty over the High Seas.',0,0,1);
I[22][3][4]=new Array('The United Nations','Sorry.  While the United Nations deals with issues concerning the High Seas, it does not exercise legal control.',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('Munitions','Sorry.  While munitions capable of being used in a war would certainly be an example of goods useful for making war, this is not the term used under international law to describe these type of goods.',0,0,1);
I[23][3][1]=new Array('CBR Weapons','Sorry.  Chemical, Biological and Radiological (CBR) weapons would certainly be one of the several types of goods that would fall into this category, but it is not the name used under international law to describe these type of goods.',0,0,1);
I[23][3][2]=new Array('Contraband','Correct!  This is the generic term used describe all goods that could be used by an enemy to make war or further their ability to make war.',1,100,1);
I[23][3][3]=new Array('Blockade','Nope.  A blockade is a permissible method that a belligerent nation may use to shut off an enemy\'s trade, both in goods useful for making war and for other, purely commercial goods.',0,0,1);
I[23][3][4]=new Array('Quarantine','Nope.  A quarantine is a specific type of naval blockade directed against such goods as these, but it is not the term used to describe these type of goods under international law.',0,0,1);
I[24]=new Array();I[24][0]=100;
I[24][1]='';
I[24][2]='0';
I[24][3]=new Array();
I[24][3][0]=new Array('The British and the French','Right.  The French and the British had the strongest naval traditions in the 1800\'s and it makes sense that it would be from their sailing rules that the international standards would be drawn.',1,100,1);
I[24][3][1]=new Array('The American and the British','Sorry.  The American Navy was not a significant model for the establishment of nautical rules of the road in 1895.',0,0,1);
I[24][3][2]=new Array('The French and the Spanish','Nope.  While the French still had a strong naval tradition in 1895, the Spanish did not.',0,0,1);
I[24][3][3]=new Array('The American and the French','Nope.  The American Navy was not a significant model for the establishment of nautical rules of the road in 1895.',0,0,1);
I[24][3][4]=new Array('The British and the Spanish','Sorry.  While the British had a strong naval tradition in 1895, the Spanish did not.',0,0,1);
I[25]=new Array();I[25][0]=100;
I[25][1]='';
I[25][2]='0';
I[25][3]=new Array();
I[25][3][0]=new Array('The right of preemptive boarding.','Sorry.  While vessels suspected of piracy or the smuggling of contraband can be boarded legally with or without permission, this is not the name given to this right under international law.',0,0,1);
I[25][3][1]=new Array('The right of inspection.','Nope.  There is no such specified right under international law.',0,0,1);
I[25][3][2]=new Array('The right of search and seizure.','Sorry.  While vessels suspected of piracy or the smuggling of contraband can be boarded legally with or without permission and contraband materials seized, this is not the name given to this right under international law.',0,0,1);
I[25][3][3]=new Array('The right of jurisdiction.','Nope.  There is no such specified right under international law.',0,0,1);
I[25][3][4]=new Array('The right of approach.','Correct.  As a matter of practice, warships request the name and nationality of all merchant ships met at sea, usually by flashing light.',1,100,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 Law of the Sea Conventions','Nope.  The Law of the Sea Conventions did not begin that early and deal primarily with commerce-related issues in and below international waters.',0,0,1);
I[26][3][1]=new Array('The Hague Peace Conventions','Correct.  This convention first recognized that the avoidance of war should be attempted as an ultimate goal in all cases.',1,100,1);
I[26][3][2]=new Array('The International Rules of the Road Meetings','Sorry.  The international rules of the road pertain mainly to navigation and traffic control on the world\'s waters.',0,0,1);
I[26][3][3]=new Array('The Paris Peace and Warfare Discussions','Nope.  There we no such discussions by this name.',0,0,1);
I[26][3][4]=new Array('The Geneva Conventions','Sorry.  The Geneva Conventions do deal with the rights and responsibilities of warring states, but they did not come about until later in the 20th century.',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('They are designed to ensure that belligerents do not escalate a conflict to total war.','Nope.  The avoidance of a total war, and the degree of destruction and loss of human life that would come from it, is a primary objective of the rules of warfare.',0,0,1);
I[27][3][1]=new Array('They are considered binding on all nations.','Sorry.  The war crime trials following World War II gave legal precedent that the rules of warfare were binding whether or not a particular country had signed up to the treaties before the war.',0,0,1);
I[27][3][2]=new Array('The limitations placed on land forces and naval forces are significantly different.','Right!  The restrictions are generally the same with very few exceptions.',1,100,1);
I[27][3][3]=new Array('They are designed to restrain belligerents from the excessive use of force.','Nope.  The rules are designed to limit the hostilities to the greatest degree possible so that excessive force does not come into play.',0,0,1);
I[27][3][4]=new Array('It does not matter if a belligerent nation has ratified the rules of warfare or not.','Sorry.  The war crime trials following World War II gave legal precedent that the rules of warfare were binding whether or not a particular country had signed up to the treaties before the war.',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('President Regan','Sorry.  This action was taken well before the Regan Administration.',0,0,1);
I[28][3][1]=new Array('President Carter','Sorry.  While President Carter\'s Administration saw other limitations placed on the use of U.S. force, this wasn\'t one of them.',0,0,1);
I[28][3][2]=new Array('President Eisenhower','Nope.  The research and reproduction of these agents continued throughout the Eisenhower Administration.',0,0,1);
I[28][3][3]=new Array('President Nixon','Correct.  This decision was made in 1969 and has been followed by every Administration since then.',1,100,1);
I[28][3][4]=new Array('President Kennedy','Nope.  The research and reproduction of these agents continued throughout the Kennedy Administration.',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('Military necessity','Right.  It should be noted, however, that the rules of international law come above military necessity, because military necessity will not provide an acceptable defense for crimes committed during the conduct of war.',1,100,1);
I[29][3][1]=new Array('Chivalry','Sorry.  Chivalry involves the qualities of bravery, honor, courtesy, respect for women, protection of the weak, generosity, and fairness to enemies.',0,0,1);
I[29][3][2]=new Array('Proportionality','Nope.  While this sounds like a correct term and describes a similar idea--the use of only that force that will accomplish the mission and no more--this is not one of the three recognized principals underlying the rules of civilized land warfare.',0,0,1);
I[29][3][3]=new Array('Humanity','Sorry.  Humanity is the principal of land warfare that forms the basis of all prohibitions imposed by international law on belligerents for the purpose of limiting excessive violence.',0,0,1);
I[29][3][4]=new Array('Mercy','Nope.  Mercy is not one of the three recognized principals underlying the rules of civilized land warfare.',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 International Rules of the Road','Right!  This set of rules to guide traffic on the High Seas is also given the more popular name of "COLREGS".',1,100,1);
I[30][3][1]=new Array('The Hague Conventions','Sorry.  The Hague Peace Convention was the first modern attempt to broadly detail the rules of warfare.',0,0,1);
I[30][3][2]=new Array('The Rules of the Law of War at Sea','Nope.  Although that is the focus of this particular chapter, it is not the more common name given to the "Regulations for the Prevention of Collisions at Sea".',0,0,1);
I[30][3][3]=new Array('The Safe Transit and Commerce Regulations','Nope.  There is no such set of regulations by that name.',0,0,1);
I[30][3][4]=new Array('The Geneva Conventions','Nope.  The Geneva Conventions cover a broad range of rules and regulations relating to warfare between states and are not generally concerned with the rules and regulations related to merchant traffic on the High Seas.',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('Officers may not be immune while ashore on leave.','Nope.  Officers or members of the crew are not considered to be in an official status while on leave or liberty.  Unless a separate agreement on this has been reached by the U.S. and the host government, they  would be treated as any other foreign visitor.',0,0,1);
I[31][3][1]=new Array('Crew members may not be immune while ashore on liberty.','Nope.  While ashore on liberty or leave, the protections granted for official business are not in effect.  Unless a separate agreement on this has been reached by the U.S. and the host government, the crew member would be treated as any other foreign visitor.',0,0,1);
I[31][3][2]=new Array('Officers are immune while ashore on official liberty.','Correct.  There is no such thing as "official liberty" under international law.  Immunity may or may not apply while on liberty or leave, depending on the agreements in force between the U.S. and the foreign country.',1,100,1);
I[31][3][3]=new Array('Officers and crew are normally immune while off the ship on official business.','Sorry.  While on official business, officers and crew are normally granted the same immunity as if they were physically onboard the warship.',0,0,1);
I[31][3][4]=new Array('Officers and crew are completely immune while on board the ship.','Sorry.  A warship is considered to be the same as the soil of the country from which it comes.  The officers and crew would have the same immunity as if there were back in the United States.',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('Piracy','Sorry.  Piracy is basically robbery on the high seas.  This is not the definition of interference with a warship under international law.',0,0,1);
I[32][3][1]=new Array('An act of war.','Right!  Warships represent the sovereignty and independence of the state to which they belong.',1,100,1);
I[32][3][2]=new Array('Encroachment','Nope.  While encroachment can be defined as entry to another\'s property without right or permission, this is not the legal consideration that occurs under international law.',0,0,1);
I[32][3][3]=new Array('Trespassing','Nope.  While trespassing could be considered interference, this is not the major consideration that comes into play under international law.',0,0,1);
I[32][3][4]=new Array('Mutiny','Sorry.  Mutiny is open rebellion against constituted authority.  It takes place within the command structure, not from outside of the command structure.',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';
	}
	

	

	
	CompleteEmptyFeedback();

	SetUpQuestions();
	ClearTextBoxes();
	CreateStatusArray();
	

	
//Check search string for q parameter
	if (document.location.search.length > 0){
		if (ShuffleQs == false){
			var JumpTo = parseInt(document.location.search.substring(1,document.location.search.length))-1;
			if (JumpTo <= QsToShow){
				ChangeQ(JumpTo);
			}
		}
	}
}

function ShowHideQuestions(){
	FuncBtnOut(document.getElementById('ShowMethodButton'));
	document.getElementById('ShowMethodButton').style.display = 'none';
	if (ShowingAllQuestions == false){
		for (var i=0; i<QArray.length; i++){
				QArray[i].style.display = '';
			}
		document.getElementById('Questions').style.listStyleType = 'decimal';
		document.getElementById('OneByOneReadout').style.display = 'none';
		document.getElementById('ShowMethodButton').innerHTML = ShowOneByOneCaption;
		ShowingAllQuestions = true;
	}
	else{
		for (var i=0; i<QArray.length; i++){
				if (i != CurrQNum){
					QArray[i].style.display = 'none';
				}
			}
		document.getElementById('Questions').style.listStyleType = 'none';
		document.getElementById('OneByOneReadout').style.display = '';
		document.getElementById('ShowMethodButton').innerHTML = ShowAllQuestionsCaption;
		ShowingAllQuestions = false;	
	}
	document.getElementById('ShowMethodButton').style.display = 'inline';
}

function CreateStatusArray(){
	var QNum, ANum;
//For each item in the item array
	for (QNum=0; QNum<I.length; QNum++){
//Check if the question still exists (hasn't been nuked by showing a random selection)
		if (document.getElementById('Q_' + QNum) != null){
			State[QNum] = new Array();
			State[QNum][0] = -1; //Score for this q; -1 shows question not done yet
			State[QNum][1] = new Array(); //answers
			for (ANum = 0; ANum<I[QNum][3].length; ANum++){
				State[QNum][1][ANum] = 0; //answer not chosen yet; when chosen, will store its position in the series of choices
			}
			State[QNum][2] = 0; //tries at this q so far
			State[QNum][3] = 0; //incrementing percent-correct values of selected answers
			State[QNum][4] = 0; //penalties incurred for hints
			State[QNum][5] = ''; //Sequence of answers chosen by number
		}
		else{
			State[QNum] = null;
		}
	}
}



function CheckMCAnswer(QNum, ANum, Btn){
//if question doesn't exist, bail
	if (State[QNum].length < 1){return;}
	
//Get the feedback
	Feedback = I[QNum][3][ANum][1];
	
//Now show feedback and bail if question already complete
	if (State[QNum][0] > -1){
//Add an extra message explaining that the question
// is finished if defined by the user
		if (strQuestionFinished.length > 0){Feedback += '<br />' + strQuestionFinished;}
//Show the feedback
		ShowMessage(Feedback);
		return;
	}
	
//Hide the button while processing
	Btn.style.display = 'none';

//Increment the number of tries
	State[QNum][2]++;
	
//Add the percent-correct value of this answer
	State[QNum][3] += I[QNum][3][ANum][3];
	
//Store the try number in the answer part of the State array, for tracking purposes
	State[QNum][1][ANum] = State[QNum][2];
	State[QNum][5] += String.fromCharCode(65+ANum) + ',';
	
//Should this answer be accepted as correct?
	if (I[QNum][3][ANum][2] < 1){
//It's wrong

//Mark the answer
		Btn.innerHTML = IncorrectIndicator;
		
//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
			State[QNum][0] = ((TotAns-((Tries*100)/State[QNum][3]))/(TotAns-1));
		}
		if (State[QNum][0] < 0){
			State[QNum][0] = 0;
		}
	}
}

function GetTotalMCAnswers(QNum){
	var Result = 0;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			Result++;
		}
	}
	return Result;
}

function FinalAnswer(QNum){
	var UnchosenAnswers = 0;
	var FinalAnswer = -1;
	for (var ANum=0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][4] == 1){ //This is an MC answer
			if (State[QNum][1][ANum] < 1){ //This answer hasn't been chosen yet
				UnchosenAnswers++;
				FinalAnswer = ANum;
			}
		}
	}
	if (UnchosenAnswers == 1){
		return FinalAnswer;
	}
	else{
		return -1;
	}
}





function CalculateOverallScore(){
	var TotalWeighting = 0;
	var TotalScore = 0;
	
	for (var QNum=0; QNum<State.length; QNum++){
		if (State[QNum] != null){
			if (State[QNum][0] > -1){
				TotalWeighting += I[QNum][0];
				TotalScore += (I[QNum][0] * State[QNum][0]);
			}
		}
	}
	Score = Math.floor((TotalScore/TotalWeighting)*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);
	}
}










//-->

//]]>


