Tuning the Band Gap of ZnO Thin Films by Mg Doping