/*global document, $, N*/


'use strict';


$(function () {
  // Attach tooltip handler to matching elements
  $('._tip').tooltip();

  // Attach collapse handler to matching elements
  $('._collapser').ndCollapser();

  //
  // Social buttons defered load - after all
  //

  setTimeout(function () {
    function injectScript(src, async, id) {
      var el, script;

      if (id && document.getElementById(id)) {
        return;
      }

      el = document.createElement('script');

      el.id     = id;
      el.type   = 'text/javascript';
      el.async  = async;
      el.src    = src;

      script = document.getElementsByTagName('script')[0];
      script.parentNode.insertBefore(el, script);
    }

    // Twitter buttons
    injectScript('//platform.twitter.com/widgets.js', false, 'twitter-wjs');

    // Google +1
    injectScript('https://apis.google.com/js/plusone.js', true);
  }, 2000);
});

@@ -131,93 +131,8 @@
 );%0A%0A
-  // Attach collapse handler to matching elements%0A  $('._collapser').ndCollapser();%0A%0A
   //

Remove nd collapser init