<img src=../images/top2.jpg align='right' id=my_image >Let us start with reading the naturalHeight of the image
var y=document.getElementById("i1").naturalHeight;
Here i1 is the image object. document.getElementById("i1").width=document.getElementById("i1").naturalWidth;
document.getElementById("i1").height=document.getElementById("i1").naturalHeight;