

//<![CDATA[

<!--

// BrowserCheck Object

function BrowserCheck() {
	var b = navigator.appName
//HBS extension
	this.mac = (navigator.appVersion.indexOf('Mac') != -1)
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
	this.CRAPBrowser = (this.ie && this.mac); //Cannot Resolve Addresses Properly
}

is = new BrowserCheck();

var LocFolder = GetFolder(window.location.href);
function GetFolder(LocPath){
	LocPath = ReplaceStuff('\'','%27',LocPath);
	var i = LocPath.lastIndexOf('/');
	if (i<0){i=LocPath.lastIndexOf('\\')};
	return LocPath.substring(0,i);
}

function CombineURLs(InURL){
	var i = InURL.indexOf('../');
	var s = LocFolder;
	while (i >- 1){
		s = GetFolder(s);
		InURL = InURL.substring(3,InURL.length);
		i = InURL.indexOf('../');
	}
	return s + '/' + InURL;
}

x = new Array();
function ResolveURLs(InText,Attribute){
	x.length=0;
	var Temp = InText.toLowerCase();
	var z;
	var AttLen = Attribute.length + 2;
	var y=Temp.lastIndexOf(Attribute + '="');
	while (y>-1){
		var sLoc = y+AttLen;
		if (Temp.substring(sLoc,sLoc+5) != 'http:'){
			x[x.length]=new Array();
			x[x.length-1][0] = sLoc;
			z = Temp.indexOf('"',sLoc);
			x[x.length-1][1] = z;
			x[x.length-1][2] = Temp.substring(sLoc,z);
		}
		Temp = Temp.substring(0,y);
		y=Temp.lastIndexOf(Attribute + '="');
	}
	for (var j=0; j<x.length; j++){
		InText = InText.substring(0,x[j][0]) + CombineURLs(x[j][2]) + InText.substring(x[j][1], InText.length);
	}
	return InText;
}

function ResolveAllURLs(Stuff){
	Stuff = ResolveURLs(Stuff,'href');
	Stuff = ResolveURLs(Stuff,'src');
	Stuff = ResolveURLs(Stuff,'parent.location');
	return Stuff;
}


var ExBGColor = '#bbbbee';



var PageBGColor = '#ffffff';



var NavBarColor = '#000066';


var TextColor = '#000000';
var CurrQNum = 0;
var ALetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var CorrectIndicator = ':-)';
var IncorrectIndicator = 'X';
var YourScoreIs = 'Your score is ';
var Tries = 0;
var CorrectChoices = 0;
var ContinuousScoring = true;
var CorrectFirstTime = 'Questions answered correctly first time: ';var ExerciseTitle = '50 Phrasal Verbs [break, call, do & get]';
var ExerciseSubtitle = 'Multiple-choice exercise';
var Instructions = 'Choose the correct answer for each question. Be sure to read the text at the top of the screen to see my comments to your answer!'; //'';
var ShuffleQs = true;
var ShuffleAs = true;
var DefaultRight = 'Correct!';
var DefaultWrong = 'Sorry! Try again.';
var QsToShow = 20;
var ShowOneByOne = false;
var ReadingURL = '';
var EraseFeedback = true;
var Score = 0;

var PreviousPage = history.length;







var NavBar='';


NavBar+='<tr><form name="NavButtons1" action=""><td bgcolor="#000066" align="center">';
NavBar+='<font face="Geneva,Arial" size="-1">';

NavBar+='<input type="button" value="&lt;=" onclick="parent.GoBack()"></input>';


NavBar+='<input type="button" value="Exercise Home Page" onclick=\'parent.location="welcome.html"\'></input>';


NavBar+='<input type="button" value="=&gt;" onclick=\'parent.location="welcome.html#verbs"\'></input>';
NavBar+='</font></td></form></tr>';
if (is.CRAPBrowser){NavBar=ResolveAllURLs(NavBar)};


var TitleCode = '<tr><td align="center" valign="middle" bgcolor="#ffffff">';
TitleCode += '<font size="+1" face="Geneva,Arial" color="#000033">' + ExerciseTitle + '</font><br />';
TitleCode += '<font size="-1" face="Geneva,Arial" color="#000033">' + ExerciseSubtitle + '<br />';
TitleCode += '</font></td></tr>';

var QButtonsOpener = '<table border="0" width="85%" cellpadding="10">';
QButtonsOpener += '<tr><td align="center" valign="middle"><form>';
QButtonsOpener += '<font size="+1"><input type="button" value="&lt;=" onclick="parent.ChangeQ(-1)"></input>';
var QButtonsCloser = '<input type="button" value="=&gt;" onclick="parent.ChangeQ(1)"></input>';
QButtonsCloser += '</font></form></td></tr></table>';

var TableOpener = '<form name="QForm">';
TableOpener += '<table border="0" width="85%">';
var QRow = '<tr><td valign="top" bgcolor="#bbbbee" align="right">';
QRow += '<font size="+1" face="Geneva,Arial" color="#000000">[QNumber]</font></td>';
QRow += '<td colspan="3" valign="top" bgcolor="#bbbbee"><font size="-1" face="Geneva,Arial" color="#000000">[Question]<br />&nbsp;';
QRow += '</font></td></tr>';

var ARow = '<tr><td></td><td valign="top" bgcolor="#bbbbee"><input type="text" value=" " size="3" name="FB_[QNum]_[ANum]"></input></td>';
ARow += '<td valign="top" bgcolor="#bbbbee"><input type="button" value="[ALetter]" OnClick="parent.CheckAnswer([QNum],[ANum])"></input></td>';
ARow += '<td width="100%" bgcolor="#bbbbee"><font size="-1" face="Geneva,Arial" color="#000000">[Ans]</font></td></tr>';

var MARow = '<tr><td></td><td valign="top" bgcolor="#bbbbee" colspan="3"><input type="checkbox" name="A_[QNum]_[ANum]" value="[Correct]"></input>';
MARow += '<font size="-1" face="Geneva,Arial" color="#000000">[Ans]</font></td></tr>';

var CheckButton = '<tr><td></td><td valign="top" bgcolor="#bbbbee" ><input type="button" value="Check"';
CheckButton += ' onclick="parent.CheckMulti([QNum])"></input></td></tr>';

TableCloser = '</table></form>';

function GoBack(){
	var BackSkip = history.length - PreviousPage;
	if (BackSkip > 0){
		history.go((BackSkip+1)*-1);
	}
	else{
		parent.history.back();
	}
}

function ReduceItems(){
	var ItemToDump=0;
	var j=0;
	while (I.length > QsToShow){
		ItemToDump = Math.floor(I.length*Math.random());
		for (j=ItemToDump; j<(I.length-1); j++){
			I[j] = I[j+1];
		}
		I.length = I.length-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 WriteFeedback(Feedback) {
	if (is.CRAPBrowser){Feedback=ResolveAllURLs(Feedback);}
//Build the output string
	var OutString = '';
	OutString += '<html>';
	OutString += '<body  background="" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000cc">';
	OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
	OutString += NavBar;
	if (Feedback.length>0){
		OutString += '<tr><td bgcolor="#bbbbee" align="center">'; 
		OutString += '<font face="Geneva,Arial" size="-1" color="#000000">';
		OutString += Feedback;
		OutString += '</font></td></tr>'
	}
	OutString += '</table></center></body></html>';
//Write it to the frame
	TopFrame.document.clear();
	TopFrame.document.open();
	TopFrame.document.write(OutString);
	TopFrame.document.close();
}

function StartUp(){




//Reduce array if required
	if (QsToShow < I.length){
		ReduceItems();
	}

//Shuffle stuff if required

	if (ShuffleQs == true){
		I = Shuffle(I);
	}

	if (ShuffleAs == true){
		for (var i=0; i<I.length; i++){
			I[i][1] = Shuffle(I[i][1]);
		}
	}

//Create arrays
	CreateStatusArrays();



//Show the first question or all of them
	if (ShowOneByOne == false){
		ShowAllQs();
	}
	else{
		ShowQuestion(CurrQNum);
	}

//Write the top frame
	WriteFeedback(Instructions);
}


I = new Array();

I[0] = new Array();
I[0][0]='The peace negotiations in the Middle East are always. . .';
I[0][1] = new Array();
I[0][1][0] = new Array();
I[0][1][0][0]='breaking down';
I[0][1][0][1]='Yes, this is so. Unfortunately, both grammatically and in reality.';
I[0][1][0][2] = 1;
I[0][1][1] = new Array();
I[0][1][1][0]='breaking up';
I[0][1][1][1]='No, we want the phrasal verb that means "collapse".';
I[0][1][1][2] = 0;
I[0][1][2] = new Array();
I[0][1][2][0]='breaking out';
I[0][1][2][1]='No, this would mean that peace negotiations suddenly START - they have been going on for ages.';
I[0][1][2][2] = 0;
I[0][1][3] = new Array();
I[0][1][3][0]='breaking off';
I[0][1][3][1]='No. This verb needs to have a direct object.';
I[0][1][3][2] = 0;
I[0][2] = 0;

I[1] = new Array();
I[1][0]='The students are always very happy when school . . . for the holidays.';
I[1][1] = new Array();
I[1][1][0] = new Array();
I[1][1][0][0]='breaks off';
I[1][1][0][1]='No, this verb needs a direct object, there isn\'t one in this sentence.';
I[1][1][0][2] = 0;
I[1][1][1] = new Array();
I[1][1][1][0]='breaks up';
I[1][1][1][1]='The teachers are less happy, because they all LOVE to work!';
I[1][1][1][2] = 1;
I[1][1][2] = new Array();
I[1][1][2][0]='breaks down';
I[1][1][2][1]='No, this one mean that it stops working, or collapses, and this student\'s dream is not for tomorrow.';
I[1][1][2][2] = 0;
I[1][1][3] = new Array();
I[1][1][3][0]='breaks out';
I[1][1][3][1]='We would say that an epidemic "breaks out", but - is school an epidemic?';
I[1][1][3][2] = 0;
I[1][2] = 0;

I[2] = new Array();
I[2][0]='Sam said that he was tired of his girlfriend; he decided to . . . the relationship.';
I[2][1] = new Array();
I[2][1][0] = new Array();
I[2][1][0][0]='break off';
I[2][1][0][1]='Absolutely!';
I[2][1][0][2] = 1;
I[2][1][1] = new Array();
I[2][1][1][0]='break down';
I[2][1][1][1]='No, this would mean collapse or subdivide - not what you do with a relationship!';
I[2][1][1][2] = 0;
I[2][1][2] = new Array();
I[2][1][2][0]='break up';
I[2][1][2][1]='This verb is intransitive. And there *is* a direct object - the relationship!';
I[2][1][2][2] = 0;
I[2][1][3] = new Array();
I[2][1][3][0]='break out';
I[2][1][3][1]='That could have been possible if we had said that he wanted to "break out" of the relationship, but not in the sentence above.';
I[2][1][3][2] = 0;
I[2][2] = 0;

I[3] = new Array();
I[3][0]='For as long as I have lived in Geneva, a flu epidemic . . . regularly, every year.';
I[3][1] = new Array();
I[3][1][0] = new Array();
I[3][1][0][0]='breaks out';
I[3][1][0][1]='Correct verb, wrong tense!';
I[3][1][0][2] = 0;
I[3][1][1] = new Array();
I[3][1][1][0]='has broken out';
I[3][1][1][1]='Yes!';
I[3][1][1][2] = 1;
I[3][1][2] = new Array();
I[3][1][2][0]='breaks off';
I[3][1][2][1]='The verb is transitive, and there is no direct object in the sentence!';
I[3][1][2][2] = 0;
I[3][1][3] = new Array();
I[3][1][3][0]='has broken down';
I[3][1][3][1]='The tense is correct, but the particle is wrong.';
I[3][1][3][2] = 0;
I[3][2] = 0;

I[4] = new Array();
I[4][0]='Every Escalade all the little children . . . all the homes in my neighbourhood and sing special songs.';
I[4][1] = new Array();
I[4][1][0] = new Array();
I[4][1][0][0]='call on';
I[4][1][0][1]='No, you call on SOMEONE, not somewhere. A house is "somewhere".';
I[4][1][0][2] = 0;
I[4][1][1] = new Array();
I[4][1][1][0]='call at';
I[4][1][1][1]='Absolutely!';
I[4][1][1][2] = 1;
I[4][1][2] = new Array();
I[4][1][2][0]='call for';
I[4][1][2][1]='No, this means to go and get something that is waiting for you. Although the children DO get something, they first have to visit me and sing first.';
I[4][1][2][2] = 0;
I[4][1][3] = new Array();
I[4][1][3][0]='call up';
I[4][1][3][1]='This would be possible IF the children didn\'t COME, but if they telephoned me instead.';
I[4][1][3][2] = 0;
I[4][2] = 0;

I[5] = new Array();
I[5][0]='On the day after Christmas, my mother and I used to . . . all her friends and have a piece of Christmas Cake and a special wine.';
I[5][1] = new Array();
I[5][1][0] = new Array();
I[5][1][0][0]='call on';
I[5][1][0][1]='Yes.';
I[5][1][0][2] = 1;
I[5][1][1] = new Array();
I[5][1][1][0]='call up';
I[5][1][1][1]='You cannot have a drink of wine by telephone.';
I[5][1][1][2] = 0;
I[5][1][2] = new Array();
I[5][1][2][0]='call off';
I[5][1][2][1]='This means to cancel or abandon something. We definitely did NOT cancel our visits!';
I[5][1][2][2] = 0;
I[5][1][3] = new Array();
I[5][1][3][0]='call for';
I[5][1][3][1]='No, we didn\'t go and get her friends, we only visited them.';
I[5][1][3][2] = 0;
I[5][2] = 0;

I[6] = new Array();
I[6][0]='When we go out for a drink with friends we like to take only one car; so one of us drives to the other friends\' home and . . . for them.';
I[6][1] = new Array();
I[6][1][0] = new Array();
I[6][1][0][0]='calls for';
I[6][1][0][1]='Yes.';
I[6][1][0][2] = 1;
I[6][1][1] = new Array();
I[6][1][1][0]='calls on';
I[6][1][1][1]='This would mean that we stop and visit the friends. We don\'t. We just stop at their house and pick them up.';
I[6][1][1][2] = 0;
I[6][1][2] = new Array();
I[6][1][2][0]='calls off';
I[6][1][2][1]='This means to "abandon". We don\'t abandon or give up (cancel)! We just pick them up.';
I[6][1][2][2] = 0;
I[6][1][3] = new Array();
I[6][1][3][0]='calls up';
I[6][1][3][1]='No, this would mean that we telephone them. We call them before we go, of course, but we physically go and pick them up.';
I[6][1][3][2] = 0;
I[6][2] = 0;

I[7] = new Array();
I[7][0]='Many students wish that their teacher would simply . . . all the tests. They hate tests.';
I[7][1] = new Array();
I[7][1][0] = new Array();
I[7][1][0][0]='call off';
I[7][1][0][1]='Yes.';
I[7][1][0][2] = 1;
I[7][1][1] = new Array();
I[7][1][1][0]='call at';
I[7][1][1][1]='You can\'t visit tests, unfortunately.';
I[7][1][1][2] = 0;
I[7][1][2] = new Array();
I[7][1][2][0]='call up';
I[7][1][2][1]='It would be wonderful if we could telephone a test, wouldn\'t it? But we can\'t.';
I[7][1][2][2] = 0;
I[7][1][3] = new Array();
I[7][1][3][0]='call on';
I[7][1][3][1]='This means to visit. Unfortunately we can\'t just visit a test. Besides, it isn\'t a person.';
I[7][1][3][2] = 0;
I[7][2] = 0;

I[8] = new Array();
I[8][0]='When my daughter came home from school yesterday she immediately . . . the friends she had just left.';
I[8][1] = new Array();
I[8][1][0] = new Array();
I[8][1][0][0]='called for';
I[8][1][0][1]='No, she didn\'t go and get them.';
I[8][1][0][2] = 0;
I[8][1][1] = new Array();
I[8][1][1][0]='called on';
I[8][1][1][1]='No, she didn\'t go to VISIT them.';
I[8][1][1][2] = 0;
I[8][1][2] = new Array();
I[8][1][2][0]='called up';
I[8][1][2][1]='Yes, she telephoned them.';
I[8][1][2][2] = 1;
I[8][1][3] = new Array();
I[8][1][3][0]='called off';
I[8][1][3][1]='No, this means to cancel. She doesn\'t cancel her friends!';
I[8][1][3][2] = 0;
I[8][2] = 0;

I[9] = new Array();
I[9][0]='When you make a budget you have to . . . the total into separate subdivisions.';
I[9][1] = new Array();
I[9][1][0] = new Array();
I[9][1][0][0]='break down';
I[9][1][0][1]='Yes!';
I[9][1][0][2] = 1;
I[9][1][1] = new Array();
I[9][1][1][0]='break off';
I[9][1][1][1]='No, this means that you bring something to an end. In this case, you don\'t want to end the budget, but structure it.';
I[9][1][1][2] = 0;
I[9][1][2] = new Array();
I[9][1][2][0]='break out';
I[9][1][2][1]='A budget is not an epidemic. You say that an epidemic "breaks out", but not a budget.';
I[9][1][2][2] = 0;
I[9][2] = 0;

I[10] = new Array();
I[10][0]='Many modern countries have . . . the death penalty. That is a good thing.';
I[10][1] = new Array();
I[10][1][0] = new Array();
I[10][1][0][0]='done up';
I[10][1][0][1]='No, that is not correct.';
I[10][1][0][2] = 0;
I[10][1][1] = new Array();
I[10][1][1][0]='done away with';
I[10][1][1][1]='Yes, they have abolished it.';
I[10][1][1][2] = 1;
I[10][1][2] = new Array();
I[10][1][2][0]='do away with';
I[10][1][2][1]='correct phrasal verb, but wrong tense!';
I[10][1][2][2] = 0;
I[10][1][3] = new Array();
I[10][1][3][0]='done away for';
I[10][1][3][1]='One of the particles is wrong';
I[10][1][3][2] = 0;
I[10][2] = 0;

I[11] = new Array();
I[11][0]='When you move into a new apartment, the first thing you need is to . . . all the rooms.';
I[11][1] = new Array();
I[11][1][0] = new Array();
I[11][1][0][0]='do up';
I[11][1][0][1]='That\'s right. You renovate and paint the rooms to make them look new.';
I[11][1][0][2] = 1;
I[11][1][1] = new Array();
I[11][1][1][0]='do in';
I[11][1][1][1]='No, that means that you kill them!';
I[11][1][1][2] = 0;
I[11][1][2] = new Array();
I[11][1][2][0]='do without';
I[11][1][2][1]='No, that means that you get along without them. You can\'t manage without rooms.';
I[11][1][2][2] = 0;
I[11][1][3] = new Array();
I[11][1][3][0]='do away with';
I[11][1][3][1]='No, that means that you get rid of the rooms, that you remove them from the apartment. Impossible!';
I[11][1][3][2] = 0;
I[11][2] = 0;

I[12] = new Array();
I[12][0]='When your teachers give you a particularly difficult test, your first desire is to ... the idiot ... .';
I[12][1] = new Array();
I[12][1][0] = new Array();
I[12][1][0][0]='do without';
I[12][1][0][1]='Well, you might want to work without a teacher, but you wouldn\'t get very far.';
I[12][1][0][2] = 0;
I[12][1][1] = new Array();
I[12][1][1][0]='do up';
I[12][1][1][1]='It would be good if we could renovate our teachers, but no, this is not it.';
I[12][1][1][2] = 0;
I[12][1][2] = new Array();
I[12][1][2][0]='do . . . in';
I[12][1][2][1]='Yes! No torture is good enough for somebody who gives difficult tests. . . (Notice that you put the object between the two parts of the phrasal verb!)';
I[12][1][2][2] = 1;
I[12][1][3] = new Array();
I[12][1][3][0]='do away with.';
I[12][1][3][1]='Yes, this is another possibility. You want to get rid of them. But please don\'t!';
I[12][1][3][2] = 1;
I[12][2] = 0;

I[13] = new Array();
I[13][0]='At the end of the month, I can always . . . a little bit extra from my parents';
I[13][1] = new Array();
I[13][1][0] = new Array();
I[13][1][0][0]='do away with';
I[13][1][0][1]='No! I NEED more, not less!';
I[13][1][0][2] = 0;
I[13][1][1] = new Array();
I[13][1][1][0]='do with';
I[13][1][1][1]='Yes, I need more money. Please tell my parents.';
I[13][1][1][2] = 1;
I[13][1][2] = new Array();
I[13][1][2][0]='do up';
I[13][1][2][1]='There is no way I can renovate my wallet to make it have more money in it.';
I[13][1][2][2] = 0;
I[13][2] = 0;

I[14] = new Array();
I[14][0]='At the end of every month, most of us have to . . . the luxuries. At my house we eat pasta for about a week.';
I[14][1] = new Array();
I[14][1][0] = new Array();
I[14][1][0][0]='do without';
I[14][1][0][1]='Yes.';
I[14][1][0][2] = 1;
I[14][1][1] = new Array();
I[14][1][1][0]='do away with';
I[14][1][1][1]='No, we don\'t abolish them, or get rid of them. They just aren\'t there!';
I[14][1][1][2] = 0;
I[14][1][2] = new Array();
I[14][1][2][0]='do in';
I[14][1][2][1]='We don\'t kill the luxuries, they are just all gone!';
I[14][1][2][2] = 0;
I[14][2] = 0;

I[15] = new Array();
I[15][0]='If we start talking in class, our teacher at once tells us to . . . with our work.';
I[15][1] = new Array();
I[15][1][0] = new Array();
I[15][1][0][0]='get up';
I[15][1][0][1]='No, she doesn\'t ask us to stand up, just to continue working.';
I[15][1][0][2] = 0;
I[15][1][1] = new Array();
I[15][1][1][0]='get on';
I[15][1][1][1]='Yes, she asks us to make progress.';
I[15][1][1][2] = 1;
I[15][1][2] = new Array();
I[15][1][2][0]='get over';
I[15][1][2][1]='No, she doesn\'t ask us to recover (as from a sickness), just to continue working.';
I[15][1][2][2] = 0;
I[15][1][3] = new Array();
I[15][1][3][0]='get away';
I[15][1][3][1]='No, there is no punishment for finishing your work in class.';
I[15][1][3][2] = 0;
I[15][2] = 0;

I[16] = new Array();
I[16][0]='If you are in the bus and an older person gets on, it\'s polite to . . . and offer him/her your seat.';
I[16][1] = new Array();
I[16][1][0] = new Array();
I[16][1][0][0]='get up';
I[16][1][0][1]='Ah, yes. Many young people forget that.';
I[16][1][0][2] = 1;
I[16][1][1] = new Array();
I[16][1][1][0]='get on';
I[16][1][1][1]='You are already ON the bus. You need to stand up so the older person can sit down.';
I[16][1][1][2] = 0;
I[16][1][2] = new Array();
I[16][1][2][0]='get over';
I[16][1][2][1]='You could have used something similar to this if the verb had been "move", because that would mean sitting on the seat next to yours. So - no.';
I[16][1][2][2] = 0;
I[16][1][3] = new Array();
I[16][1][3][0]='get off';
I[16][1][3][1]='No need to leave the bus! Just stand up!';
I[16][1][3][2] = 0;
I[16][2] = 0;

I[17] = new Array();
I[17][0]='I had the flu really badly last year. It took me weeks to . . . it.';
I[17][1] = new Array();
I[17][1][0] = new Array();
I[17][1][0][0]='get away with';
I[17][1][0][1]='No, I wasn\'t punished for having the flu. This means to avoid punishment.';
I[17][1][0][2] = 0;
I[17][1][1] = new Array();
I[17][1][1][0]='get over';
I[17][1][1][1]='Yes, that\'s correct!';
I[17][1][1][2] = 1;
I[17][1][2] = new Array();
I[17][1][2][0]='get on with';
I[17][1][2][1]='No, I didn\'t make progress with the flu. I wanted to STOP being sick, not continue!';
I[17][1][2][2] = 0;
I[17][2] = 0;

I[18] = new Array();
I[18][0]='Yesterday, was reading on the bus, so that when the bus arrived at my stop, I forgot to . . .';
I[18][1] = new Array();
I[18][1][0] = new Array();
I[18][1][0][0]='get on';
I[18][1][0][1]='I was already ON the bus.';
I[18][1][0][2] = 0;
I[18][1][1] = new Array();
I[18][1][1][0]='get over it';
I[18][1][1][1]='I didn\'t need to recover from anything. I wasn\'t ill.';
I[18][1][1][2] = 0;
I[18][1][2] = new Array();
I[18][1][2][0]='get off';
I[18][1][2][1]='Yes, I was still on the bus after it left my stop!';
I[18][1][2][2] = 1;
I[18][1][3] = new Array();
I[18][1][3][0]='get up';
I[18][1][3][1]='I didn\'t just want to stand in the bus. I wanted to leave the bus and go to school.';
I[18][1][3][2] = 0;
I[18][2] = 0;

I[19] = new Array();
I[19][0]='Some people steal things in shops because they hope that they will be able to . . . it.';
I[19][1] = new Array();
I[19][1][0] = new Array();
I[19][1][0][0]='get on with';
I[19][1][0][1]='No, you don\'t want to make progress in stealing.';
I[19][1][0][2] = 0;
I[19][1][1] = new Array();
I[19][1][1][0]='get over';
I[19][1][1][1]='No, it isn\'t always an illness (sometimes it is) when you steal in shops.';
I[19][1][1][2] = 0;
I[19][1][2] = new Array();
I[19][1][2][0]='get away with';
I[19][1][2][1]='Yes, they hope they will not be caught and punished.';
I[19][1][2][2] = 1;
I[19][2] = 0;


Status = new Array();


function CreateStatusArrays(){
	for (var x=0; x<I.length; x++){
		Status[x] = new Array();
		Status[x][0] = 0; // Question not done yet
		Status[x][1] = new Array(); //for tracking whether answers chosen
		for (var y=0; y<I[x][1].length; y++){
			Status[x][1][y] = '0'; //Answers not chosen yet
		}
		Status[x][2] = 0; //Wrong tries at this question so far
		Status[x][3] = 0; //For storing score out of one on this question
	}
}

function ReplaceStuff(Token, Replacement, InString){
	var i = InString.indexOf(Token);
	var FirstBit = '';
	var LastBit = '';
	while (i>-1){
		FirstBit = InString.substring(0, i);
		LastBit = InString.substring(i + Token.length, InString.length);	
		InString = FirstBit + Replacement + LastBit;
		i = InString.indexOf(Token);
	}
	return InString;
}

function ChangeQ(ChangeBy){
	var NewNum = CurrQNum + ChangeBy;
	if ((NewNum >= 0)&&(NewNum<I.length)){
		CurrQNum = NewNum;
		ShowQuestion(CurrQNum);
	}
	var CurrScore = '';
	if ((ContinuousScoring == true)&&(EraseFeedback == true)){
		CurrScore = YourScoreIs + ' ' + Score + '%.';
		WriteFeedback(CurrScore);
	}
}

function BuildQuestion(QNum){
	if (I[QNum][2] == 0){
		var Temp = ReplaceStuff('[Question]', I[QNum][0], QRow);

		var AnsRows = '';
		for (var i=0; i<I[QNum][1].length; i++){
			TempAns = ARow;
			TempAns = ReplaceStuff('[ANum]', i, TempAns);
			TempAns = ReplaceStuff('[ALetter]', ' ' + ALetters.charAt(i) + ' ', TempAns);
			TempAns = ReplaceStuff('[Ans]', I[QNum][1][i][0], TempAns);
			AnsRows += TempAns;
		}
		Temp += AnsRows;
		Temp = ReplaceStuff('[QNumber]', QNum+1, Temp);
		Temp = ReplaceStuff('[QNum]', QNum, Temp);
	}
	else{
		var Temp = ReplaceStuff('[Question]', I[QNum][0], QRow);
		var AnsRows = '';
		for (var i=0; i<I[QNum][1].length; i++){
			TempAns = MARow;
			TempAns = ReplaceStuff('[ANum]', i, TempAns);
			TempAns = ReplaceStuff('[Correct]', I[QNum][1][i][2], TempAns);
			TempAns = ReplaceStuff('[Ans]', I[QNum][1][i][0], TempAns);
			AnsRows += TempAns;
		}
		Temp += AnsRows;
		Temp += CheckButton;
		Temp = ReplaceStuff('[QNumber]', QNum+1, Temp);
		Temp = ReplaceStuff('[QNum]', QNum, Temp);
	}
	return Temp;
}

function DisplayExercise(StuffToDisplay){
//Build the output string
	var OutString = '';
	OutString += '<html>';
	OutString += '<body  background="" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000cc">';
	OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
	OutString += TitleCode; 
	OutString += '<tr><td bgcolor="#bbbbee" align="center">'; 
	OutString += '<font face="Geneva,Arial" size="-1">';
	OutString += StuffToDisplay;
	OutString += '</font></td></tr>';
	OutString += NavBar;
	OutString += '</table></center></body></html>';

	if (is.CRAPBrowser){OutString=ResolveAllURLs(OutString);}

//Write it to the frame
	BottomFrame.document.clear();
	BottomFrame.document.open();
	BottomFrame.document.write(OutString);
	BottomFrame.document.close();
}


function ShowAllQs(){
	var Output = '';
	for (var i=0; i<I.length-1; i++){
		Output = Output + BuildQuestion(i);
		Output = Output + '<tr><td colspan="4"><hr></hr></td></tr>';
	}
	Output = Output + BuildQuestion(I.length-1);
	Output = TableOpener + Output + TableCloser;
	DisplayExercise(Output);
}

function ShowQuestion(QNum){
//First, create the Q number readout at the top
	var Readout = (QNum+1) + '/' + I.length;
	while (Readout.length < 7){
		Readout = ' ' + Readout + ' ';
	}
	Readout = QButtonsOpener + Readout + QButtonsCloser;

	var Output = BuildQuestion(QNum);

	Output = TableOpener + Output + TableCloser;

	DisplayExercise(Readout + Output);

//Mark the answers already done
	for (i=0; i<Status[QNum][1].length; i++){
		if (Status[QNum][1][i] == 'R'){
			MarkAnswer(QNum,i,true)
		}
		if (Status[QNum][1][i] == 'W'){
			MarkAnswer(QNum,i,false)
		}
		if (Status[QNum][1][i] == 'C'){
			CheckCheckbox(QNum,i);
		}
	}
//Eliminate feedback from previous question
	if (EraseFeedback == true){
		WriteFeedback('');
	}
}

function CheckMulti(QNum){
	var TotWrong = 0;
	var Output = '';
	var TotAns = I[QNum][1].length;
	for (var i=TotAns-1; i>=0; i--){
//Find any incorrect choices

		var b = eval('BottomFrame.document.QForm.A_' + QNum + '_' + i);

		if (b != null){
//if it's wrong, count it
			if (b.checked == true){
				Status[QNum][1][i] = 'C';
			}
			else{
				Status[QNum][1][i] = 'U';
			}
			if (((b.checked == true) && (b.value == "0"))||((b.checked == false)&&(b.value == "1"))){
				TotWrong++;
			}
		}				
	}

	if (TotWrong == 0){
		Output = DefaultRight;
	}
	else{
		Output = DefaultWrong + '<br />' + (TotAns-TotWrong) + '/' + TotAns;
	}

//If you haven't tried the question before
	if (Status[QNum][0] == 0){
		if (TotWrong > 0){
			Status[QNum][2]++;
		}
		if (TotWrong == 0){
			Status[QNum][0] = 1;
//Calculate the score for this question as a floating-point fraction of 1
			Status[QNum][3] =  ((Status[QNum][1].length - Status[QNum][2]) - 1) / (Status[QNum][1].length - 1);
//If less than zero, set to zero
			if (Status[QNum][3] < 0){Status[QNum][3] = 0;}
		}
	}

//Check whether the quiz is finished
	var Finished = true;
	for (var i=0; i<Status.length; i++){
		if (Status[i][0] == 0){Finished = false;}
	}

//Calculate the score if needed
		
	if (Status[QNum][0] == 1){
		if ((Finished==true)||(ContinuousScoring==true)){
			var DoneQs = 0;
			var TotalScore = 0;
			for (var i=0; i<Status.length; i++){
				if (Status[i][0] == 1){
					DoneQs++;
					TotalScore += Status[i][3];
				}
			}
			Score = (Math.floor(100 * (TotalScore/DoneQs)));
			Output = Output + '<br />' + YourScoreIs + ' ' + Score + '%.';
		}

		if (Finished == true){
			EraseFeedback = false;
			var CFT = 0;
			for (i=0; i<I.length; i++){
				if (Status[i][2] == 0){
					CFT++;
				}
			}
		Output += '<br />' + CorrectFirstTime + CFT + '/' + I.length;

		}
	}

//Show the feedback
	if (Output.length > 0){
		WriteFeedback(Output);
	}

}

function CheckAnswer(QNum, ANum){
	var Output = I[QNum][1][ANum][1];

	if (Output==''){
		if (I[QNum][1][ANum][2] == 1){
			Output = DefaultRight;
		}
		else{
			Output = DefaultWrong;
		}
	}

//If it's not been previously answered correctly
	if (Status[QNum][0] == 0){
//If it's a correct answer
		if (I[QNum][1][ANum][2] == 1){
			Status[QNum][0] = 1;//Mark the Q as done
			Status[QNum][1][ANum] = 'R';
			MarkAnswer(QNum, ANum, true);
//Calculate the score for this question as a floating-point fraction of 1
			var PossibleWrongs = 0;
			for (var i=0; i<I[QNum][1].length; i++){
				if (I[QNum][1][i][2] == 0){
					PossibleWrongs++;
				}
			}

			if (PossibleWrongs == 0){PossibleWrongs = 1;}

			Status[QNum][3] = 1 - (Status[QNum][2]/PossibleWrongs);

//If less than zero, set to zero
			if (Status[QNum][3] < 0){Status[QNum][3] = 0;}
		}
		else{
			if (Status[QNum][1][ANum] != 'W'){
				Status[QNum][1][ANum] = 'W';
				MarkAnswer(QNum, ANum, false);
				Status[QNum][2]++; //increment wrong tries for this Q
			}
		}
	}

//Check whether the quiz is finished
	var Finished = true;
	for (var i=0; i<Status.length; i++){
		if (Status[i][0] == 0){Finished = false;}
	}

//Calculate the score if needed
		
	if (Status[QNum][0] == 1){
		if ((Finished==true)||(ContinuousScoring==true)){
			var DoneQs = 0;
			var TotalScore = 0;
			for (var i=0; i<Status.length; i++){
				if (Status[i][0] == 1){
					DoneQs++;
					TotalScore += Status[i][3];
				}
			}
			Score = (Math.floor(100 * (TotalScore/DoneQs)));
			Output = Output + '<br />' + YourScoreIs + ' ' + Score + '%.';
		}

		if (Finished == true){
			EraseFeedback = false;
			var CFT = 0;
			for (i=0; i<I.length; i++){
				if (Status[i][2] == 0){
					CFT++;
				}
			}
		Output += '<br />' + CorrectFirstTime + CFT + '/' + I.length;

		}
	}

//Show the feedback
	if (Output.length > 0){
		WriteFeedback(Output);
	}
}

function MarkAnswer(QNum, ANum, Right){
	var Mark = CorrectIndicator;
	if (Right == false){Mark = IncorrectIndicator;}

	if (eval('BottomFrame.document.QForm.FB_' + QNum + '_' + ANum) != null){
		eval('BottomFrame.document.QForm.FB_' + QNum + '_' + ANum).value = Mark;
	}
}

function CheckCheckbox(QNum, ANum){
	if (eval('BottomFrame.document.QForm.A_' + QNum + '_' + ANum) != null){
		eval('BottomFrame.document.QForm.A_' + QNum + '_' + ANum).checked = true;
	}
}







function Blank(){
	return '<html><body>&copy;Half-Baked Software. Loading...</body></html>';
}

//-->

//]]>



