<script type="text/javascript" src="{{ '/jslib/modernizr.custom.js'|media }}"></script>
<script type="text/javascript">
    var askbot = {};
    askbot['data'] = {};
    askbot['data']['userIsAuthenticated'] = {{ request.user.is_authenticated|as_js_bool }};
    askbot['data']['languageCode'] = '{{ current_language_code|escapejs }}';
    {% if request.user.is_authenticated %}
        askbot['data']['userId'] = {{ request.user.id }};
        askbot['data']['userName'] = '{{ request.user.username|escapejs }}';
        askbot['data']['userEmail'] = '{{ request.user.email|escapejs }}';
        askbot['data']['userProfileUrl'] = '{{ request.user.get_profile_url()|escapejs }}';
        askbot['data']['userIsAdminOrMod'] = {{ request.user.is_administrator_or_moderator()|as_js_bool }};
        askbot['data']['userIsAdmin'] = {{ request.user.is_administrator()|as_js_bool }};
        askbot['data']['userReputation'] = {{ request.user.reputation }};
        askbot['data']['userIsReadOnly'] = {{ request.user.is_read_only()|as_js_bool }};
    {% else %}
        askbot['data']['userReputation'] = 0;
        askbot['data']['userEmail'] = null;
        askbot['data']['userIsReadOnly'] = false;//in principle we allow anon users to start posting
    {% endif %}
    askbot['urls'] = {};
    askbot['settings'] = {};
    askbot['messages'] = {};
    {% if settings.EDITOR_TYPE == 'tinymce' %}
        askbot['settings']['tinymceEditorDeselector'] = '{{ settings.TINYMCE_EDITOR_DESELECTOR }}';
    {% endif %}
</script>
<script type="text/javascript" src="{{ url('askbot_jsi18n') }}"></script>
{# avoid adding javascript here so that pages load faster #}
