(function() {

    var init = function() {
        window.KV = window.KV || {}

        if (window.KV.loaded) {
          return;
        }

        var base = get_base_url();

        // Do not edit the next line, it is auto updated by the build!
        var version = '1329905630';

        if (typeof $ === 'undefined' || !$.fn || !$.fn.jquery || old_jquery()) {
            document.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>');
            window.KV.no_conflict = true;
        }

        document.write('<script src="' + base + '/' + version + '/app/widgets.js' + '"></script>');
    }

    var get_base_url = function() {
      var script, scripts, src;
      scripts = document.getElementsByTagName('script');
      script = scripts[scripts.length - 1];
      src = script.src;
      if (!src) {
        return '';
      }
      return src.substring(0, src.lastIndexOf('/'));
    };

    var old_jquery = function() {
      try {
        return parseFloat($.fn.jquery) < 1.4
      } catch(e) {
        return true;
      }
    };

    init();

})();

