+
+
+ var PostNotice = { dataType: 'xml',
+ beforeSubmit: function(formData, jqForm, options) { if ($("#notice_data-text").get(0).value.length == 0) {
+ $("#form_notice").addClass("warning");
+ return false;
+ }
+ $("#notice_action-submit").attr("disabled", "disabled");
+ $("#notice_action-submit").addClass("disabled");
+ return true;
+ },
+ success: function(xml) { if ($("#error", xml).length > 0 || $("#command_result", xml).length > 0) {
+ var result = document._importNode($("p", xml).get(0), true);
+ result = result.textContent || result.innerHTML;
+ alert(result);
+ }
+ else {
+ $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
+ $("#notice_data-text").val("");
+ counter();
+ $("#notices_primary .notice:first").css({display:"none"});
+ $("#notices_primary .notice:first").fadeIn(2500);
+ }
+ $("#notice_action-submit").removeAttr("disabled");
+ $("#notice_action-submit").removeClass("disabled");
+ }
+ };
+ $("#form_notice").ajaxForm(PostNotice);
+ $("#form_notice").each(addAjaxHidden);
+
+ $(".notice").hover(
+ function () {
+ $(this).addClass('hover');
+ },
+ function () {
+ $(this).removeClass('hover');
+ }
+ );