function style( elem ) { if ( elem.ownerDocument && elem.ownerDocument.defaultView ) { return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); } else if ( elem.currentStyle ) { return elem.currentStyle; } return null; }