From: <Saved by Windows Internet Explorer 7>
Subject: Acid-Base Titration
Date: Mon, 8 Feb 2010 10:20:19 -0500
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.sciencegeek.net/Shockwave/Titration.htm
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xml:lang=3D"en" =
xmlns=3D"http://www.w3.org/1999/xhtml"><HEAD><TITLE>Acid-Base =
Titration</TITLE>
<META=20
content=3D"Created with Hot Potatoes by Half-Baked Software, registered =
to Andy Allan."=20
name=3Dauthor></META>
<META=20
content=3D"Hot Potatoes, Hot Potatoes, Half-Baked Software, Windows, =
University of Victoria"=20
name=3Dkeywords></META><LINK href=3D"http://purl.org/dc/elements/1.1/"=20
rel=3Dschema.DC>
<META content=3D"Andy Allan" name=3DDC:Creator>
<META content=3D"Acid-Base Titration" name=3DDC:Title>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"><!-- Made with executable version 6.0 Release 3 =
Build 0 --><!-- The following insertion allows you to add your own code =
directly to this head tag from the configuration screen -->
<STYLE type=3Dtext/css>BODY {
	FONT-SIZE: small; MARGIN-LEFT: 5%; COLOR: #000000; MARGIN-RIGHT: 5%; =
FONT-FAMILY: Geneva,Arial; BACKGROUND-COLOR: #fdfede
}
P {
	FONT-SIZE: small; MARGIN: 0px; TEXT-ALIGN: left
}
DIV {
	FONT-SIZE: small; COLOR: #000000
}
SPAN {
	FONT-SIZE: small; COLOR: #000000
}
TD {
	FONT-SIZE: small; COLOR: #000000
}
.RTLText {
	FONT-SIZE: 150%; DIRECTION: rtl; FONT-FAMILY: "Simplified Arabic", =
"Traditional Arabic", "Times New Roman", Geneva,Arial; TEXT-ALIGN: right
}
.CentredRTLText {
	FONT-SIZE: 150%; DIRECTION: rtl; FONT-FAMILY: "Simplified Arabic", =
"Traditional Arabic", "Times New Roman", Geneva,Arial; TEXT-ALIGN: =
center
}
BUTTON P.RTLText {
	TEXT-ALIGN: center
}
.RTLGapBox {
	FONT-SIZE: 150%; DIRECTION: rtl; FONT-FAMILY: "Times New Roman", =
Geneva,Arial; TEXT-ALIGN: right
}
.Guess {
	FONT-WEIGHT: bold
}
.CorrectAnswer {
	FONT-WEIGHT: bold
}
DIV.Titles {
	PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; COLOR: =
#000080; PADDING-TOP: 10px; TEXT-ALIGN: center
}
BUTTON {
	DISPLAY: inline
}
.ExerciseTitle {
	FONT-SIZE: large; COLOR: #000080
}
.ExerciseSubtitle {
	COLOR: #000080
}
DIV#Timer {
	PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; =
MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 6px; TEXT-ALIGN: =
center
}
SPAN#TimerText {
	BORDER-RIGHT: 1px solid; PADDING-RIGHT: 6px; BORDER-TOP: 1px solid; =
DISPLAY: none; PADDING-LEFT: 6px; FONT-WEIGHT: bold; PADDING-BOTTOM: =
6px; BORDER-LEFT: 1px solid; PADDING-TOP: 6px; BORDER-BOTTOM: 1px solid
}
SPAN.Instructions {
=09
}
DIV.ExerciseText {
=09
}
.FeedbackText {
	COLOR: #000080
}
SPAN.LeftItem {
	FONT-SIZE: small; COLOR: #000000
}
SPAN.RightItem {
	FONT-WEIGHT: bold; FONT-SIZE: small; COLOR: #000000
}
SPAN.CorrectMark {
=09
}
DIV.Feedback {
	BORDER-RIGHT: 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: 1px solid; =
DISPLAY: none; PADDING-LEFT: 5px; FONT-SIZE: small; Z-INDEX: 1; LEFT: =
33%; PADDING-BOTTOM: 5px; BORDER-LEFT: 1px solid; WIDTH: 34%; COLOR: =
#000080; PADDING-TOP: 5px; BORDER-BOTTOM: 1px solid; POSITION: absolute; =
TOP: 33%; BACKGROUND-COLOR: #fdfede; TEXT-ALIGN: center
}
DIV.LeftContainer {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; MARGIN-BOTTOM: 0px; =
PADDING-BOTTOM: 2px; WIDTH: 49.8%; BORDER-TOP-STYLE: none; PADDING-TOP: =
2px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; =
BORDER-BOTTOM-STYLE: none
}
DIV.RightContainer {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; MARGIN-BOTTOM: =
0px; PADDING-BOTTOM: 2px; WIDTH: 49.8%; BORDER-TOP-STYLE: none; =
PADDING-TOP: 2px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; =
BORDER-BOTTOM-STYLE: none
}
.ReadingText {
=09
}
DIV.ExerciseDiv {
	COLOR: #000000
}
TABLE.FlashcardTable {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-COLOR: #000000; =
BORDER-BOTTOM-COLOR: #000000; PADDING-BOTTOM: 0px; MARGIN: 2em 5%; =
WIDTH: 90%; COLOR: #000000; BORDER-TOP-COLOR: #000000; PADDING-TOP: 0px; =
POSITION: relative; BACKGROUND-COLOR: transparent; BORDER-RIGHT-COLOR: =
#000000; align: center
}
TABLE.FlashcardTable TR {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: =
0px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; =
BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM-STYLE: =
none
}
TABLE.FlashcardTable TD.Showing {
	BORDER-RIGHT: 1px solid; PADDING-RIGHT: 2em; BORDER-TOP: 1px solid; =
PADDING-LEFT: 2em; FONT-SIZE: large; PADDING-BOTTOM: 2em; MARGIN: 0px; =
BORDER-LEFT: 1px solid; WIDTH: 50%; COLOR: #000000; PADDING-TOP: 2em; =
BORDER-BOTTOM: 1px solid; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center
}
TABLE.FlashcardTable TD.Hidden {
	DISPLAY: none
}
DIV#SegmentDiv {
	MARGIN-TOP: 2em; MARGIN-BOTTOM: 2em; TEXT-ALIGN: center
}
A.ExSegment {
	FONT-WEIGHT: bold; FONT-SIZE: medium; COLOR: #000000; TEXT-DECORATION: =
none
}
SPAN.RemainingWordList {
	FONT-STYLE: italic
}
DIV.DropLine {
	WIDTH: 80%; BORDER-BOTTOM: #000080 1px solid; POSITION: absolute; =
TEXT-ALIGN: center
}
INPUT {
	FONT-SIZE: larger; FONT-FAMILY: Geneva,Arial
}
.ClozeWordList {
	FONT-WEIGHT: bold; TEXT-ALIGN: center
}
DIV.ClozeBody {
	MARGIN-TOP: 2em; MARGIN-BOTTOM: 2em; LINE-HEIGHT: 2; TEXT-ALIGN: left
}
SPAN.GapSpan {
	FONT-WEIGHT: bold
}
TABLE.CrosswordGrid {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: =
auto auto 1em; PADDING-TOP: 0px; BORDER-COLLAPSE: collapse
}
TABLE.CrosswordGrid TD {
	BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: =
#000000 1px solid; PADDING-LEFT: 0px; FONT-SIZE: large; PADDING-BOTTOM: =
0px; MARGIN: 0px; VERTICAL-ALIGN: middle; BORDER-LEFT: #000000 1px =
solid; WIDTH: 1.5em; PADDING-TOP: 0px; BORDER-BOTTOM: #000000 1px solid; =
HEIGHT: 1.5em; TEXT-ALIGN: center
}
TABLE.CrosswordGrid TD.BlankCell {
	COLOR: #000000; BACKGROUND-COLOR: #000000
}
TABLE.CrosswordGrid TD.LetterOnlyCell {
	FONT-WEIGHT: bold; VERTICAL-ALIGN: middle; COLOR: #000000; =
BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center
}
TABLE.CrosswordGrid TD.NumLetterCell {
	PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FONT-WEIGHT: bold; =
PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; COLOR: #000000; PADDING-TOP: =
1px; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left
}
.NumLetterCellText {
	CURSOR: pointer
}
.GridNum {
	FONT-WEIGHT: bold; FONT-SIZE: x-small; VERTICAL-ALIGN: super; COLOR: =
#000000; TEXT-DECORATION: none
}
TABLE#Clues {
	MARGIN: auto; VERTICAL-ALIGN: top
}
TABLE#Clues TD {
	VERTICAL-ALIGN: top
}
TABLE.ClueList {
	MARGIN: auto
}
TD.ClueNum {
	FONT-WEIGHT: bold; VERTICAL-ALIGN: top; TEXT-ALIGN: right
}
TD.Clue {
	TEXT-ALIGN: left
}
DIV#ClueEntry {
	MARGIN-BOTTOM: 1em; TEXT-ALIGN: left
}
DIV.Keypad {
	TEXT-ALIGN: center
}
DIV.Keypad BUTTON {
	FONT-SIZE: 120%; WIDTH: 2em; COLOR: #000000; FONT-FAMILY: Geneva,Arial; =
BACKGROUND-COLOR: #ffffff
}
DIV.QuestionNavigation {
	TEXT-ALIGN: center
}
.QNum {
	FONT-WEIGHT: bold; MARGIN: 0em 1em 0.5em; VERTICAL-ALIGN: middle
}
TEXTAREA {
	FONT-SIZE: larger; FONT-FAMILY: Geneva,Arial
}
.QuestionText {
=09
}
.Answer {
	FONT-SIZE: 120%; LETTER-SPACING: 0.1em
}
.Highlight {
	FONT-WEIGHT: bold; FONT-SIZE: 120%; COLOR: #000000; BACKGROUND-COLOR: =
#ffff00
}
OL.QuizQuestions {
	LIST-STYLE-TYPE: none; TEXT-ALIGN: left
}
LI.QuizQuestion {
	BORDER-RIGHT: 0px solid; PADDING-RIGHT: 1em; BORDER-TOP: 0px solid; =
PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; BORDER-LEFT: 0px solid; =
PADDING-TOP: 1em; BORDER-BOTTOM: 1px solid
}
OL.MCAnswers {
	PADDING-RIGHT: 1em; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; =
PADDING-TOP: 1em; LIST-STYLE-TYPE: upper-alpha; TEXT-ALIGN: left
}
OL.MCAnswers LI {
	MARGIN-BOTTOM: 1em
}
OL.MSelAnswers {
	PADDING-RIGHT: 1em; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; =
PADDING-TOP: 1em; LIST-STYLE-TYPE: lower-alpha; TEXT-ALIGN: left
}
DIV.ShortAnswer {
	PADDING-RIGHT: 1em; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; =
PADDING-TOP: 1em
}
DIV.StdDiv {
	BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: =
#000000 1px solid; PADDING-LEFT: 8px; FONT-SIZE: small; PADDING-BOTTOM: =
8px; MARGIN: 1px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; =
PADDING-TOP: 8px; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: =
#ffffff; TEXT-ALIGN: center
}
.FuncButton {
	BORDER-RIGHT: #7f7f7f 2px solid; PADDING-RIGHT: 6px; BORDER-TOP: =
#ffffff 2px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 3px; BORDER-LEFT: =
#ffffff 2px solid; CURSOR: pointer; COLOR: #000000; PADDING-TOP: 3px; =
BORDER-BOTTOM: #7f7f7f 2px solid; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: =
center
}
.FuncButtonUp {
	BORDER-RIGHT: #7f7f7f 2px solid; PADDING-RIGHT: 6px; BORDER-TOP: =
#ffffff 2px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 3px; BORDER-LEFT: =
#ffffff 2px solid; CURSOR: pointer; COLOR: #ffffff; PADDING-TOP: 3px; =
BORDER-BOTTOM: #7f7f7f 2px solid; BACKGROUND-COLOR: #000000; TEXT-ALIGN: =
center
}
.FuncButtonDown {
	BORDER-RIGHT: #ffffff 2px solid; PADDING-RIGHT: 6px; BORDER-TOP: =
#7f7f7f 2px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 3px; BORDER-LEFT: =
#7f7f7f 2px solid; CURSOR: pointer; COLOR: #ffffff; PADDING-TOP: 3px; =
BORDER-BOTTOM: #ffffff 2px solid; BACKGROUND-COLOR: #000000; TEXT-ALIGN: =
center
}
DIV.NavButtonBar {
	CLEAR: both; FONT-SIZE: small; MARGIN: 2px 0px; BACKGROUND-COLOR: =
#215e21; TEXT-ALIGN: center
}
.NavButton {
	BORDER-RIGHT: #102f10 2px solid; BORDER-TOP: #90ae90 2px solid; =
BORDER-LEFT: #90ae90 2px solid; CURSOR: pointer; COLOR: #ffffff; =
BORDER-BOTTOM: #102f10 2px solid; BACKGROUND-COLOR: #215e21
}
.NavButtonUp {
	BORDER-RIGHT: #102f10 2px solid; BORDER-TOP: #90ae90 2px solid; =
BORDER-LEFT: #90ae90 2px solid; CURSOR: pointer; COLOR: #215e21; =
BORDER-BOTTOM: #102f10 2px solid; BACKGROUND-COLOR: #ffffff
}
.NavButtonDown {
	BORDER-RIGHT: #90ae90 2px solid; BORDER-TOP: #102f10 2px solid; =
BORDER-LEFT: #102f10 2px solid; CURSOR: pointer; COLOR: #215e21; =
BORDER-BOTTOM: #90ae90 2px solid; BACKGROUND-COLOR: #ffffff
}
A {
	COLOR: #0000ff
}
UNKNOWN {
	COLOR: #0000cc
}
A:hover {
	COLOR: #0000ff
}
DIV.CardStyle {
	BORDER-RIGHT: 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: 1px solid; =
PADDING-LEFT: 5px; FONT-SIZE: small; LEFT: -50px; PADDING-BOTTOM: 5px; =
OVERFLOW: visible; BORDER-LEFT: 1px solid; COLOR: #000000; PADDING-TOP: =
5px; BORDER-BOTTOM: 1px solid; FONT-FAMILY: Geneva,Arial; POSITION: =
absolute; TOP: -50px; BACKGROUND-COLOR: #ffffff
}
.rtl {
	FONT-SIZE: large; TEXT-ALIGN: right
}
</STYLE>

<SCRIPT type=3Dtext/javascript>

//<![CDATA[

<!--


function Client(){
//if not a DOM browser, hopeless
	this.min =3D false; if (document.getElementById){this.min =3D true;};

	this.ua =3D navigator.userAgent;
	this.name =3D navigator.appName;
	this.ver =3D navigator.appVersion; =20

//Get data about the browser
	this.mac =3D (this.ver.indexOf('Mac') !=3D -1);
	this.win =3D (this.ver.indexOf('Windows') !=3D -1);

//Look for Gecko
	this.gecko =3D (this.ua.indexOf('Gecko') > 1);
	if (this.gecko){
		this.geckoVer =3D =
parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
		if (this.geckoVer < 20020000){this.min =3D false;}
	}
=09
//Look for Firebird
	this.firebird =3D (this.ua.indexOf('Firebird') > 1);
=09
//Look for Safari
	this.safari =3D (this.ua.indexOf('Safari') > 1);
	if (this.safari){
		this.gecko =3D false;
	}
=09
//Look for IE
	this.ie =3D (this.ua.indexOf('MSIE') > 0);
	if (this.ie){
		this.ieVer =3D parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, =
this.ua.length));
		if (this.ieVer < 5.5){this.min =3D false;}
	}
=09
//Look for Opera
	this.opera =3D (this.ua.indexOf('Opera') > 0);
	if (this.opera){
		this.operaVer =3D =
parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, =
this.ua.length));
		if (this.operaVer < 7.04){this.min =3D false;}
	}
	if (this.min =3D=3D false){
		alert('Your browser may not be able to handle this page.');
	}
=09
//Special case for the horrible ie5mac
	this.ie5mac =3D (this.ie&&this.mac&&(this.ieVer<6));
}

var C =3D 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 !=3D 'NavButtonDown'){Btn.className =3D =
'NavButtonUp';}
}

function NavBtnOut(Btn){
	Btn.className =3D 'NavButton';
}

function NavBtnDown(Btn){
	Btn.className =3D 'NavButtonDown';
}
//[/strNavBarJS]

function FuncBtnOver(Btn){
	if (Btn.className !=3D 'FuncButtonDown'){Btn.className =3D =
'FuncButtonUp';}
}

function FuncBtnOut(Btn){
	Btn.className =3D 'FuncButton';
}

function FuncBtnDown(Btn){
	Btn.className =3D 'FuncButtonDown';
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') !=3D null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		if (document.getElementById('CheckButton2') !=3D null){
			document.getElementById('CheckButton2').focus();
		}
		else{
			document.getElementsByTagName('button')[0].focus();
		}
	}
}




//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX

var topZ =3D 1000;

function ShowMessage(Feedback){
	var Output =3D Feedback + '<br /><br />';
	document.getElementById('FeedbackContent').innerHTML =3D Output;
	var FDiv =3D document.getElementById('FeedbackDiv');
	topZ++;
	FDiv.style.zIndex =3D topZ;
	FDiv.style.top =3D 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 =3D 'block';

	ShowElements(false, 'input');
	ShowElements(false, 'select');
	ShowElements(false, 'object');
	if (C.ie){
		document.getElementById('FeedbackOKButton').focus();
	}
=09
//
}

function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show =
through the popup
	if (C.ie){
		var Els =3D document.getElementsByTagName(TagName);
		for (var i=3D0; i<Els.length; i++){
			if (Show =3D=3D true){
				Els[i].style.display =3D 'inline';
			}
			else{
				Els[i].style.display =3D 'none';
			}
		}
	}=20
}

function HideFeedback(){
	document.getElementById('FeedbackDiv').style.display =3D 'none';
	ShowElements(true, 'input');
	ShowElements(true, 'select');
	ShowElements(true, 'object');
	if (Finished =3D=3D true){
		Finish();
	}
}


//GENERAL UTILITY FUNCTIONS AND VARIABLES

//PAGE DIMENSION FUNCTIONS
function PageDim(){
//Get the page width and height
	this.W =3D 600;
	this.H =3D 400;
	this.W =3D document.getElementsByTagName('body')[0].clientWidth;
	this.H =3D document.getElementsByTagName('body')[0].clientHeight;
}

var pg =3D null;

function GetPageXY(El) {
	var XY =3D {x: 0, y: 0};
	while(El){
		XY.x +=3D El.offsetLeft;
		XY.y +=3D El.offsetTop;
		El =3D 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 =3D Math.floor(GetViewportHeight() * (TopPercent/100));
	return GetScrollTop() + T;=20
}

//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES =
history.back()
var InTextBox =3D false;

function SuppressBackspace(e){=20
	if (InTextBox =3D=3D true){return;}
	if (C.ie) {
		thisKey =3D window.event.keyCode;
	}
	else {
		thisKey =3D e.keyCode;
	}

	var Suppress =3D false;

	if (thisKey =3D=3D 8) {
		Suppress =3D true;
	}

	if (Suppress =3D=3D true){
		if (C.ie){
			window.event.returnValue =3D false;=09
			window.event.cancelBubble =3D 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=3D0;
	var j=3D0;
	while (InArray.length > ReduceToSize){
		ItemToDump =3D Math.floor(InArray.length*Math.random());
		InArray.splice(ItemToDump, 1);
	}
}

function Shuffle(InArray){
	Temp =3D new Array();
	var Len =3D InArray.length;

	var j =3D Len;

	for (var i=3D0; i<Len; i++){
		Temp[i] =3D InArray[i];
	}

	for (i=3D0; i<Len; i++){
		Num =3D Math.floor(j  *  Math.random());
		InArray[i] =3D Temp[Num];

		for (var k=3DNum; k < j; k++) {
			Temp[k] =3D Temp[k+1];
		}
		j--;
	}
	return InArray;
}

function WriteToInstructions(Feedback) {
//	Feedback =3D '<span class=3D"FeedbackText">' + Feedback + '</span>';
	document.getElementById('InstructionsDiv').innerHTML =3D Feedback;

}




function EscapeDoubleQuotes(InString){
	return InString.replace(/"/g, '&quot;')
}

function FocusAButton(){
	if (document.getElementById('CheckButton1') !=3D null){
		document.getElementById('CheckButton1').focus();
	}
	else{
		document.getElementsByTagName('button')[0].focus();
	}
}

function TrimString(InString){
        var x =3D 0;

        if (InString.length !=3D 0) {
                while ((InString.charAt(InString.length - 1) =3D=3D =
'\u0020') || (InString.charAt(InString.length - 1) =3D=3D '\u000A') || =
(InString.charAt(InString.length - 1) =3D=3D '\u000D')){
                        InString =3D InString.substring(0, =
InString.length - 1)
                }

                while ((InString.charAt(0) =3D=3D '\u0020') || =
(InString.charAt(0) =3D=3D '\u000A') || (InString.charAt(0) =3D=3D =
'\u000D')){
                        InString =3D InString.substring(1, =
InString.length)
                }

                while (InString.indexOf('  ') !=3D -1) {
                        x =3D InString.indexOf('  ')
                        InString =3D 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 =3D 0;
	for (var i=3D1; i<InArray.length; i++){
		if (InArray[i].length > InArray[Longest].length){
			Longest =3D i;
		}
	}
	return Longest;
}

//UNICODE CHARACTER FUNCTIONS
function IsCombiningDiacritic(CharNum){
	var Result =3D (((CharNum >=3D 0x0300)&&(CharNum <=3D =
0x370))||((CharNum >=3D 0x20d0)&&(CharNum <=3D 0x20ff)));
	Result =3D Result || (((CharNum >=3D 0x3099)&&(CharNum <=3D =
0x309a))||((CharNum >=3D 0xfe20)&&(CharNum <=3D 0xfe23)));
	return Result;
}

function IsCJK(CharNum){
	return ((CharNum >=3D 0x3000)&&(CharNum < 0xd800));
}

//SETUP FUNCTIONS
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
function ClearTextBoxes(){
	var NList =3D document.getElementsByTagName('input');
	for (var i=3D0; i<NList.length; i++){
		if (NList[i].id.indexOf('Guess') > -1){
			NList[i].value =3D '';
		}
		if (NList[i].id.indexOf('Chk') > -1){
			NList[i].checked =3D '';
		}
	}
}

//EXTENSION TO ARRAY OBJECT
function Array_IndexOf(Input){
	var Result =3D -1;
	for (var i=3D0; i<this.length; i++){
		if (this[i] =3D=3D Input){
			Result =3D i;
		}
	}
	return Result;
}
Array.prototype.indexOf =3D Array_IndexOf;

//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
function RemoveBottomNavBarForIE(){
	if ((C.ie)&&(document.getElementById('Reading') !=3D null)){
		if (document.getElementById('BottomNavBar') !=3D null){
			=
document.getElementById('TheBody').removeChild(document.getElementById('B=
ottomNavBar'));
		}
	}
}




//HOTPOTNET-RELATED CODE

var HPNStartTime =3D (new Date()).getTime();
var SubmissionTimeout =3D 30000;
var Detail =3D ''; //Global that is used to submit tracking data

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store !=3D null){
		Frm =3D document.store;
		Frm.starttime.value =3D HPNStartTime;
		Frm.endtime.value =3D (new Date()).getTime();
		Frm.mark.value =3D Score;
		Frm.detail.value =3D Detail;
		Frm.submit();
	}
}



//JQUIZ CORE JAVASCRIPT CODE

var CurrQNum =3D 0;
var CorrectIndicator =3D ':-)';
var IncorrectIndicator =3D 'X';
var YourScoreIs =3D 'Your score is: ';
var ContinuousScoring =3D true;
var CorrectFirstTime =3D 'Questions answered correctly first time: ';
var ShowCorrectFirstTime =3D false;
var ShuffleQs =3D true;
var ShuffleAs =3D true;
var DefaultRight =3D 'Correct!';
var DefaultWrong =3D 'Sorry! Try again.';
var QsToShow =3D 5;
var Score =3D 0;
var Finished =3D false;
var Qs =3D null;
var QArray =3D new Array();
var ShowingAllQuestions =3D false;
var ShowAllQuestionsCaption =3D 'Show all questions';
var ShowOneByOneCaption =3D 'Show questions one by one';
var State =3D new Array();
var Feedback =3D '';
var TimeOver =3D 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 =3D '';

function CompleteEmptyFeedback(){
	var QNum, ANum;
	for (QNum=3D0; QNum<I.length; QNum++){
//Only do this if not multi-select
		if (I[QNum][2] !=3D '3'){
  		for (ANum =3D 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] =3D DefaultRight;
  				}
  				else{
  					I[QNum][3][ANum][1] =3D DefaultWrong;
  				}
  			}
  		}
		}
	}
}

function SetUpQuestions(){
	var AList =3D new Array();=20
	var QList =3D new Array();
	var i, j;
	Qs =3D document.getElementById('Questions');
	while (Qs.getElementsByTagName('li').length > 0){
		QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
	}
	var DumpItem =3D 0;
	while (QsToShow < QList.length){
		DumpItem =3D Math.floor(QList.length*Math.random());
		for (j=3DDumpItem; j<(QList.length-1); j++){
			QList[j] =3D QList[j+1];
		}
		QList.length =3D QList.length-1;
	}
	if (ShuffleQs =3D=3D true){
		QList =3D Shuffle(QList);
	}
	if (ShuffleAs =3D=3D true){
		var As;
		for (var i=3D0; i<QList.length; i++){
			As =3D QList[i].getElementsByTagName('ol')[0];
			if (As !=3D null){
  			AList.length =3D 0;
				while (As.getElementsByTagName('li').length > 0){
					AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
				}
				AList =3D Shuffle(AList);
				for (j=3D0; j<AList.length; j++){
					As.appendChild(AList[j]);
				}
			}
		}
	}
=09
	for (i=3D0; i<QList.length; i++){
		Qs.appendChild(QList[i]);
		QArray[QArray.length] =3D QList[i];
	}

//Show the first item
	QArray[0].style.display =3D '';
=09
//Now hide all except the first item
	for (i=3D1; i<QArray.length; i++){
		QArray[i].style.display =3D 'none';
	}	=09
	SetQNumReadout();
}

function ChangeQ(ChangeBy){
	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >=3D =
QArray.length)){return;}
	QArray[CurrQNum].style.display =3D 'none';
	CurrQNum +=3D ChangeBy;
	QArray[CurrQNum].style.display =3D '';
	SetQNumReadout();
//if there's a textbox, set the focus in it
	if (QArray[CurrQNum].getElementsByTagName('input')[0] !=3D null){
		QArray[CurrQNum].getElementsByTagName('input')[0].focus();
	}
}

function SetQNumReadout(){
	document.getElementById('QNumReadout').innerHTML =3D (CurrQNum+1) + ' / =
' + QArray.length;
}

I=3Dnew Array();
I[0]=3Dnew Array();I[0][0]=3D100;
I[0][1]=3D'';
I[0][2]=3D'1';
I[0][3]=3Dnew Array();
I[0][3][0]=3Dnew Array('.06','',1,100,1);
I[0][3][1]=3Dnew Array('0.06','',1,100,1);
I[0][3][2]=3Dnew Array('0.060','',1,100,1);
I[0][3][3]=3Dnew Array('0.0600','',1,100,1);
I[1]=3Dnew Array();I[1][0]=3D100;
I[1][1]=3D'';
I[1][2]=3D'1';
I[1][3]=3Dnew Array();
I[1][3][0]=3Dnew Array('.17','',1,100,1);
I[1][3][1]=3Dnew Array('0.17','',1,100,1);
I[1][3][2]=3Dnew Array('0.170','',1,100,1);
I[1][3][3]=3Dnew Array('0.1700','',1,100,1);
I[2]=3Dnew Array();I[2][0]=3D100;
I[2][1]=3D'';
I[2][2]=3D'1';
I[2][3]=3Dnew Array();
I[2][3][0]=3Dnew Array('.34','',1,100,1);
I[2][3][1]=3Dnew Array('0.34','',1,100,1);
I[2][3][2]=3Dnew Array('0.340','',1,100,1);
I[2][3][3]=3Dnew Array('0.3400','',1,100,1);
I[3]=3Dnew Array();I[3][0]=3D100;
I[3][1]=3D'';
I[3][2]=3D'1';
I[3][3]=3Dnew Array();
I[3][3][0]=3Dnew Array('.46','',1,100,1);
I[3][3][1]=3Dnew Array('0.46','',1,100,1);
I[3][3][2]=3Dnew Array('0.460','',1,100,1);
I[3][3][3]=3Dnew Array('0.4600','',1,100,1);
I[4]=3Dnew Array();I[4][0]=3D100;
I[4][1]=3D'';
I[4][2]=3D'1';
I[4][3]=3Dnew Array();
I[4][3][0]=3Dnew Array('.58','',1,100,1);
I[4][3][1]=3Dnew Array('0.58','',1,100,1);
I[4][3][2]=3Dnew Array('0.580','',1,100,1);
I[4][3][3]=3Dnew Array('0.5800','',1,100,1);


function StartUp(){
	RemoveBottomNavBarForIE();

//If there's only one question, no need for question navigation controls
	if (QsToShow < 2){
		document.getElementById('QNav').style.display =3D 'none';
	}
=09

=09

=09
	CompleteEmptyFeedback();

	SetUpQuestions();
	ClearTextBoxes();
	CreateStatusArray();
=09

	setTimeout('StartTimer()', 50);

=09
//Check search string for q parameter
	if (document.location.search.length > 0){
		if (ShuffleQs =3D=3D false){
			var JumpTo =3D =
parseInt(document.location.search.substring(1,document.location.search.le=
ngth))-1;
			if (JumpTo <=3D QsToShow){
				ChangeQ(JumpTo);
			}
		}
	}
}

function ShowHideQuestions(){
	FuncBtnOut(document.getElementById('ShowMethodButton'));
	document.getElementById('ShowMethodButton').style.display =3D 'none';
	if (ShowingAllQuestions =3D=3D false){
		for (var i=3D0; i<QArray.length; i++){
				QArray[i].style.display =3D '';
			}
		document.getElementById('Questions').style.listStyleType =3D =
'decimal';
		document.getElementById('OneByOneReadout').style.display =3D 'none';
		document.getElementById('ShowMethodButton').innerHTML =3D =
ShowOneByOneCaption;
		ShowingAllQuestions =3D true;
	}
	else{
		for (var i=3D0; i<QArray.length; i++){
				if (i !=3D CurrQNum){
					QArray[i].style.display =3D 'none';
				}
			}
		document.getElementById('Questions').style.listStyleType =3D 'none';
		document.getElementById('OneByOneReadout').style.display =3D '';
		document.getElementById('ShowMethodButton').innerHTML =3D =
ShowAllQuestionsCaption;
		ShowingAllQuestions =3D false;=09
	}
	document.getElementById('ShowMethodButton').style.display =3D 'inline';
}

function CreateStatusArray(){
	var QNum, ANum;
//For each item in the item array
	for (QNum=3D0; QNum<I.length; QNum++){
//Check if the question still exists (hasn't been nuked by showing a =
random selection)
		if (document.getElementById('Q_' + QNum) !=3D null){
			State[QNum] =3D new Array();
			State[QNum][0] =3D -1; //Score for this q; -1 shows question not done =
yet
			State[QNum][1] =3D new Array(); //answers
			for (ANum =3D 0; ANum<I[QNum][3].length; ANum++){
				State[QNum][1][ANum] =3D 0; //answer not chosen yet; when chosen, =
will store its position in the series of choices
			}
			State[QNum][2] =3D 0; //tries at this q so far
			State[QNum][3] =3D 0; //incrementing percent-correct values of =
selected answers
			State[QNum][4] =3D 0; //penalties incurred for hints
			State[QNum][5] =3D ''; //Sequence of answers chosen by number
		}
		else{
			State[QNum] =3D null;
		}
	}
}





function CalculateOverallScore(){
	var TotalWeighting =3D 0;
	var TotalScore =3D 0;
=09
	for (var QNum=3D0; QNum<State.length; QNum++){
		if (State[QNum] !=3D null){
			if (State[QNum][0] > -1){
				TotalWeighting +=3D I[QNum][0];
				TotalScore +=3D (I[QNum][0] * State[QNum][0]);
			}
		}
	}
	Score =3D Math.floor((TotalScore/TotalWeighting)*100);
}

function CheckFinished(){
	var FB =3D '';
	var AllDone =3D true;
	for (var QNum=3D0; QNum<State.length; QNum++){
		if (State[QNum] !=3D null){
			if (State[QNum][0] < 0){
				AllDone =3D false;
			}
		}
	}
	if (AllDone =3D=3D true){
=09
//Report final score and submit if necessary
		CalculateOverallScore();
		FB =3D YourScoreIs + ' ' + Score + '%.';
		if (ShowCorrectFirstTime =3D=3D true){
			var CFT =3D 0;
			for (QNum=3D0; QNum<State.length; QNum++){
				if (State[QNum] !=3D null){
					if (State[QNum][0] >=3D 1){
						CFT++;
					}
				}
			}
			FB +=3D '<br />' + CorrectFirstTime + ' ' + CFT + '/' + QsToShow;
		}
		WriteToInstructions(FB);
	=09
		Finished =3D=3D true;

		window.clearInterval(Interval);

		TimeOver =3D true;
		Locked =3D true;
	=09


		Finished =3D true;
		Detail =3D '<?xml version=3D"1.0"?><hpnetresult><fields>';
		for (QNum=3D0; QNum<State.length; QNum++){
			if (State[QNum] !=3D null){
				if (State[QNum][5].length > 0){
					Detail +=3D '<field><fieldname>Question #' + (QNum+1) + =
'</fieldname><fieldtype>question-tracking</fieldtype><fieldlabel>Q ' + =
(QNum+1) + =
'</fieldlabel><fieldlabelid>QuestionTrackingField</fieldlabelid><fielddat=
a>' + State[QNum][5] + '</fielddata></field>';
				}
			}
		}
		Detail +=3D '</fields></hpnetresult>';
		setTimeout('Finish()', SubmissionTimeout);
	}
}


function TimesUp(){
	document.getElementById('Timer').innerHTML =3D 'Your time is over!';

	TimeOver =3D true;
	Finished =3D true;
	ShowMessage('Your time is over!');
=09
//Set all remaining scores to 0
	for (var QNum=3D0; QNum<State.length; QNum++){
		if (State[QNum] !=3D null){
			if (State[QNum][0] < 0){
				State[QNum][0] =3D 0;
			}
		}
	}
	CheckFinished();
}




//CORE CODE FOR CHECKING SHORT ANSWER GUESSES AGAINST ANSWER ARRAYS

var CaseSensitive =3D false;
var ShowAlsoCorrect =3D true;
var PleaseEnter =3D 'Please enter a guess.';
var HybridTries =3D 2;
var PartlyIncorrect =3D 'Your answer is partly wrong: ';
var CorrectList =3D 'Correct answers: ';
var NextCorrect =3D 'Next correct letter in the answer: ';
var CurrBox =3D null;

function TrackFocus(BoxID){
	InTextBox =3D true;
	CurrBox =3D document.getElementById(BoxID);
}

function LeaveGap(){
	InTextBox =3D false;
}

function TypeChars(Chars){
	if (CurrBox !=3D null){
//		if (CurrBox.style.display !=3D 'none'){
			CurrBox.value +=3D Chars;
			CurrBox.focus();
//		}
	}
}

function CheckGuess(Guess, Answer, CaseSensitive, PercentCorrect, =
Feedback){
	this.Guess =3D Guess;
	this.Answer =3D Answer;
	this.PercentCorrect =3D PercentCorrect;
	this.Feedback =3D Feedback;
	if (CaseSensitive =3D=3D false){
		this.WorkingGuess =3D Guess.toLowerCase();
		this.WorkingAnswer =3D Answer.toLowerCase();
	}
	else{
		this.WorkingGuess =3D Guess;
		this.WorkingAnswer =3D Answer;			=09
	}
	this.Hint =3D '';
	this.HintPenalty =3D 1/Answer.length;
	this.CorrectStart =3D '';
	this.WrongMiddle =3D '';
	this.CorrectEnd =3D '';
	this.PercentMatch =3D 0;
	this.DoCheck();
}

function CheckGuess_DoCheck(){
//Check if it's an exact match
	if (this.WorkingAnswer =3D=3D this.WorkingGuess){
		this.PercentMatch =3D 100;
		this.CorrectStart =3D this.Guess;
	return;
	}
//Figure out how much of the beginning is correct
	var i =3D 0;
	var CorrectChars =3D 0;
	while (this.WorkingAnswer.charAt(i) =3D=3D =
this.WorkingGuess.charAt(i)){
		i++;
		CorrectChars++;
	}
//Stash the hint
	this.Hint =3D this.Answer.charAt(i);
=09
	this.CorrectStart =3D this.Guess.substring(0, i);
=09
//If there's more to the answer, look at the rest of it
	if (i<this.Guess.length){
=09
//Figure out how much of the end is correct
		var j =3D this.WorkingGuess.length-1;
		var k =3D this.WorkingAnswer.length-1;
		while ((j>=3Di)&&((this.WorkingAnswer.charAt(k) =3D=3D =
this.WorkingGuess.charAt(j))&&(CorrectChars < this.Answer.length))){
			CorrectChars++;
			j--;
			k--;
		}
		this.CorrectEnd =3D this.Guess.substring(j+1, this.Guess.length);
		this.WrongMiddle =3D this.Guess.substring(i, j+1);
	}
	if (TrimString(this.WrongMiddle).length < 1){this.WrongMiddle =3D '_';}
//Calculate match score based on how much of the guess is correct
	if (CorrectChars < this.Answer.length){
		this.PercentMatch =3D Math.floor(100*CorrectChars)/this.Answer.length;
	}
	else{
		this.PercentMatch =3D Math.floor((100 * =
CorrectChars)/this.Guess.length);
	}=09
}

CheckGuess.prototype.DoCheck =3D CheckGuess_DoCheck;

function CheckAnswerArray(CaseSensitive){
	this.CaseSensitive =3D CaseSensitive;
	this.Answers =3D new Array();
	this.Score =3D 0;
	this.Feedback =3D '';
	this.Hint =3D '';
	this.HintPenalty =3D 0;
	this.MatchedAnswerLength =3D 1;
	this.CompleteMatch =3D false;
	this.MatchNum =3D -1;
}

function CheckAnswerArray_AddAnswer(Guess, Answer, PercentCorrect, =
Feedback){
	this.Answers.push(new CheckGuess(Guess, Answer, this.CaseSensitive, =
PercentCorrect, Feedback));
}

CheckAnswerArray.prototype.AddAnswer =3D CheckAnswerArray_AddAnswer;

function CheckAnswerArray_ClearAll(){
	this.Answers.length =3D 0;
}

CheckAnswerArray.prototype.ClearAll =3D CheckAnswerArray_ClearAll;

function CheckAnswerArray_GetBestMatch(){
//First check for a 100% match
	for (var i=3D0; i<this.Answers.length; i++){
		if (this.Answers[i].PercentMatch =3D=3D 100){
			this.Feedback =3D this.Answers[i].Feedback;
			this.Score =3D this.Answers[i].PercentCorrect;
			this.CompleteMatch =3D true;
			this.MatchNum =3D i;
			return;
		}
	}
//Now check for the best alternative match
	var PercentMatch =3D 0;
	var BestMatch =3D -1;
	for (i=3D0; i<this.Answers.length; i++){
		if ((this.Answers[i].PercentMatch > =
PercentMatch)&&(this.Answers[i].PercentCorrect =3D=3D 100)){
			BestMatch =3D i;
			PercentMatch =3D this.Answers[i].PercentMatch;
		}
	}
	if (BestMatch > -1){
		this.Score =3D this.Answers[BestMatch].PercentMatch;
		this.Feedback =3D PartlyIncorrect + ' ';
		this.Feedback +=3D '<span class=3D"Answer">' + =
this.Answers[BestMatch].CorrectStart;
		this.Feedback +=3D '<span class=3D"Highlight">' + =
this.Answers[BestMatch].WrongMiddle + '</span>';
		this.Feedback +=3D this.Answers[BestMatch].CorrectEnd + '</span>';
		this.Hint =3D '<span class=3D"Answer">' + =
this.Answers[BestMatch].CorrectStart;
		this.Hint +=3D '<span class=3D"Highlight">' + =
this.Answers[BestMatch].Hint + '</span></span>';
		this.HintPenalty =3D this.Answers[BestMatch].HintPenalty;
	}
	else{
		this.Score =3D 0;
		this.Feedback =3D '';
	}
}

CheckAnswerArray.prototype.GetBestMatch =3D =
CheckAnswerArray_GetBestMatch;

function CheckShortAnswer(QNum){
//bail if question doesn't exist or exercise finished
	if ((State[QNum].length < 1)||(Finished =3D=3D true)){return;}
=09
//bail if question already complete
	if (State[QNum][0] > -1){return;}

//Get the guess
	var G =3D document.getElementById('Q_' + QNum + '_Guess').value;
=09
//If no guess, bail with message; no penalty
	if (G.length < 1){
		ShowMessage(PleaseEnter);
		return;
	}

//Increment tries
	State[QNum][2]++;
=09
//Create a check object
	var CA =3D new CheckAnswerArray(CaseSensitive);

	CA.ClearAll();
	for (var ANum=3D0; ANum<I[QNum][3].length; ANum++){
		CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], =
I[QNum][3][ANum][1]);
	}
	CA.GetBestMatch();
=09
//Store any match in the state tracking field
	if (CA.MatchNum > -1){
		State[QNum][5] +=3D String.fromCharCode(65+CA.MatchNum) + ',';
	}

//Add the percent correct value for this answer to the Q State (works =
for all
//situations, wrong or right
	State[QNum][3] +=3D CA.Score;
=09
//Now branch, based on the nature of the match
//Is it a complete match?
	if (CA.CompleteMatch =3D=3D true){
	=09
//Is it with a wrong answer, or a right answer?
		if (CA.Score =3D=3D 100){
//It's right
			CalculateShortAnsQuestionScore(QNum);
//Get correct answer list if required, assuming there are any other =
correct alternatives
			if (ShowAlsoCorrect =3D=3D true){
				var AlsoCorrectList =3D GetCorrectList(QNum, G, false);
				if (AlsoCorrectList.length > 0){
					CA.Feedback +=3D '<br />' + CorrectList + '<br />' +  '<span =
class=3D"Answer">' + AlsoCorrectList + '</span>';
				}
			}=09
	=09
//Get the overall score and add it to the feedback
			if (ContinuousScoring =3D=3D true){
				CalculateOverallScore();
				CA.Feedback +=3D '<br />' + YourScoreIs + ' ' + Score + '%.';
				WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
			}
			ShowMessage(CA.Feedback);
//Put the answer in
			ReplaceGuessBox(QNum, G);
			CheckFinished();
			return;
		}
	}
=09
//Otherwise, it's a match to a predicted wrong/partially correct, or a =
partial
//match to a right answer
	if (CA.Feedback.length < 1){CA.Feedback =3D DefaultWrong;}=20
	ShowMessage(CA.Feedback);

//If necessary, switch a hybrid question to m/c
	if (State[QNum][2] >=3D HybridTries){
		SwitchHybridDisplay(QNum);
	}
}

function CalculateShortAnsQuestionScore(QNum){
	var Tries =3D State[QNum][2] + State[QNum][4]; //include tries and hint =
penalties;
	var PercentCorrect =3D State[QNum][3];
	var HintPenalties =3D State[QNum][4];

//Make sure it's not already complete
	if (State[QNum][0] < 0){
		if (HintPenalties >=3D 1){
			State[QNum][0] =3D 0;
		}
		else{
			State[QNum][0] =3D (PercentCorrect/(100*Tries));
		}
		if (State[QNum][0] < 0){
			State[QNum][0] =3D 0;
		}
	}
}

function SwitchHybridDisplay(QNum){
	if (document.getElementById('Q_' + QNum + '_Hybrid_MC') !=3D null){
		document.getElementById('Q_' + QNum + '_Hybrid_MC').style.display =3D =
'';
		if (document.getElementById('Q_' + QNum + '_SA') !=3D null){
			document.getElementById('Q_' + QNum + '_SA').style.display =3D =
'none';
		}
	}
}

function GetCorrectArray(QNum){
	var Result =3D new Array();
	for (var ANum=3D0; ANum<I[QNum][3].length; ANum++){
		if (I[QNum][3][ANum][2] =3D=3D 1){ //This is an acceptable correct =
answer
			Result.push(I[QNum][3][ANum][0]);
		}
	}=09
	return Result;
}

function GetCorrectList(QNum, Answer, IncludeAnswer){
	var As =3D GetCorrectArray(QNum);
	var Result =3D '';
	for (var ANum=3D0; ANum<As.length; ANum++){
		if ((IncludeAnswer =3D=3D true)||(As[ANum] !=3D Answer)){
			Result +=3D As[ANum] + '<br />';
		}
	}
	return Result;
}

function GetFirstCorrectAnswer(QNum){
	var As =3D GetCorrectArray(QNum);
	if (As.length > 0){
		return As[0];
	}
	else{
		return '';
	}
}

function ReplaceGuessBox(QNum, Ans){
	if (document.getElementById('Q_' + QNum + '_SA') !=3D null){
		var El =3D document.getElementById('Q_' + QNum + '_SA');
		while (El.childNodes.length > 0){
			El.removeChild(El.childNodes[0]);
		}
		var A =3D document.createElement('span');
		A.setAttribute('class', 'Answer');
		var T =3D document.createTextNode(Ans);
		A.appendChild(T);
		El.appendChild(A);
	}
}



function ShowAnswers(QNum){
//bail if question doesn't exist or exercise finished
	if ((State[QNum].length < 1)||(Finished =3D=3D true)){return;}
=09
//Get the answer list to display
	var Ans =3D GetCorrectList(QNum, '', false);
	Ans =3D CorrectList + '<br /><span class=3D"Answer">' + Ans + =
'</span>';
=09
//Display feedback
	ShowMessage(Ans);
=09
//Set the score for this question to 0 if no=20
	if (State[QNum][0] < 1){
		State[QNum][0] =3D 0;
	}

//Get the first correct answer
	var FirstAns =3D GetFirstCorrectAnswer(QNum);
=09
//Replace the textbox
	ReplaceGuessBox(QNum, FirstAns);
=09
//This may be the last, so check finished status
	CheckFinished();
}





function ShowHint(QNum){
//bail if question doesn't exist or exercise finished
	if ((State[QNum].length < 1)||(Finished =3D=3D true)){return;}
=09
//bail if question already complete
	if (State[QNum][0] > -1){return;}

//Get the guess
	var G =3D document.getElementById('Q_' + QNum + '_Guess').value;
=09
//If no guess, give the first correct bit
	if (G.length < 1){
		var Ans =3D GetFirstCorrectAnswer(QNum);
		var Hint =3D Ans.charAt(0);
		ShowMessage(NextCorrect + '<br />' + Hint);
//Penalty for hint
		State[QNum][4] +=3D (1/Ans.length);
		return;
	}

//Increment tries
	State[QNum][2]++;
=09
//Create a check object
	var CA =3D new CheckAnswerArray(CaseSensitive);

	CA.ClearAll();
	for (var ANum=3D0; ANum<I[QNum][3].length; ANum++){
//Use only correct answers
		if (I[QNum][3][ANum][2] =3D=3D 1){
			CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], =
I[QNum][3][ANum][1]);
		}
	}
	CA.GetBestMatch();
	if (CA.CompleteMatch =3D=3D true){
//It's right!
		CheckShortAnswer(QNum);
		return;
	}
	else{
		if (CA.Hint.length > 0){
			ShowMessage(NextCorrect + '<br />' + CA.Hint);
			State[QNum][4] +=3D CA.HintPenalty;
		}
		else{
			ShowMessage(DefaultWrong + '<br />' + NextCorrect + '<br />' + =
GetFirstCorrectAnswer(QNum)[0]);
		}
	}
}








//CODE FOR HANDLING TIMER
//Timer code
var Seconds =3D 1800;
var Interval =3D null;

function StartTimer(){
	Interval =3D window.setInterval('DownTime()',1000);
	document.getElementById('TimerText').style.display =3D 'inline';
}

function DownTime(){
	var ss =3D Seconds % 60;
	if (ss<10){
		ss=3D'0' + ss + '';
	}

	var mm =3D Math.floor(Seconds / 60);

	if (document.getElementById('Timer') =3D=3D null){
		return;
	}

	document.getElementById('TimerText').innerHTML =3D mm + ':' + ss;
	if (Seconds < 1){
		window.clearInterval(Interval);
		TimeOver =3D true;
		TimesUp();
	}
	Seconds--;
}






//-->

//]]>

</SCRIPT>

<META content=3D"MSHTML 6.00.6000.16981" name=3DGENERATOR></HEAD>
<BODY id=3DTheBody onload=3DStartUp()><!-- BeginTopNavButtons -->
<DIV class=3DNavButtonBar id=3DTopNavBar><BUTTON =
onmouseup=3DNavBtnOut(this)=20
class=3DNavButton onmousedown=3DNavBtnDown(this) =
onblur=3DNavBtnOut(this)=20
onmouseover=3DNavBtnOver(this) onfocus=3DNavBtnOver(this) =
onclick=3Dwindow.close()=20
onmouseout=3DNavBtnOut(this)>Close Window</BUTTON> </DIV><!-- =
EndTopNavButtons -->
<DIV class=3DTitles>
<H2 class=3DExerciseTitle>Acid-Base Titration</H2>
<H3 class=3DExerciseSubtitle></H3>
<DIV id=3DTimer><SPAN id=3DTimerText>&nbsp;&nbsp;</SPAN></DIV></DIV>
<DIV class=3DStdDiv id=3DInstructionsDiv>
<P id=3DInstructions>Perform titrations to determine the [H<SUP>+</SUP>] =
of the=20
acids, A - E. The buret holds 50 ml of base. You cannot change =
concentrations of=20
base in the middle of a titration. <U><STRONG>Note:</STRONG> The button =
labeled=20
"0.10 ml" actually adds base in 0.20 ml amounts.</U></P></DIV>
<DIV class=3DLeftContainer>
<DIV class=3DStdDiv id=3DReading>
<DIV id=3DReadingDiv>
<H3 class=3DExerciseSubtitle></H3>
<P>
<DIV align=3Dcenter>
<OBJECT=20
codeBase=3Dhttp://download.macromedia.com/pub/shockwave/cabs/director/sw.=
cab#version=3D7,0,0,0=20
height=3D350 width=3D370 =
classid=3Dclsid:166B1BCA-3F9C-11CF-8075-444553540000><PARAM NAME=3D"src" =
VALUE=3D"TitrationHomework.dcr">
<br />	<br /> <embed src=3D"TitrationHomework.dcr"=20
pluginspage=3D"http://www.macromedia.com/shockwave/download/" =
width=3D"370"=20
height=3D"350"></embed></OBJECT><BR><BR>Flash simulation courtesy of <A=20
href=3D"http://colossus.chem.umass.edu/bvining/downloads/chemland2/index.=
html"=20
target=3Dnew>UMass Chemland Chemistry</A>.<BR></DIV>
<P></P></DIV></DIV></DIV>
<DIV class=3DRightContainer>
<DIV class=3DStdDiv id=3DMainDiv>
<DIV class=3DQuestionNavigation id=3DQNav>
<P style=3D"TEXT-ALIGN: right"><BUTTON onmouseup=3DFuncBtnOver(this)=20
class=3DFuncButton onmousedown=3DFuncBtnDown(this) id=3DShowMethodButton =

onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this) =
onfocus=3DFuncBtnOver(this)=20
onclick=3D"ShowHideQuestions(); return false;" =
onmouseout=3DFuncBtnOut(this)>Show=20
all questions</BUTTON> </P>
<DIV id=3DOneByOneReadout><BUTTON onmouseup=3DFuncBtnOver(this) =
class=3DFuncButton=20
onmousedown=3DFuncBtnDown(this) id=3DPrevQButton =
onblur=3DFuncBtnOut(this)=20
onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this)=20
onclick=3D"ChangeQ(-1); return false;" =
onmouseout=3DFuncBtnOut(this)>&lt;=3D</BUTTON>=20
<SPAN class=3DQNum id=3DQNumReadout>&nbsp;</SPAN><BUTTON =
onmouseup=3DFuncBtnOver(this)=20
class=3DFuncButton onmousedown=3DFuncBtnDown(this) id=3DNextQButton=20
onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this) =
onfocus=3DFuncBtnOver(this)=20
onclick=3D"ChangeQ(1); return false;" =
onmouseout=3DFuncBtnOut(this)>=3D&gt;</BUTTON>=20
<BR></DIV></DIV>
<OL class=3DQuizQuestions id=3DQuestions>
  <LI class=3DQuizQuestion id=3DQ_0 style=3D"DISPLAY: none">
  <P class=3DQuestionText>What is the [H<SUP>+</SUP>] of Acid A? Give a =
numerical=20
  answer only.</P>
  <DIV class=3DShortAnswer id=3DQ_0_SA>
  <FORM onsubmit=3D"return false;" action=3D"" method=3Dpost>
  <DIV><INPUT class=3DGapBox id=3DQ_0_Guess onblur=3DLeaveGap()=20
  onfocus=3D"TrackFocus('Q_0_Guess')" size=3D9></INPUT><BR><BR><BUTTON=20
  onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
  onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this)=20
  onfocus=3DFuncBtnOver(this) onclick=3DCheckShortAnswer(0)=20
  onmouseout=3DFuncBtnOut(this)>Check</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowHint(0)=20
  onmouseout=3DFuncBtnOut(this)>Hint</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowAnswers(0)=20
  onmouseout=3DFuncBtnOut(this)>Show answer</BUTTON></DIV></FORM></DIV>
  <LI class=3DQuizQuestion id=3DQ_1 style=3D"DISPLAY: none">
  <P class=3DQuestionText>What is the [H<SUP>+</SUP>] of Acid B? Give a =
numerical=20
  answer only.</P>
  <DIV class=3DShortAnswer id=3DQ_1_SA>
  <FORM onsubmit=3D"return false;" action=3D"" method=3Dpost>
  <DIV><INPUT class=3DGapBox id=3DQ_1_Guess onblur=3DLeaveGap()=20
  onfocus=3D"TrackFocus('Q_1_Guess')" size=3D9></INPUT><BR><BR><BUTTON=20
  onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
  onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this)=20
  onfocus=3DFuncBtnOver(this) onclick=3DCheckShortAnswer(1)=20
  onmouseout=3DFuncBtnOut(this)>Check</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowHint(1)=20
  onmouseout=3DFuncBtnOut(this)>Hint</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowAnswers(1)=20
  onmouseout=3DFuncBtnOut(this)>Show answer</BUTTON></DIV></FORM></DIV>
  <LI class=3DQuizQuestion id=3DQ_2 style=3D"DISPLAY: none">
  <P class=3DQuestionText>What is the [H<SUP>+</SUP>] of Acid C? Give a =
numerical=20
  answer only.</P>
  <DIV class=3DShortAnswer id=3DQ_2_SA>
  <FORM onsubmit=3D"return false;" action=3D"" method=3Dpost>
  <DIV><INPUT class=3DGapBox id=3DQ_2_Guess onblur=3DLeaveGap()=20
  onfocus=3D"TrackFocus('Q_2_Guess')" size=3D9></INPUT><BR><BR><BUTTON=20
  onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
  onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this)=20
  onfocus=3DFuncBtnOver(this) onclick=3DCheckShortAnswer(2)=20
  onmouseout=3DFuncBtnOut(this)>Check</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowHint(2)=20
  onmouseout=3DFuncBtnOut(this)>Hint</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowAnswers(2)=20
  onmouseout=3DFuncBtnOut(this)>Show answer</BUTTON></DIV></FORM></DIV>
  <LI class=3DQuizQuestion id=3DQ_3 style=3D"DISPLAY: none">
  <P class=3DQuestionText>What is the [H<SUP>+</SUP>] of Acid D? Give a =
numerical=20
  answer only.</P>
  <DIV class=3DShortAnswer id=3DQ_3_SA>
  <FORM onsubmit=3D"return false;" action=3D"" method=3Dpost>
  <DIV><INPUT class=3DGapBox id=3DQ_3_Guess onblur=3DLeaveGap()=20
  onfocus=3D"TrackFocus('Q_3_Guess')" size=3D9></INPUT><BR><BR><BUTTON=20
  onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
  onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this)=20
  onfocus=3DFuncBtnOver(this) onclick=3DCheckShortAnswer(3)=20
  onmouseout=3DFuncBtnOut(this)>Check</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowHint(3)=20
  onmouseout=3DFuncBtnOut(this)>Hint</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowAnswers(3)=20
  onmouseout=3DFuncBtnOut(this)>Show answer</BUTTON></DIV></FORM></DIV>
  <LI class=3DQuizQuestion id=3DQ_4 style=3D"DISPLAY: none">
  <P class=3DQuestionText>What is the [H<SUP>+</SUP>] of Acid E? Give a =
numerical=20
  answer only.</P>
  <DIV class=3DShortAnswer id=3DQ_4_SA>
  <FORM onsubmit=3D"return false;" action=3D"" method=3Dpost>
  <DIV><INPUT class=3DGapBox id=3DQ_4_Guess onblur=3DLeaveGap()=20
  onfocus=3D"TrackFocus('Q_4_Guess')" size=3D9></INPUT><BR><BR><BUTTON=20
  onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
  onblur=3DFuncBtnOut(this) onmouseover=3DFuncBtnOver(this)=20
  onfocus=3DFuncBtnOver(this) onclick=3DCheckShortAnswer(4)=20
  onmouseout=3DFuncBtnOut(this)>Check</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowHint(4)=20
  onmouseout=3DFuncBtnOut(this)>Hint</BUTTON><BUTTON =
onmouseup=3DFuncBtnOut(this)=20
  class=3DFuncButton onmousedown=3DFuncBtnDown(this) =
onblur=3DFuncBtnOut(this)=20
  onmouseover=3DFuncBtnOver(this) onfocus=3DFuncBtnOver(this) =
onclick=3DShowAnswers(4)=20
  onmouseout=3DFuncBtnOut(this)>Show =
answer</BUTTON></DIV></FORM></DIV></LI></OL>
<DIV class=3DKeypad></DIV></DIV></DIV>
<DIV class=3DFeedback id=3DFeedbackDiv>
<DIV class=3DFeedbackText id=3DFeedbackContent></DIV><BUTTON=20
onmouseup=3DFuncBtnOut(this) class=3DFuncButton =
onmousedown=3DFuncBtnDown(this)=20
id=3DFeedbackOKButton onblur=3DFuncBtnOut(this) =
onmouseover=3DFuncBtnOver(this)=20
onfocus=3DFuncBtnOver(this) onclick=3D"HideFeedback(); return false;"=20
onmouseout=3DFuncBtnOut(this)>&nbsp;OK&nbsp;</BUTTON> </DIV><!-- =
BeginBottomNavButtons -->
<DIV class=3DNavButtonBar id=3DBottomNavBar><BUTTON =
onmouseup=3DNavBtnOut(this)=20
class=3DNavButton onmousedown=3DNavBtnDown(this) =
onblur=3DNavBtnOut(this)=20
onmouseover=3DNavBtnOver(this) onfocus=3DNavBtnOver(this) =
onclick=3Dwindow.close()=20
onmouseout=3DNavBtnOut(this)>Close Window</BUTTON> </DIV><!-- =
EndBottomNavButtons --><!-- BeginSubmissionForm --><!-- =
EndSubmissionForm --></BODY></HTML>
