Cleaned up delNote() javascript function