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;
};

jQuery.fn.makeElementDisappear = function(){
  this.fadeOut(5000);
}

$(document).ready(function() {
  $(".notice").makeElementDisappear();

  $("#new_style").submitWithAjax();
});


