/*
 * Returns CSSStyleDeclaration object for an element.
 *
 *   - elmnt  object whose styles to return
 */
function computedStyle(elmnt) {
  var computedStyle = null;
  
  if (document.defaultView && document.defaultView.getComputedStyle) {
    computedStyle = document.defaultView.getComputedStyle(elmnt, ""); 
  } else if (elmnt.currentStyle) {
    computedStyle = elmnt.currentStyle; 
  } else {
    computedStyle = element.style;
  }
  
  return computedStyle;
}

/*
 * Removes preceding and trailing whites spaces from string.
 *
 *   - str  string to be operated on
 */
function trim(str) {
  return str.replace(/^\s+|\s+$/g, '');
}
