Court orders man to apologize to estranged wife on Facebook