My limited understanding is that most of the Pakis, along with Paki Intelligence, support Al Qaeda and the Taliban. Musharraf and the Army are our ally, as long as its not too difficult and the goodies keep coming.
The Pakistani army & it's intelligence agency,the ISI,created the Taliban-well that's a fact everyone knows.As I have said many times,the ISI is not independent of the army.A vast chunk of officers & resources come from the army.It suits the Generals to allow the impression that the ISI is shady to flourish.There is clearly popular support for Islamic extremism in Pakistan,but when have such political parties ever come to power there???The MMA did well in 2002, because of the support of Musharraf who wanted to undercut votes to the opposition alliance.The army sustains these groups so that it's position is not compromised esp in trouble spots like the NWFP,Sindh or POK.The point here being these Islamic groups are not as omnipotent as many people think,because Pakistan is a seriously divided countries on ethnic & religious(Shia-Sunni) terms-the army is the only institution in Pakistan which draws members from all regions(though it too is dominated by Punjabis).
The Army keeps playing the game you talk about -playing both sides in order to keep it's position intact.