Gold ends above $1,300, scores gain for the week