In jQuery, you can do alert($("#theid").css("width"))
.
-- if you haven't taken a look at jQuery, I highly recommend it; it makes many simple javascript tasks effortless.
for the record, this post is 5 years old. The web has developed, moved on, etc. There are ways to do this with Plain Old Javascript, which is better.