var Style = { getElementStyle: function(elem, property){ var ME = arguments.callee; var value = null; if(window.getComputedStyle) { var compStyle = window.getComputedStyle(elem, ''); value = compStyle.getPropertyValue(property); }else if(elem.currentStyle){ value = elem.currentStyle[property.camelize()]; //!!String.camelize() } if(value) return value; }, getDimensions: function(elem){ var width, height; width = parseInt(this.getElementStyle(elem, "width")); if(isNaN(width)) width = elem.offsetWidth; height = parseInt(this.getElementStyle(elem, "height")); if(isNaN(height)) height = elem.offsetHeight; return {width: width, height: height}; }, setElementStyle: function(objElem, propName, propVal, usePx){ var elem = (typeof objElem == "string") ? document.getElementById(objElem) : objElem; if(typeof propName == "string"){ if(usePx && (typeof propVal == "number")){ propVal += "px"; } elem.style[propName] = propVal; }else if(typeof propName == "object"){ for(var i in propName){ var val = propName[i]; if(typeof val == "number" && usePx){ val += "px"; }//if elem.style[i] = val; }//for }//if-else-if //End of FUCNTION } }