Inter-municipal cooperation in administrative tasks - the role of population dynamics and elections