{% if userecho is not defined %}
  {% set userecho = true %}
{% endif %}

{% javascripts
  'js/jquery-1.8.2.prod.js'
  'js/jquery-ui-1.10.1.custom.min.js'
  'js/swfobject.js'
  'jplayer/js/jquery.jplayer.min.js'
  'jplayer/js/jplayer.playlist.min.js'
  'js/jquery.form-2.14.js'
  'js/jConfirmAction/jconfirmaction.jquery.js'
  'js/jquery.scrollTo.min.js'
  'js/jquery.stickysidebar.js'
  'js/jquery.sticky.js'
  '@MuzichCoreBundle/Resources/public/js/TagPrompt.js'
  '@MuzichCoreBundle/Resources/public/js/player/*'
  '@MuzichCoreBundle/Resources/public/js/play2.js'
  '@MuzichCoreBundle/Resources/public/js/autoplay.js'
  '@MuzichCoreBundle/Resources/public/js/muzich.js' %}{# filter='yui_js' %}#}
  <script src="{{ asset_url }}"></script>
{% endjavascripts %}
  <script src="/js/jquery.aSimpleTour.js"></script>

<!--<script src="https://w.soundcloud.com/player/api.js"></script>
<script src="https://connect.soundcloud.com/sdk.js"></script>
-->
<script>
  $(document).ready(function(){  
    // Pour le moment on charge toujours ces scripts
    var tag = document.createElement('script');
    tag.src = "//www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    
    var tag = document.createElement('script');
    tag.src = "//w.soundcloud.com/player/api.js";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    
    var tag = document.createElement('script');
    tag.src = "//connect.soundcloud.com/sdk.js";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  });
</script>

{% if userecho %}
  <script type='text/javascript'>

    var _ues = {
    host:'muzich.userecho.com',
    forum:'17651',
    lang:'fr',
    tab_corner_radius:5,
    tab_font_size:20,
    tab_image_hash:'Vm9zIHJldG91cnM%3D',
    tab_chat_hash:'Y2hhdA%3D%3D',
    tab_alignment:'right',
    tab_text_color:'#000000',
    tab_text_shadow_color:'#66666655',
    tab_bg_color:'#F4F4F4',
    tab_hover_color:'#D5D5D5'
    };

  $(document).ready(function(){  
  (function() {
      var _ue = document.createElement('script'); _ue.type = 'text/javascript'; _ue.async = true;
      _ue.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.userecho.com/js/widget-1.4.gz.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(_ue, s);
    })();
  });

  </script>
{% endif %}

<script type="text/javascript">
  {% if app.user %}
    visitor = false;
  {% else %}
    visitor = true;
  {% endif %}
  string_follow_stop = "{{ 'user.stop_follow'|trans({}, 'users') }}";
  string_follow_following = "{{ 'user.following'|trans({}, 'users') }}";
  string_follow_follow = "{{ 'user.follow'|trans({}, 'users') }}";
  string_tag_add_title = "{{ 'tags.add.title'|trans({}, 'userui') }}";
  string_tag_add_text = "{{ 'tags.add.text'|trans({}, 'userui') }}";
  string_tag_add_argument = "{{ 'tags.add.argument'|trans({}, 'userui') }}";
  string_tag_add_inputs_cancel = "{{ 'tags.add.inputs.cancel'|trans({}, 'userui') }}";
  string_tag_add_inputs_submit = "{{ 'tags.add.inputs.submit'|trans({}, 'userui') }}";
  string_element_delete_confirm_sentence = "{{ 'element.remove.confirm.sentence'|trans({}, 'elements') }}";
  string_element_delete_confirm_yes = "{{ 'element.remove.confirm.yes'|trans({}, 'elements') }}";
  string_element_delete_confirm_no = "{{ 'element.remove.confirm.no'|trans({}, 'elements') }}";
  string_comment_delete_confirm_sentence = "{{ 'comment.remove.confirm.sentence'|trans({}, 'elements') }}";
  string_comment_delete_confirm_yes = "{{ 'comment.remove.confirm.yes'|trans({}, 'elements') }}";
  string_comment_delete_confirm_no = "{{ 'comment.remove.confirm.no'|trans({}, 'elements') }}";
  string_tag_addtofav_confirm_sentence = "{{ 'element.tag.addtofav.confirm.sentence'|trans({}, 'elements') }}";
  string_tag_addtofav_confirm_yes = "{{ 'element.tag.addtofav.confirm.yes'|trans({}, 'elements') }}";
  string_tag_addtofav_confirm_no = "{{ 'element.tag.addtofav.confirm.no'|trans({}, 'elements') }}";
  string_elementreport_confirm_sentence = "{{ 'element.report.confirm.sentence'|trans({}, 'userui') }}";
  string_elementreport_confirm_yes = "{{ 'element.report.confirm.yes'|trans({}, 'userui') }}";
  string_elementreport_confirm_no = "{{ 'element.report.confirm.no'|trans({}, 'userui') }}";
  string_commentreport_confirm_sentence = "{{ 'comment.report.confirm.sentence'|trans({}, 'userui') }}";
  string_commentreport_confirm_yes = "{{ 'comment.report.confirm.yes'|trans({}, 'userui') }}";
  string_commentreport_confirm_no = "{{ 'comment.report.confirm.no'|trans({}, 'userui') }}";
  string_elementreshare_confirm_sentence = "{{ 'element.reshare.confirm.sentence'|trans({}, 'userui') }}";
  string_elementreshare_confirm_yes = "{{ 'element.reshare.confirm.yes'|trans({}, 'userui') }}";
  string_elementreshare_confirm_no = "{{ 'element.reshare.confirm.no'|trans({}, 'userui') }}";
  {% autoescape false %}
  string_search_tag_title = "{{ 'search_tag.title'|trans({}, 'userui') }}";
  {% endautoescape %}
  string_removefromgroup_sentence = "{{ 'element.group.remove_from.confirm.title'|trans({}, 'elements') }}";
  string_removefromgroup_confirm_yes = "{{ 'element.group.remove_from.confirm.yes'|trans({}, 'elements') }}";
  string_removefromgroup_confirm_no = "{{ 'element.group.remove_from.confirm.no'|trans({}, 'elements') }}";
  string_element_removefromplaylist_confirm_sentence = "{{ 'playlist.remove_element'|trans({}, 'elements') }}";
  string_element_deleteplaylist_confirm_sentence = "{{ 'playlist.delete'|trans({}, 'elements') }}";

  url_home = "{{ path('home') }}";
  url_search_tag = "{{ path('search_tag') }}";
  url_get_favorites_tags = "{{ path('ajax_get_favorites_tags') }}";
  url_add_tag = "{{ path('ajax_add_tag') }}";
  url_element_new_count = "{{ path('element_new_count') }}";
  url_element_new_get = "{{ path('element_new_get') }}";
  url_global_search = "{{ path('global_search') }}";
  url_datas_api = "{{ path('element_retrieve_api_datas') }}";
  url_element_add = "{{ path('element_add') }}";
  url_element_dom_get_one_autoplay = "{{ path('element_dom_get_one', {'type':'autoplay'}) }}";
  url_element_get_stream_data = "{{ path('element_get_stream_data') }}";
  url_img_ajax_loader = "{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}";
  url_get_embed_for_element = "{{ path('url_get_embed_for_element') }}";
  url_helpbox_tags_favorites = "{{ path('helpbox_tags_favorites') }}";
  url_csrf = "{{ path('get_csrf_token') }}";
  url_subscription_or_login = "{{ path('subscribe_or_login') }}";
  url_email_not_confirmed = "{{ path('email_not_confirmed') }}";
  url_send_email_confirmation = "{{ path('send_email_confirmation') }}";
  
  config_player_youtube_width = "{{ player_config_youtube_width }}";
  config_player_youtube_height = "{{ player_config_youtube_height }}";
</script>