Element.extend({
    bgiframe: function (styles) {
        if (window.ie6) {
            if (!this.getElement('iframe.bgiframe')) {
                styles = styles || {};
                var ifsrc = $pick(styles.src, 'javascript:false');
                delete styles.src;
                var ifopac = $pick(styles.opacity, true);
                delete styles.opacity;
                (new Element('iframe', {
                    'class': 'bgiframe',
                    frameborder: 0,
                    tabindex: -1,
                    src: ifsrc,
                    styles: $merge({
                        top: -this.getStyle('borderTopWidth').toInt(),
                        left: -this.getStyle('borderLeftWidth').toInt(),
                        width: this.offsetWidth,
                        height: this.offsetHeight
                    },
                    styles, {
                        display: 'block',
                        position: 'absolute',
                        zIndex: -1,
                        filter: ifopac ? "Alpha(Opacity='0')" : ''
                    })
                })).injectBefore(this.firstChild)
            }
        }
        return this
    }
});

