probably because you have your boolean returns reversed?? I changed it to the following and was able to get it "working". I am using the term "working" very loose because I believe you have some other problems in the code.
function IsEmpty(x, y) {
var Temp1 = document.getElementsByTagName("img");
var i;
var xx, yy;
xx = (x * 50) - 50 + ("px");
yy = (y * 50) - 50 + ("px");
for (i = 0; i < Temp1.length; i++) {
if (Temp1[i].style.left != xx && Temp1[i].style.top != yy) {
Empty = false;
} else {
Empty = true;
break;
}
}
return Empty;
}