Make your own free website on Tripod.com
'; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += '
'; var NavBar=''; NavBar+='
'; NavBar+=''; NavBar+=''; NavBar+='
'; if (is.CRAPBrowser){NavBar=ResolveAllURLs(NavBar);} var TitleCode = ''; TitleCode += '' + ExerciseTitle + '
'; TitleCode += '' + ExerciseSubtitle + '
'; TitleCode += '
'; var GridOpener = ''; var GridRowOpener = ''; var GridRowCloser = ''; var BlankCell = ''; var LetterOnlyCell = ''; var NumLetterCell = ''; var GridCloser = '
 [Letter]'; if (! is.CRAPBrowser){ NumLetterCell += '[ClueNum]'; } else{ NumLetterCell += '[ClueNum]'; } NumLetterCell += ' [Letter]
'; var Buttons = '
'; Buttons += ''; Buttons += ''; Buttons += '
'; var Buttons1 = ReplaceStuff('[Num]', '1', Buttons); var Buttons2 = ReplaceStuff('[Num]', '2', Buttons); var GetAnswerOpener = '
'; var GetAnswer = ' '; GetAnswer += ' '; GetAnswer += ''; var GetAnswerCloser = '
'; function GoBack(){ var BackSkip = history.length - PreviousPage; if (BackSkip > 0){ history.go((BackSkip+1)*-1); } else{ parent.history.back(); } } function BuildExercise(){ var OutString = ''; var Temp = ''; var GridStuff = GridOpener; for (var i=0; i 0){ Temp = NumLetterCell; Temp = ReplaceStuff('[ClueNum]', C[i][j], Temp); //Add location info Temp = ReplaceStuff('[x]', i, Temp); Temp = ReplaceStuff('[y]', j, Temp); } //Otherwise add a blank cell else{ Temp = LetterOnlyCell; } //If the cell is already answered, add the letter from the Guess array if (G[i][j] != ''){ Temp = ReplaceStuff('[Letter]', G[i][j], Temp); } //Otherwise, put in a non-breaking space else{ Temp = ReplaceStuff('[Letter]', ' ', Temp); } GridStuff += Temp; } } GridStuff += GridRowCloser; } GridStuff += GridCloser; //Put the final pieces together OutString = GridStuff; BuiltExercise = OutString; } function WriteFeedback(Feedback) { if (is.CRAPBrowser){Feedback=ResolveAllURLs(Feedback);} //Build the output string var OutString = ''; OutString += ''; OutString += ''; OutString += '
'; OutString += NavBar; if (Feedback.length>0){ OutString += '' } OutString += '
'; OutString += ''; OutString += Feedback; OutString += '
'; //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){ OutString += '
'; } OutString = OutString + 'Ke Bawah : ' + 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('','K','E','G','E','M','A','R','A','N','','',''); L[1] = new Array('','','','','','','P','','','','','',''); L[2] = new Array('','','','','K','A','I','S','','','','',''); L[3] = new Array('H','A','R','T','A','','','A','M','A','N','A','H'); L[4] = new Array('','','','','K','','','Y','','','','',''); L[5] = new Array('','','','','I','','','A','Y','A','M','',''); L[6] = new Array('','','H','','','','','','','','A','',''); L[7] = new Array('','','E','M','A','K','','','','','K','',''); L[8] = new Array('','','M','','','','','','','','A','',''); L[9] = new Array('','','P','','','','S','A','M','U','N','',''); L[10] = new Array('','','A','','','','','','','','A','',''); L[11] = new Array('','','P','E','N','C','A','R','I','A','N','',''); C = new Array(); C[0] = new Array(0,1,0,0,0,0,2,0,0,0,0,0,0); C[1] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0); C[2] = new Array(0,0,0,0,3,0,0,4,0,0,0,0,0); C[3] = new Array(5,0,0,0,0,0,0,6,0,0,0,0,0); C[4] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0); C[5] = new Array(0,0,0,0,0,0,0,7,0,0,8,0,0); C[6] = new Array(0,0,9,0,0,0,0,0,0,0,0,0,0); C[7] = new Array(0,0,10,0,0,0,0,0,0,0,0,0,0); C[8] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0); C[9] = new Array(0,0,0,0,0,0,11,0,0,0,0,0,0); C[10] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0); C[11] = new Array(0,0,12,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('','','','','','','','','','','','',''); A = new Array(); A[1]='Semua orang ada sifat ini'; A[3]='Perbuatan kebiasaan ayam'; A[5]='Kita perlu cari untuk hidup senang'; A[6]='Mesti pegang sampai mati'; A[7]='Binatang'; A[10]='Kita sayang pada ayah dan ?'; A[11]='Kerja penjahat'; A[12]='Orang hilang itu dalam ...... polis.'; D = new Array(); D[2]='Sangat panas jika terkena....'; D[3]='Guna ia untuk bergerak'; D[4]='Kata Ganti Diri'; D[8]='Untuk hidup?'; D[9]='Kalau kena pasti sakit'; function StartUp(){ //Try to get user name UserName = prompt('Sila masukkan nama anda :',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ UserName = prompt('Sila masukkan nama anda :',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ window.location = PreviousPage; } } BuildExercise(); 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); if (AllCorrect == true){ setTimeout('SendResults(' + Score + ')', 50); return; } DisplayExercise(); } function SendResults(Score){ var today = new Date; var NewName = '' + today.getTime(); var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300'); NewWin.document.clear(); NewWin.document.open(); NewWin.document.write(ResultForm); NewWin.document.close(); NewWin.document.Results.Score.value = Score + '%'; NewWin.document.Results.realname.value = UserName; NewWin.document.Results.End_Time.value = (new Date()).toLocaleString(); NewWin.document.Results.Start_Time.value = StartTime; NewWin.document.Results.submit(); } function DoNothing(){} function Blank(){ return '©Half-Baked Software. Loading...'; } //--> //]]>