function NextQstnCap() {
  Qnum++
  Points=3
  if (Qnum>MaxQstns)
     { endGame() }
  else
     { Answer=Ansq[Qnum-1]
        initFormCap() }
}

function randOrd() {
	return (Math.round(Math.random())-0.5);
}

function MakeArrayCap(y) {
	Ansq=new Array()
	for (var j = 0; j < y; j++)
		{    Ansq[j] = j+1;   }
	Ansq.sort( randOrd )
	//Ansq[j] = Ansq[0]
	//alert(Ansq)
	return Ansq;
}

function initFormCap() {
  Points=3
  document.myform.question.value=Cap[Answer]
  document.myform.points.value=Points
  document.myform.qnum.value=Qnum
  document.myform.max.value=MaxPts
  document.myform.answerbox.value=""
}

function chkQstnCap(Guess) {
   if (Qnum>MaxQstns)
      endGame()
   else
   if (Points==0)
     { document.myform.points.value=""
       document.myform.answerbox.value="No more tries...click next question"  }
   else
   if (Answer==Guess) {
       Score = Score + Points
       document.myform.answerbox.value=Answ[Guess] + " is right ...click next question"
       document.myform.score.value=Score
       Points=0
       document.myform.points.value=""
         }
   else
     { Points--
       if (Points==2) {
         document.myform.answerbox.value="No, " + Cap[Guess] + " is the capital of " + Answ[Guess] + ", try again"
         document.myform.points.value=Points }
       else
       if (Points==1) {
         document.myform.answerbox.value="No, " + Cap[Guess] + " is the capital of " + Answ[Guess] + ", ...one try left"
         document.myform.points.value=Points }
       else
        { document.myform.points.value=""
          document.myform.answerbox.value="No, " + Cap[Guess] + " is the capital of " + Answ[Guess] + ". No more tries ...click next question" }
      } 
}


