function hyphen2camel(str) {
    return str.replace(/\-(.)/g, function (m, c) { return c.toUpperCase(); } );
}

function getStyleValue(el, property) {
    var cs, val = false;
    if (window.getComputedStyle) {
        cs = getComputedStyle(el, null);
        val = cs.getPropertyValue(property);
    }
    else if (el.currentStyle) {
        property = hyphen2camel(property);
        val = el.currentStyle[property];
    }
    return val;
}

function showAltImage(source, altID) {
    source.onerror = "";
    source.style.display = "none";
    if (altID != null && altID != "") {
        document.getElementById(altID).style.display = "inline";
    }
}

