S&P 500, Nasdaq close with weekly losses; Facebook-Australia row intensifies