<% if(theme.changyan.appid){ %>
  <div id="SOHUCS" sid='<%= page.permalink %>'></div>
  <script type="text/javascript">
    function loadChangyan() {
      var appid = '<%= theme.changyan.appid %>';
      var conf = '<%= theme.changyan.appkey %>';
      var width = window.innerWidth || document.documentElement.clientWidth;
      if (width < 960) {
        window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
      } else {
        addScript("http://changyan.sohu.com/upload/changyan.js", function() {
          window.changyan.api.config({
            appid: appid,
            conf: conf
          })
        });
      }
    }
    createObserver(loadChangyan, 'SOHUCS')
  </script>
<% } %>
