// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

jQuery.ajaxSetup({
    'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
    });

jQuery.fn.submitWithAjax = function() {
  this.submit(function() {
      $.post(this.action, $(this).serialize(), null, "script"); 
      return false;
      });
  return this;
};

function confirm_box() {
   $('a.confirm_delete').click(function(event){
      var href = $(this).attr('href');
      event.preventDefault();
        $.msgBox({
          title: "Are You Sure?",
          content: $(this).attr("message"),
          type: "confirm",
          buttons: [{ value: "Yes" }, { value: "No" }],
          success: function (result) {
            if (result == "Yes") {
              $.get(href);              
            }
          }
        });
    });
}

var metricQueue = new Array();

