Dollar gains after weeks of losses as investors focus on U.S. aid package