var text1=''

var score=0
var noq=0
var a1=0
var a2=0
var a3=0
var a4=0
var a5=0
var a6=0
var a7=0
var a8=0
var a9=0
var a10=0

var c1=0
var c2=0
var c3=0
var c4=0
var c5=0
var c6=0
var c7=0
var c8=0
var c9=0
var c10=0

var text1='BLACK TO MOVE'
var ans1a='Qxc3'
var ans1b='Qc3'
var ans1c=ans1a
var c1t1='You are going to use a fork - but not this move'
var c1t2='You have to decoy an enemy piece onto a square where it can be forked'
var c1t3='Play a sacrifice: if he accepts it you will play a fork and come out a piece ahead'

var text2='WHITE TO MOVE'
var ans2a='Nxd5'
var ans2b='Nd5'
var ans2c=ans2a
var c2t1='It might not look like it but there\'s a pin hidden in this position'
var c2t2='Which one of your pieces is in line with an unguarded enemy piece?'
var c2t3='Try to work out what happens if you play a capture here'

var text3='WHITE TO MOVE'
var ans3a='Bf7'
var ans3b=ans3a
var ans3c=ans3a
var c3t1='You win games by creating two threats at the same time'
var c3t2='The first move is a clearance - one of your pieces is on a square that one of your other pieces wants to occupy'
var c3t3='How can you threaten checkmate and an enemy piece at the same time?'

var text4='BLACK TO MOVE'
var ans4a='Rd8'
var ans4b=ans4a
var ans4c=ans4a
var c4t1='You\'d like to queen that pawn, wouldn\'t you?'
var c4t2='You\'d also like to get a back rank mate, wouldn\'t you?'
var c4t3='Have you done the lesson about explosions on f7?'

var text5='BLACK TO MOVE'
var ans5a='Bxe4'
var ans5b='Be4'
var ans5c=ans5a
var c5t1='White is expecting you to move your rook, but you can do much better'
var c5t2='Which one of your own pieces is stopping you playing a very strong move?'
var c5t3='Find the piece that\'s in the way: what is the most forcing move you can play with that piece?'

var text6='BLACK TO MOVE'
var ans6a='Rd5'
var ans6b=ans6a
var ans6c=ans6a
var c6t1='As usual you need to create two threats'
var c6t2='You can threaten a square (where you can do a checkmate, fork or pin) as well as a piece'
var c6t3='How can you threaten an undefended piece - and threaten a pin at the same time?'

var text7='WHITE TO MOVE'
var ans7a='Rxg7'
var ans7b='Rg7'
var ans7c=ans7a
var c7t1='Take aim at the black king'
var c7t2='What\'s the best piece to use for getting checkmate?'
var c7t3='Your first move is a sacrifice: your second move will create an unanswerable threat'

var text8='WHITE TO MOVE'
var ans8a='Nxe6'
var ans8b='Ne6'
var ans8c=ans8a
var c8t1='Do you think the black king is very well defended?'
var c8t2='You can force checkmate in three moves here - so what sort of move should you be looking for?'
var c8t3='Look for a sacrifice - and look ahead to see how you can force mate however black replies' 

var text9='BLACK TO MOVE'
var ans9a='Qxh2'
var ans9b='Qh2'
var ans9c=ans9a
var c9t1='How many squares could the white king move to?'
var c9t2='You have a forced checkmate - you only have to look for it'
var c9t3='Do you know how to get checkmate with two rooks?'

var text10='WHITE TO MOVE'
var ans10a='Qxa6'
var ans10b='Qa6'
var ans10c=ans10a
var c10t1='You\'re looking for a queen fork here - although it might not look like it'
var c10t2='The queen fork is perfectly safe because it also acts as a decoy'
var c10t3='Which black piece would you like to move so that you could get checkmate?'

function clue1(){
c1=c1+1							   
if (c1<4) a1=a1-2 	 
if (c1==1) {setTimeout("q1c.innerHTML='<br>'+c1t1+'<br>'",6000)}
else {if (c1==2) {setTimeout("q1c.innerHTML='<br>'+c1t2+'<br>'",6000)}
else {if (c1==3) {setTimeout("q1c.innerHTML='<br>'+c1t3+'<br>'",6000)}}} 
}

function clue2(){
c2=c2+1	
if (c2<4) a2=a2-2 
if (c2==1) {setTimeout("q2c.innerHTML='<br>'+c2t1+'<br>'",6000)}
else {if (c2==2) {setTimeout("q2c.innerHTML='<br>'+c2t2+'<br>'",6000)}
else {if (c2==3) {setTimeout("q2c.innerHTML='<br>'+c2t3+'<br>'",6000)}}} 
}

function clue3(){
c3=c3+1	
if (c3<4) a3=a3-2 
if (c3==1) {setTimeout("q3c.innerHTML='<br>'+c3t1+'<br>'",6000)}
else {if (c3==2) {setTimeout("q3c.innerHTML='<br>'+c3t2+'<br>'",6000)}
else {if (c3==3) {setTimeout("q3c.innerHTML='<br>'+c3t3+'<br>'",6000)}}} 
}

function clue4(){
c4=c4+1	
if (c4<4) a4=a4-2 
if (c4==1) {setTimeout("q4c.innerHTML='<br>'+c4t1+'<br>'",6000)}
else {if (c4==2) {setTimeout("q4c.innerHTML='<br>'+c4t2+'<br>'",6000)}
else {if (c4==3) {setTimeout("q4c.innerHTML='<br>'+c4t3+'<br>'",6000)}}} 
}

function clue5(){
c5=c5+1	
if (c5<4) a5=a5-2 
if (c5==1) {setTimeout("q5c.innerHTML='<br>'+c5t1+'<br>'",6000)}
else {if (c5==2) {setTimeout("q5c.innerHTML='<br>'+c5t2+'<br>'",6000)}
else {if (c5==3) {setTimeout("q5c.innerHTML='<br>'+c5t3+'<br>'",6000)}}} 
} 

function clue6(){
c6=c6+1	
if (c6<4) a6=a6-2 
if (c6==1) {setTimeout("q6c.innerHTML='<br>'+c6t1+'<br>'",6000)}
else {if (c6==2) {setTimeout("q6c.innerHTML='<br>'+c6t2+'<br>'",6000)}
else {if (c7==3) {setTimeout("q7c.innerHTML='<br>'+c7t3+'<br>'",6000)}}} 
}

function clue7(){
c7=c7+1	
if (c7<4) a7=a7-2 
if (c7==1) {setTimeout("q7c.innerHTML='<br>'+c7t1+'<br>'",6000)}
else {if (c7==2) {setTimeout("q7c.innerHTML='<br>'+c7t2+'<br>'",6000)}
else {if (c7==3) {setTimeout("q7c.innerHTML='<br>'+c7t3+'<br>'",6000)}}} 
}

function clue8(){
c8=c8+1	
if (c8<4) a8=a8-2 
if (c8==1) {setTimeout("q8c.innerHTML='<br>'+c8t1+'<br>'",6000)}
else {if (c8==2) {setTimeout("q8c.innerHTML='<br>'+c8t2+'<br>'",6000)}
else {if (c8==3) {setTimeout("q8c.innerHTML='<br>'+c8t3+'<br>'",6000)}}} 
}

function clue9(){
c9=c9+1	
if (c9<4) a9=a9-2 
if (c9==1) {setTimeout("q9c.innerHTML='<br>'+c9t1+'<br>'",6000)}
else {if (c9==2) {setTimeout("q9c.innerHTML='<br>'+c9t2+'<br>'",6000)}
else {if (c9==3) {setTimeout("q9c.innerHTML='<br>'+c9t3+'<br>'",6000)}}} 
}

function clue10(){
c10=c10+1	
if (c10<4) a10=a10-2 
if (c10==1) {setTimeout("q10c.innerHTML='<br>'+c10t1+'<br>'",6000)}
else {if (c10==2) {setTimeout("q10c.innerHTML='<br>'+c10t2+'<br>'",6000)}
else {if (c10==3) {setTimeout("q10c.innerHTML='<br>'+c10t3+'<br>'",6000)}}} 
}	  

function checkans1(){
if (q1div.innerHTML==ans1a||q1div.innerHTML==ans1b||q1div.innerHTML==ans1c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a1=a1+10;document.q1kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a1=a1-1;document.q1kp.src="tactw.gif";setTimeout("document.q1kp.src='keypad.gif'",3000);q1div.innerHTML=''}
}

function checkans2(){
if (q2div.innerHTML==ans2a||q2div.innerHTML==ans2b||q2div.innerHTML==ans2c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a2=a2+10;document.q2kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a2=a2-1;document.q2kp.src="tactw.gif";setTimeout("document.q2kp.src='keypad.gif'",3000);q2div.innerHTML=''}
}

function checkans3(){
if (q3div.innerHTML==ans3a||q3div.innerHTML==ans3b||q3div.innerHTML==ans3c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a3=a3+10;document.q3kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a3=a3-1;document.q3kp.src="tactw.gif";setTimeout("document.q3kp.src='keypad.gif'",3000);q3div.innerHTML=''}
}

function checkans4(){
if (q4div.innerHTML==ans4a||q4div.innerHTML==ans4b||q4div.innerHTML==ans4c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a4=a4+10;document.q4kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a4=a4-1;document.q4kp.src="tactw.gif";setTimeout("document.q4kp.src='keypad.gif'",3000);q4div.innerHTML=''}
}

function checkans5(){
if (q5div.innerHTML==ans5a||q5div.innerHTML==ans5b||q5div.innerHTML==ans5c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a5=a5+10;document.q5kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a5=a5-1;document.q5kp.src="tactw.gif";setTimeout("document.q5kp.src='keypad.gif'",3000);q5div.innerHTML=''}
}

function checkans6(){
if (q6div.innerHTML==ans6a||q6div.innerHTML==ans6b||q6div.innerHTML==ans6c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a6=a6+10;document.q6kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a6=a6-1;document.q6kp.src="tactw.gif";setTimeout("document.q6kp.src='keypad.gif'",3000);q6div.innerHTML=''}
}

function checkans7(){
if (q7div.innerHTML==ans7a||q7div.innerHTML==ans7b||q7div.innerHTML==ans7c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a7=a7+10;document.q7kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a7=a7-1;document.q7kp.src="tactw.gif";setTimeout("document.q7kp.src='keypad.gif'",3000);q7div.innerHTML=''}
}

function checkans8(){
if (q8div.innerHTML==ans8a||q8div.innerHTML==ans8b||q8div.innerHTML==ans8c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a8=a8+10;document.q8kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a8=a8-1;document.q8kp.src="tactw.gif";setTimeout("document.q8kp.src='keypad.gif'",3000);q8div.innerHTML=''}
}

function checkans9(){
if (q9div.innerHTML==ans9a||q9div.innerHTML==ans9b||q9div.innerHTML==ans9c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a9=a9+10;document.q9kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a9=a9-1;document.q9kp.src="tactw.gif";setTimeout("document.q9kp.src='keypad.gif'",3000);q9div.innerHTML=''}
}

function checkans10(){
if (q10div.innerHTML==ans10a||q10div.innerHTML==ans10b||q10div.innerHTML==ans10c) {setTimeout("DHTMLSound('excellnt.wav')",1000);a10=a10+10;document.q10kp.src="tactr.gif"}
else {setTimeout("DHTMLSound('shoot.wav')",1000);a10=a10-1;document.q10kp.src="tactw.gif";setTimeout("document.q10kp.src='keypad.gif'",3000);q10div.innerHTML=''}
}

function popupMessage() {

/***********************************************
* Encrypt Email script- Please keep notice intact.
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/

var emailarray1677= new Array(99,104,101,115,115,107,105,100,115,97,99,97,100,101,109,121,64,103,111,111,103,108,101,109,97,105,108,46,99,111,109)
var postemail1677=''
for (i=0;i<emailarray1677.length;i++)
postemail1677+=String.fromCharCode(emailarray1677[i])


  // SET MESSAGE VALUES
  var name = document.rjform.rjname.value
  var to = postemail1677
  var subject = "chessKIDS academy tactics quiz 12"
  var body =
  "Name of pupil: "+name+  
  "\n\nScore in tactics quiz 12: "+score+
  "\n\n"+a1+' '+a2+' '+a3+' '+a4+' '+a5+' '+a6+' '+a7+' '+a8+' '+a9+' '+a10

  // BUILD MAIL MESSAGE COMPONENTS 
  var doc = "mailto:" + to + 
      "?subject=" + escape(subject) + 
      "&body=" + escape(body); 

  // POP UP EMAIL MESSAGE WINDOW
  window.location = doc;
}

function finish(){

if (a1<0||a1>10) a1=0
if (a2<0||a2>10) a2=0
if (a3<0||a3>10) a3=0
if (a4<0||a4>10) a4=0
if (a5<0||a5>10) a5=0
if (a6<0||a6>10) a6=0
if (a7<0||a7>10) a7=0
if (a8<0||a8>10) a8=0
if (a9<0||a9>10) a9=0
if (a10<0||a10>10) a10=0

score=a1+a2+a3+a4+a5+a6+a7+a8+a9+a10 

result.innerHTML="<br><br>You scored " 
result.innerHTML+=score
result.innerHTML+="% in the chess<font color=red>KIDS<font color=black> academy Tactics Quiz 12"


}

function DHTMLSound(surl) {
  document.getElementById("dummyspan").innerHTML=
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}






