// Fixes for prototype bugs
// This needs prototype included before execution
// @author Friedemann Altrock <friedemann.altrock@fp-commerce.de>
if (window && window.Prototype && Prototype.Browser && Prototype.Browser.IE) {
    Element.addMethods({
        getStyle: function(element, style) {
            element = $(element);
            style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
            var value = element.style[style];

            if (style == 'opacity') {
                if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
                    if (value[1]) return parseFloat(value[1]) / 100;
                return 1.0;
            }
            
            if (!value && element.currentStyle) value = element.currentStyle[style];

            if (value == 'auto') {
                if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
                    return element['offset' + style.capitalize()] + 'px';
                return null;
            }
            return value;
        }
    });
}
