Electronic and magnetic properties of thin ferromagnetic films