{% load i18n static sekizai_tags %}

<div class="djangocms-flash">
    <object id="djangocms-flash-{{ object.id }}" width="{{ object.width }}" height="{{ object.height }}" data="{{ object.file.url }}" type="application/x-shockwave-flash">
        <param name="movie" value="{{ object.file.url }}"/>
        <param name="allowFullScreen" value="true" />
        <param name="allowScriptAccess" value="always" />
        <param name="allowFullScreen" value="true" />
        <param name="quality" value="autohigh" />
        <param name="wmode" value="opaque" />
        <param name="flashvars" value="lang={{ LANGUAGE_CODE }}" />
            <!--[if !IE]>-->
            <object width="{{ object.width }}" height="{{ object.height }}" data="{{ object.file.url }}" type="application/x-shockwave-flash">
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <param name="allowFullScreen" value="true" />
            <param name="quality" value="autohigh" />
            <param name="wmode" value="opaque" />
            <param name="flashvars" value="lang={{ LANGUAGE_CODE }}" />
            <!--<![endif]-->
        <!-- alternate content -->
        {% trans "Missing flash plugin. Please download the latest Adobe Flash Player: " %}<br />
        <a href="https://www.adobe.com/go/getflashplayer">
            <img alt="{% trans 'Get Adobe Flash Player' %}" src="{% static "cms/img/icons/plugins/get_flash_player.gif" %}" />
        </a>
        <!-- /alternate content -->
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
    </object>
</div>

{% addtoblock "js" %}<script src="{% static "js/libs/swfobject.min.js" %}"></script>{% endaddtoblock %}
{% addtoblock "js" %}
<script>
(function () {
    // save settings
    var flashvars = { lang: '{{ LANGUAGE_CODE }}' };
    var params = { menu: 'false', wmode: 'opaque' };
    var attributes = {
        id: 'djangocms-flash-swf-{{ object.id }}',
        name: 'djangocms-flash-name-{{ object.id }}'
    };
    // replace flash_plugin object through swfobject
    swfobject.embedSWF('{{ object.file.url }}',
        'djangocms-flash-{{ object.id }}', '{{ object.width }}', '{{ object.height }}', '9',
        '{% static "swf/expressInstall.swf" %}', flashvars, params, attributes);
})();
</script>
{% endaddtoblock %}
