
$(function(){$('#updateNoteState').click(function(e){$('#statesList').css('display','block');});$('.state_item').click(function(e){$('#updateNoteState').html($(this).html());$('#statesList').css('display','none');}).hover(function(){$(this).addClass('selected');},function(){$(this).removeClass('selected');});$('#updatenote form').submit(function(e){if($.todo.checkFields('updatenote')){var noteText=$('#updateNoteText');var noteDate=$('#updateNoteDate');var noteState=$('#updateNoteState img').attr('alt');$.post('http://'+window.location.host+'/simpletasks/main/updatenote',{n_id:$.todo.curNote,n_text:noteText.val(),n_date:noteDate.val(),n_state:noteState},function(reply){if(reply.status=='OK'){$.todo.curTrigger.overlay().close();var curRow=$('#note_'+reply.id);curRow.find('img.note_state').attr('src',reply.new_img).attr('alt',reply.new_state);curRow.find('td.note_text pre').html(reply.new_text);curRow.find('td.note_date').html(reply.new_date);}
else{$('#updatenote div.error_message').html(reply.message);}},'json');}
return e.preventDefault();});});