Structural, electronic and magnetic properties of Co/Pd(111) and Co/Pt(111)