i am creating a simon says game, the game is based on 4 images (each has an opposite) when the game begins one of the image randomly flashes, the flash is between itself and its opposite (day and night). the user is then to mimic that flash by clicking on that image. If he clicks in that image then i want the move to be correct or 'true' if he clicks on another image i want the move to be incorrect 'false'. if false he will be redirected to an alert box thats says game over, if true then 2 of the images then flash as opposed to only one, again randomly. I am unsure how to test if it is correct or incorrect and then if correct get 2 of the images to flash randomly and so on. Can anyone help? please? here is what i have so far :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simon Says Game</title>

<style type="text/css">
body {
background-image : url('background.jpg');
}

table {
background-color: black;
margin-left: auto; margin-right: auto;
border-style: solid; border-color: black; border-width: 3px;
}

img {
width:450px;
height:225px;
}

#label {
width : 450px;
height : 82px;
position: absolute; top : 489px; left : 0 px;
font-family: arial; font-weight: bold; font-size: 25px;
text-align: center;
background-color:black;
color:white;
}


</style>
<script type="text/javascript">
function init(){
alert('START!');
randNumber=Math.floor(Math.random()*4)+1;
var image=document.getElementById('img'+randNumber);
var wen=image.id.charAt(3)+'day.jpg';
f(image,wen);
}

function f(obj,newImg){

oldImg = obj.src;
obj.src=newImg;
window.setTimeout(function(){obj.src=oldImg},600);
}



</script>

</head>

<body onload="init();">
<table border="5" width="900px" height="530px">
<tr width="900px" height="225px">
<td width="450px" height="225px"><img id=img1 src="1night.jpg" onclick="f(this,'1day.jpg')" title=this.src></td>
<td width="450px" height="225px"><img id=img2 src="2night.jpg" onclick="f(this,'2day.jpg')" title=this.src></td>
</tr>

<tr width="900" height="225">
<td width="450px" height="225px"><img id=img3 src="3night.jpg" onclick="f(this,'3day.jpg')" title=this.src></td>
<td width="450px" height="225px"><img id=img4 src="4night.jpg" onclick="f(this,'4day.jpg')" title=this.src></td>
</tr>
<tr width="900" height="80">
<td>
<div id="label">Retry</div>
</td>
<td>
<div id="label">Score: 0</div>
</td>
</tr>
</table>
</body>
</html>