Reading Detailed CSS properties with Javascript

Hi all,

I am trying to get the detailed CSS properties of an element. I am looking specifically at the width and height, to see if they are set to auto, inherit, or normal. I have a bit of javascript so far:


if(element.currentStyle){ 
  var y = element.currentStyle.width; 
  alert("ie 
"+y); 
}else if(window.getComputedStyle){ 
  var y=document.defaultView.getComputedStyle(element,null).getPropertyValue("width");
  alert("moz 
"+y);  
} 
 

the IE code works fine and will report back if a element is set to auto. The Mozilla code comes back with a measurement of the objects width in pixels similar to an offsetHeight. I’m hoping there is an alternative to .getComputedStyle or a different property value that will give me the information im looking for.