Judge orders man to apologize to ex-wife via Facebook