IN pan over medium heat, melt half of the butter and add the onions. Cook til onions are very soft but not browned.
Meanwhile, boil potatoes til tender. Drain and pour into greased casserole dish. Preheat oven to 350.
Add flour to the onions and stir til mixture is well blended and starts bubbling. Remove from heat. Add milk, sour cream, cheeses, salt and pepper. Stir til well mixed and pour over the potatoes. Dot top with remaining butter and bake, uncovered, for 35 to 40 minutes or until golden brown on top.