function NextQstn() { Qnum++ Points=3 if (Qnum>MaxQstns) { endGame() } else { Answer=Answ[Qnum] initForm() } } function endGame() { if (Score==MaxPts) gameNarr="Край на теста... Абсолютен си!" else gameNarr="Край на теста" document.myform.answerbox.value=gameNarr document.myform.question.value="" document.myform.qnum.value="" } function MakeArray(y) { for (var j = 1; j <= y; j++) { this[j] = 0; } return this; } function Randomize() { // scramble the answer list with ScramNum //question 1 definitely needs to be scrambled consistently... ran1 = getRan("5"); temp = Answ[ran1] Answ[ran1] = Answ[1]; Answ[1] = temp; for (i=1; i<=ScramNum; i++) { ran1 = getRan("1"); ran2 = getRan("12"); // alert ("ran1="+ran1+" and ran2 = "+ran2); // if (ran1 > MaxQstns) { alert ("woops"); } temp = Answ[ran1]; Answ[ran1] = Answ[ran2]; Answ[ran2] = temp; } } function getRan(str) { today = new Date(); ssecs= today.getSeconds(); mmins= today.getMinutes(); ttime=today.getTime(); // gives a number between 0 and 59 // z = ((ssecs*10+mmins) % 12) + 1; z = ((ssecs*10+mmins) % MaxQstns) + 1; // y = (ttime*ssecs % 12)+1; y = (ttime*ssecs % MaxQstns)+1; //% 12 gives number between 0 and 11 ... so add +1 to it if (str=="1") { // alert (y); return y; } else { // alert (z); return z; } } function initForm() { Points=3 document.myform.question.value=Answer document.myform.points.value=Points document.myform.qnum.value=Qnum document.myform.max.value=MaxPts document.myform.answerbox.value="" } function chkQstn(Guess) { if (Qnum>MaxQstns) endGame() else if (Points==0) { document.myform.points.value="" document.myform.answerbox.value="Не се мъчи...кликни next qstn" } else if (Answer==Guess) { Score = Score + Points document.myform.answerbox.value="Правилно ...кликни next qstn" document.myform.score.value=Score Points=0 document.myform.points.value="" } else { Points-- if (Points==2) { document.myform.answerbox.value="Грешка, това е " + Guess + ", пробвай пак" document.myform.points.value=Points } else if (Points==1) { document.myform.answerbox.value="Грешка, това е " + Guess + ", направи последен опит" document.myform.points.value=Points } else { document.myform.points.value="" document.myform.answerbox.value="Това е " + Guess + ". Не се мъчи ...кликни next qstn" } } } function SeeMap(page,ht,wd) { mapwin=open(page,"DisplayWindow","toolbar=no,directories=no,scrollbars=yes,menubar=no,height="+ht+",width="+wd+",resize=no"); } function jumpPage(form) { i = form.SelectMenu.selectedIndex; if (i == 0) return; parent.location.href = url[i+1]; } function MakeArray2() { this.length = MakeArray2.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = MakeArray2.arguments[i] } function doPopUp () { var popUp=false; if (popUp) { MyWindow=window.open('support.html','MyWindow','toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=550,left=75,top=75'); } }