Witam jestem nowy na tym forum i chciałbym zadać pytanie.

Napisałem skrypt który porusza divem strzałkami
Kod
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>LastShot</title>
<style>
body {
     margin: 0px;
}
</style>
<script type="text/javascript">
var t= new Array();
function wcisniety(e) t[e.keyCode] = e.keyCode;
function puszczony(e) t[e.keyCode]= 0;
var x=0;
var y=0;
function animate() {
if(t[39] == 39){
x+=5;
document.getElementById("obj").style.left=x+'px'; }
// w lewo
if(t[37] == 37){
x-=5;
document.getElementById("obj").style.left=x+'px';}
// w dół
if(t[40] == 40){
y+=5;
document.getElementById("obj").style.top=y+'px';}
// w góre
if(t[38] == 38){
y-=5;
document.getElementById("obj").style.top=y+'px';}
}
setInterval('animate()', 1);
</script>
</head>
<body onkeypress="wcisniety(event);" onkeyup="puszczony(event);" >
<div style="width:100%;height:100%;background:#00d327;overflow:hidden">
<div id="obj" style="width:70px;height:45px;background:#ababab;position:relative;top:0px;float:left;"></div>
</div>
</body>
</html>


I teraz z diva chciałbym przejść na svg ale żeby nie był w tym samym pliku.
Kod
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>LastShot</title>
<style>
body {
     margin: 0px;
}
</style>
<script type="text/javascript">
var t= new Array();
function wcisniety(e) t[e.keyCode] = e.keyCode;
function puszczony(e) t[e.keyCode]= 0;
var x=0;
var y=0;
function animate() {
if(t[39] == 39){
x+=5;
document.getElementById("obj").style.left=x+'px'; }
// w lewo
if(t[37] == 37){
x-=5;
document.getElementById("obj").style.left=x+'px';}
// w dół
if(t[40] == 40){
y+=5;
document.getElementById("obj").style.top=y+'px';}
// w góre
if(t[38] == 38){
y-=5;
document.getElementById("obj").style.top=y+'px';}
}
setInterval('animate()', 1);
</script>
</head>
<body onkeypress="wcisniety(event);" onkeyup="puszczony(event);">

<div id="svg_object" style="width:100%; height:100%;" >
  
    <object type="image/svg+xml" data="Rysunek-1.svg"></object>  
  
   </div>

</body>
</html>

No i powstał pewien problem bo nie potrafię się dostać do drzewa DOM tego svg ;/ może wiecie jak to zrobić nie umieszczając całego pliku svg.