/*******************************************
@DESCRIPTION:
functions relative to CSS styling

$name$
$date$
$log$
********************************************/

//@args: id of a HTML element; name of the CSS property;;
//@role: retrieve the value of a CSS property for the given element;;
//@note: because CSS properties applied by an external stylesheet are not directly available;; 
function getStyle(eltId,pro) {
  return getObjectStyle(document.getElementById(eltId), pro);
}

//@args: a HTML element (Object); name of the CSS property;;
//@role: retrieve the value of a CSS property for the given element;;
function getObjectStyle(elt, prop) {

  if (window.getComputedStyle) { // Mozilla Firefox & co
    var property = window.getComputedStyle(elt,null).getPropertyValue(prop);
    
  } else if (elt.currentStyle) { // Microsoft Internet Explorer
    // Formating (IE) of the CSS property
    while (prop.indexOf('-') != -1)  {
      var letterFollowDash = prop.charAt(prop.indexOf('-')+1);
      prop = prop.replace(/-\S{1}/,letterFollowDash.toUpperCase());
    }
    var property = eval('elt.currentStyle.'+prop);
  }

  return property;
}