/**
 * Returns the current value of a style property for an element. This value is
 * calculated dynamically and is therefore "better" than reading the element's "style"
 * property.
 *
 * @param object element        The element to get the style property from
 * @param string style_property The name of the style property to check
 */
function common_element_style_prop(element, style_property)
{
    return (element.currentStyle) ?
        element.currentStyle[style_property] :
        window.getComputedStyle(element, null).getPropertyValue(style_property);
}


/**
 * Displays/hides an element from the page based on its current status (i.e. toggle display)
 *
 * @param string element_id The ID of the element to toggle the display of
 */
function common_toggle_display(element_id)
{
      var element = document.getElementById(element_id);

      if (element.style.display == 'block')
      {
          element.style.display = 'none';
      }
      else
      {
          element.style.display = 'block';
      }
}

