im just trying to make a simple tictactoe game where on the click in the table, it calls a function that evaluates the current image in the table. if it is empty, it changes the gif depending on whos turn it is. if it has already been selected, it does nothing. the last argumentis a numeric argument depending upon its position in the 3x3 grid. i want to take this number and use it as an index for an array so i can evaluate the array to see if the winning conditions have been met. im a c programmer who just started doing webpages and javascript has been pretty easy up to this point. any help would be much appreciated.

here's my code:

//a calling in the body of the html<td><a href="#" onMouseOver="window.status='Go Here?'; return true" onClick="changeImages('image1', 'imagex', 'imageo', '1')"><img src="blank.gif" border="0" alt="" name="image1"></a></td>

// the function that evaluates it
function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=3) {
if(( document[changeImages.arguments[i]].src != eval(changeImages.arguments[i+1] + ".src")) && ( document[changeImages.arguments[i]].src != eval(changeImages.arguments[i+2] + ".src"))){
if( turn == 1 ){
document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
//this is the code im trying to use to put the values in the array
x[document[changeImages.arguments[3]] = "x";
//here i would have the 9 conditionalstatements and redirect to the winning page if condititons are met
turn = 2;
break;
} else if( turn == 2 ){
document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+2] + ".src");
//i would have the same thing in here but for the y array
turn = 1;
break;
}
}
}
}
}