'; //Write it to the frame TopFrame.document.clear(); TopFrame.document.open(); TopFrame.document.write(OutString); TopFrame.document.close(); } function DisplayExercise(){ //Build the output string var OutString = ''; OutString += ''; OutString += ''; OutString += '
'; OutString += TitleCode; OutString += Buttons1; OutString += BuiltExercise; OutString += Buttons2; OutString += BuiltClues; OutString += NavBar; OutString += '
'; 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 BuildClue(ClueNum,x,y,Across){ var OutString = ''; if (Across == true){ if (ClueNum >= A.length){ return ''; } if (A[ClueNum] == null){ return ''; } OutString = ClueNum + '. ' + A[ClueNum]; OutString += GetAnswer; OutString = ReplaceStuff('[BoxName]', 'BA'+ClueNum, OutString); //Find out how long the answer is AnsLength = 0; i = x; j = y; while (j= D.length){ return ''; } if (D[ClueNum] == null){ return ''; } OutString = ClueNum + '. ' + D[ClueNum]; OutString += GetAnswer; OutString = ReplaceStuff('[BoxName]', 'BD'+ClueNum, OutString); //Find out how long the answer is AnsLength = 0; i = x; j = y; while (i 0){ AcrossClues += BuildClue(C[i][j], i, j, true); DownClues += BuildClue(C[i][j], i, j, false); } } } OutString += ''; OutString += CluesAcross + '

' + AcrossClues + '

'; OutString += ''; OutString += CluesDown + '

' + DownClues + '
' OutString += ''; BuiltClues = OutString; } function ShowClue(ClueNum,x,y){ var OutString = ''; var AnsLength = 0; var i; var j; CurrBoxElement = ClueNum; if (A[ClueNum] != null){ OutString = OutString + 'Across: ' + ClueNum + '. ' + A[ClueNum]; OutString += GetAnswer; OutString = ReplaceStuff('[BoxName]', 'BA'+ClueNum, OutString); //Find out how long the answer is AnsLength = 0; i = x; j = y; while (j 0){ OutString += '
'; } OutString = OutString + 'Down: ' + ClueNum + '. ' + D[ClueNum]; OutString += GetAnswer; OutString = ReplaceStuff('[BoxName]', 'BD'+ClueNum, OutString); //Find out how long the answer is AnsLength = 0; i = x; j = y; 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; } L = new Array(); L[0] = new Array('','E','','','','','','','','','','','','','','','','M','',''); L[1] = new Array('','V','','','','','','','G','R','O','U','N','D','W','A','T','E','R',''); L[2] = new Array('','A','','','','','','','','','','','I','','','','','A','',''); L[3] = new Array('S','P','R','I','N','G','','','','','','','L','','','','','N','',''); L[4] = new Array('','O','','','','','','D','A','N','U','B','E','','','','','D','',''); L[5] = new Array('','R','','','','','','','','','','','','','S','T','R','E','A','M'); L[6] = new Array('','A','','G','','','','','','S','','','','','','R','','R','','I'); L[7] = new Array('S','T','L','A','W','R','E','N','C','E','','F','','D','','I','','','','S'); L[8] = new Array('','I','','N','','','','','','V','O','L','G','A','','B','','T','','S'); L[9] = new Array('C','O','N','G','O','','','','','E','','O','','M','O','U','T','H','','I'); L[10] = new Array('','N','','E','','','','','','R','','O','','','','T','','A','','S'); L[11] = new Array('','','','S','','','','','','N','','D','E','L','T','A','','M','','S'); L[12] = new Array('','','','','','','','','','','','','','','','R','','E','','I'); L[13] = new Array('','','','','','','','','','','','','','','','Y','','S','','P'); L[14] = new Array('','','','','','','','','','','','','','','','','','','','P'); L[15] = new Array('','','','','','','','','','','','','','','','','','','','I'); C = new Array(); C[0] = new Array(0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0); C[1] = new Array(0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0); C[2] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[3] = new Array(5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[4] = new Array(0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0); C[5] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,0,0,0,9); C[6] = new Array(0,0,0,10,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0); C[7] = new Array(12,0,0,0,0,0,0,0,0,0,0,13,0,14,0,0,0,0,0,0); C[8] = new Array(0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,16,0,0); C[9] = new Array(17,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0); C[10] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[11] = new Array(0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0); C[12] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[13] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[14] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); C[15] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); G = new Array(); G[0] = new Array('','','','','','','','','','','','','','','','','','','',''); G[1] = new Array('','','','','','','','','','','','','','','','','','','',''); G[2] = new Array('','','','','','','','','','','','','','','','','','','',''); G[3] = new Array('','','','','','','','','','','','','','','','','','','',''); G[4] = new Array('','','','','','','','','','','','','','','','','','','',''); G[5] = new Array('','','','','','','','','','','','','','','','','','','',''); G[6] = new Array('','','','','','','','','','','','','','','','','','','',''); G[7] = new Array('','','','','','','','','','','','','','','','','','','',''); G[8] = new Array('','','','','','','','','','','','','','','','','','','',''); G[9] = new Array('','','','','','','','','','','','','','','','','','','',''); G[10] = new Array('','','','','','','','','','','','','','','','','','','',''); G[11] = new Array('','','','','','','','','','','','','','','','','','','',''); G[12] = new Array('','','','','','','','','','','','','','','','','','','',''); G[13] = new Array('','','','','','','','','','','','','','','','','','','',''); G[14] = new Array('','','','','','','','','','','','','','','','','','','',''); G[15] = new Array('','','','','','','','','','','','','','','','','','','',''); A = new Array(); A[3] = 'Water which seeps underground'; A[5] = 'underground water which comes to the surface'; A[6] = 'The longest river in Europe'; A[7] = 'These are usually fast flowing and join up to form tributaries'; A[12] = 'The large river in Canada that connects the Great Lakes with the Atlantic Ocean'; A[15] = 'This Russian river empties into the Caspian Sea'; A[17] = 'This African river was called the Zaire River.'; A[18] = 'Where the river meets the sea'; A[19] = 'This is formed when silt collects in the mouth of a river'; D = new Array(); D[1] = 'The process where sea water rises to form clouds'; D[2] = 'This is when a river forms a series of bends and curves. It looks like a snake.'; D[4] = 'The longest river in the world'; D[8] = 'These feed in to the main river system'; D[9] = 'The longest river in North America'; D[10] = 'This river is considered a holy river in India'; D[11] = 'The longest river in Britain'; D[13] = 'This happens when a channel can no longer hold all the water present'; D[14] = 'This is a man-made way to control the flow of water'; D[16] = 'The river that flows through London'; function StartUp(){ BuildExercise(); BuildCompleteClues(); WriteFeedback(Instructions); DisplayExercise(); } function CheckAnswers(){ var AllCorrect = true; var TotLetters = 0; var CorrectLetters = 0; //Check each letter for (var i=0; i'; } Output += YourScoreIs + ' ' + Score + '%.
'; if (AllCorrect == false){ Output += '
' + Incorrect; Penalties++; } BuildExercise(); WriteFeedback(Output); DisplayExercise(); } function DoNothing(){} function Blank(){ return '©Half-Baked Software. Loading... '; } //--> //]]> -->