Electronic and magnetic properties of ErxY1-xCo2 compounds