I merged my earlier posted script with another script, the AJAX works now, but it won't change the images to the correct src... I have no idea what JS's problem is, but it's got serious ones...

PHP Code:
var offsetx=0;
var 
offsety=0;

function 
getKey(ethisoffsetxthisoffsetyfirstxfirsty) {

    var 
firstx=offsetx+firstx;
    var 
firsty=offsety+firsty;

    if (
e.keyCode=='38') {

        for (var 
y=1y<=17y++) {

            
thisfirstx=firstx;

            for (var 
x=1x<=20x++) {
                
thisfirstx++;

                if (
window.XMLHttpRequest) { 
                    
myRequest = new XMLHttpRequest();
                } else if (
window.ActiveXObject) {
                    
myRequest = new ActiveXObject("Microsoft.XMLHTTP");
                }

                
myRequest.onreadystatechange = function() {

                    if (
myRequest.readyState == 4) {

                        var 
thisimageid="mapTile"+x+"_"+y;

                        var 
imageLink="*********"+myRequest.responseText;

                        
document.thisimageid.src=imageLink;

                    }

                }

                
myRequest.open('GET''************?x=' thisfirstx '&y=' firsty '&direction=up'true);                  
                
myRequest.send(null);

            }

            
firsty++;

        }

    
offsetythisoffsety-1;

    }