function stylElementu(IdElem, WlasnoscStyluIE, WlasnoscStyluCSS) {
    var elem = document.getElementById(IdElem);
    if (elem.currentStyle) {
        return elem.currentStyle[WlasnoscStyluIE];
    } else if (window.getComputedStyle) {
        var styl = window.getComputedStyle(elem, "");
        return styl.getPropertyValue(WlasnoscStyluCSS);
    }
    return "";
}
--------
var kolorDiv = stylElementu("mojDiv", "backgroundColor", "background-color");
