$(function() {
  //warn if not in Chrome
  if (!window.chrome) {
    $("#page-body").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><strong>Warning!</strong> Myria is developed and tested in Google Chrome, and other browsers may not support all the features.</div>');
  }

  //back to top button
  var offset = 220;
  var duration = 300;
  $('.back-to-top').hide();
  $(window).scroll(function() {
    if ($(this).scrollTop() > offset) {
      $('.back-to-top').fadeIn(duration);
    } else {
      $('.back-to-top').fadeOut(duration);
    }
  });

  $('.back-to-top').click(function(event) {
    event.preventDefault();
    $('html, body').animate({scrollTop: 0}, duration);
    return false;
  });

  $("[data-toggle=tooltip]").tooltip();

  $("abbr.timeago").timeago();
});

@@ -430,16 +430,294 @@
 );%0A  %7D%0A%0A
+  //warn if backend is not available%0A  if (connectionString.indexOf('error') === 0) %7B%0A    $(%22#page-body%22).prepend('%3Cdiv class=%22alert alert-danger alert-dismissible%22 role=%22alert%22%3E%3Cstrong%3EError!%3C/strong%3E Unable to connect to Myria. Most functionality will not work.%3C/div%3E');%0A  %7D%0A%0A
   //back

put up an alert if the backend is down