Use jQuery to develop a cross-browser solution.
$(selector).offset() will return an object with absolute position (left, top) of the element relative to the document.
$(selector).position() will return another object with relative position to the element's parent container.
oWidth = $(elt).width();
oHeight = $(elt).height();
The oWidth and oHeight would be the width and height of the element without the padding, border and margin.
You could use innerWidth() and innerHeight() is you would like the width and height to include the padding,
outerWidth() and outerHeight() to include both padding and borders.
All you have to do is use the jquery library to take advantage of its cross-browser methods.