$(document).ready(function () {    if ($("#msg #content").length == 1) {  	$.ajax({      url: '/incfs/msgfrm?style=blank',      type: "GET",      cache: true,      async: false,      success: function (html) { $("#msg #content").html(html); }  	});	}  $('#navt a').focus(function () {    this.blur();  });  $('.sb a').focus(function () {    this.blur();  });	$('input.modal').live("click", function (e) {    e.preventDefault();    var frm = $(this).closest("form");    frm.nyroModalManual({height:240, width:500});	});		$('a.modal').live("click", function (e) {     e.preventDefault();     this.blur();     $.nyroModalManual({       url: $(this).attr('href') + '?style=modal',       title: $(this).text(),        width: 480     });  });  $("#msgfrm input.submit").live("click", function (e) {    e.preventDefault();    var btn = $(this);    var frm = btn.closest("form");    btn.attr('disabled', 'disabled');		$.ajax({      url: frm.attr('action'),      type: "POST",      data: frm.serialize() + '&msg=' + $("#msg textarea").attr("value"),       cache: false,      dataType: "json",      success: function (js) {        if (js.error) {          alert(js.error);          $('*[name="' + js.fld + '"]').focus();          btn.attr('disabled', '');        }         else {          alert(js.success);          $.nyroModalRemove();    		  //$('#mask').click();    		  $("#msg textarea").attr("value", "");        }      }		});  });});
