Electronic-structure and Stability of Different Crystal Phases of Magnesium-oxide