// adjusted 120814 Added glow // adjusted 18/07/07 added tick and cross images to alert box, stopped game reload if timed out // adjusted 29/05/06 rewritten to use a static html file and new question file structure // adjusted 12/11/03 update to multiple colours // adjusted 12/11/03 to allow a 2 minute timer to be added // adjusted 16/05/03 to do randomising of terms via javascript not perl // adjusted 12/11/03 to allow a 2 minute timer to be added // adjusted 26/10/24 match background color not text color and display correct order when game finished // 281024 - change Definition to Match // match.js - external javascript to support the Match the Term and it's Match file match.html // file do not adjust. termclicked=0; // term has been selected defnclicked=0; // definition has been selected termvalue=0; // value of the term id without t defnvalue=0; // value of the term id without d thed=0; // holds the defn id //pickcolour =new Array(9); //matchcolour='wheat'; //pickcolour=['green','blue','brown','darkorange','purple','darkslategray','darkgoldenrod','deepskyblue','teal','darkvioletred']; // extra colors for increased Match game pickcolour =new Array(); matchcolour='black'; pickcolour=['#0099ff','#008000','#704f00','#a52a2a','#ff8c00','#800080','#2f4f4f','#b8860b', '#0044ff','#008080','#cc0000','#ff00ff','#003300','#99cc00','#3b4000','#940000']; function term(t){ tempid="t"+t; // build up term id thet=t; // store t in a global variable for use in defn function //Check term hasn't already been matched if (document.getElementById(tempid).style.color==matchcolour) {alertboxer('
This Term has already been Matched,
Try another one.
You have already picked a Term,
Pick a Match.
This Item has already been Matched
Try another one.
You have already picked a Match,
Pick a Term.
You Matched all the Terms !
'); correcttable(); if (timerflag==1){clearTimeout(timerid);} } } x=120; // 120 second countdown y=0; // stop time in 120 secs function timer(){ // display current time if (xTry again.
"); } else { document.forms[0].elements[0].value=x; x=x-1; //drop every second //run again every second timerid=setTimeout('timer()',1000); } } function correcttable(){ // when game completeed put definitions alongside correct terms // this creates a new tbody tag needed by ie in memory newtablebody=document.createElement('tbody'); //add the tbody tag to the table tag document.getElementById('maintable').appendChild(newtablebody); //add an id to the tbody tag document.getElementById('maintable').firstChild.setAttribute('id','tablebody'); // add headings var thetable="