That is what has happened in Thailand , where , after a year-long political impasse , the middle class split between the urban groups of Bangkok , many of which allied themselves with the royalist elite , and their peers in the smaller cities and the countryside , who linked up with farmers and with the political groupings of Thaksin Shinawatra , a former prime minister .