Density functional theory study on the structural and electronic properties of Ag-adsorbed (MgO)n clusters