CAIRO — Egypt is charting a new course in its foreign policy that has already begun shaking up the established order in the Middle East, planning to open the blockaded border with Gaza and normalizing relations with two of Israel and the West’s Islamist foes, Hamas and Iran. Egyptian officials, emboldened by the revolution and with an eye on coming elections, say that they are moving toward policies that more accurately reflect public opinion. In the process they are seeking to reclaim the influence over the region that waned as their country became a predictable ally of Washington and the...