Troubleshoot by placing alert(X); alert(Y); alert(Scale); alert(myMap); in the javascript and see what pops up. The first three should return the expected values and myMap should return Frame (I think). If myMap returns undefined then parent.parent wasn't the correct location of the mapFrame.