clickcounter=0;done=0;// function to generate random image numberfunction return_entry() {   var tst=1   var newval=0   while(tst == 1) {	var seedvalue = Math.round(Math.random() * 100)	newval = seedvalue % gamepieces;	if (newval < gamepieces && newval >= 0) 	   if (game_array[newval].src == dummyvalue) {		tst = 0	      }   }   return newval}// function to process clicking on an imagefunction click_image(img) {    clickcounter++;	if (currenthits == 2) 				// if end of round reset		reset(); 	if (img == oldimgnbr) return			// if click same image twice        	thisimage = document.images[img];	if (thisimage.src == dummyvalue) return	// if clicking on winning square	thisimage.src = game_array[img].src		// get game image	currenthits++					// increment hits	// if first try in round, capture image and image number	if (currenthits == 1) {						oldimage.src = thisimage.src		oldimgnbr = img		}	// else, see if a match has occurred	else {		if (oldimage.src == thisimage.src) {			   winorlose = 1;		   theobjs["won"].objShow();		   theobjs["lose"].objHide();                   if ((goodpoints + 1) >= numimages)                      reset();                   		   }		else {		   winorlose = 0;		   theobjs["won"].objHide();		   theobjs["lose"].objShow();		   }		oldimage.src=game1.src;		}}// end of round, or game, and reset board pieces, or mark winnerfunction reset() {      // if won round   if (winorlose == 1) {       document.images[oldimgnbr].src = game1.src;       thisimage.src=game1.src;       goodpoints++;       if (goodpoints >= numimages) {       	var current_score = score;		if ((current_score + 0) > 0) {		   theobjs["winning2"].objSetZIndex(5);		   theobjs["winning2"].objShow();		   }		else {		   theobjs["winning1"].objSetZIndex(5);		   theobjs["winning1"].objShow();		   }		done=1;		//alert("done!!" + done);		}		  }    // if lost round    else {   	thisimage.src=game2.src;   	score-=20;	//var strng = "<p><font size='3' face='arial'>SCORE: " + score + "</font></p>"; 	document.images[oldimgnbr].src = game2.src;	//theobjs["scoreboard"].replace_html(strng);	}   currenthits=0;}t=00;min=0;minutes = "00:";function TimeIt(){t++;if (min < 9) minutes = "0" + min;if(t < 10) time = minutes + ":0" + t;if(t > 9) time = minutes + ":" + t;if (t == 60){min++;minutes = "0" + min;t = 0;time = minutes + ":0" + t;}if(clickcounter==0){strng = "<p><font size='3' face='arial'>TIME: 00:00 </font></p>";t=00;min=0;minutes = "00:";}else if(done == 1){finalTime = time;strng = "<p><font size='3' face='arial'>FINAL TIME: <br><font color=#c6eff7><b>~~~ " + finalTime + " ~~~</b></font></font></p>";clearInterval(cont);}else{strng = "<p><font size='3' face='arial'>TIME: " + time + "</font></p>";}theobjs["scoreboard"].replace_html(strng);}cont=setInterval('TimeIt()',1000);