<PUBLIC:ATTACH EVENT="onready" ONEVENT="window.updateSize()"/>
<PUBLIC:ATTACH EVENT="onresize" ONEVENT="window.updateSize()"/>
<SCRIPT LANGUAGE="JScript">
    (function ieFix(win, undefined) {

        "use strict";

        var $doc = win.document,
                $body = $doc.body,
                windowsWidth = 0,
                $blockquotes = $doc.getElementsByTagName('blockquote'),
                $figures = $doc.getElementsByTagName('figure'),
                elementsLen = $blockquotes.length,
                len = 0,
                i = 0,
                j = 0,
                $div = $doc.createElement('div'),
                $current,
                $element,
                regTree = /(^|\s)tree\-line($|\s)/i,
                regGrid = /(^|\s)grid($|\s)/i,
                className = '',
                $lis,
                $li;

        win.updateSize = function updateSize() {

            windowsWidth = $body.offsetWidth;

            $body.className = 'break-320px' +
                    (windowsWidth > 480 ? ' break-480px' : '') +
                    (windowsWidth > 640 ? ' break-640px' : '') +
                    (windowsWidth > 768 ? ' break-768px' : '') +
                    (windowsWidth > 1024 ? ' break-1024px' : '') +
                    (windowsWidth > 1248 ? ' break-1248px' : '');
        };

        win.updateSize();

        for (i = 0; i < elementsLen; i += 1) {
            $element = $blockquotes[i];

            if (!$element.done) {
                len = $element.childNodes.length;

                $current = $div.cloneNode(true);
                $current.className = "before";
                $element.appendChild($current);

                for (j = 0; j < len; j += 1) {
                    $element.appendChild($element.firstChild);
                }

                $current = $div.cloneNode(true);
                $current.className = "after";
                $element.appendChild($current);

                $element.done = true;
            }
        }

        elementsLen = $figures.length;

        for (i = 0; i < elementsLen; i += 1) {
            $element = $figures[i];

            if (!$element.done) {

                className = $element.className;

                if (regTree.test(className)) {
                    $current = $div.cloneNode(true);
                    $current.className = "before";
                    $element.appendChild($current);
                }

                $element.done = true;
            }
        }

    }(window));
</SCRIPT>