Does MtGox charge commission in USD or in BTC? When we buy BTC using USD on MtGox,

Does MtGox charge 0.6% of the USD then do a trade, or does MtGox do a trade first, then charge 0.6% of the BTC we receive?

Similarly, when we sell BTC for USD on MtGox,

Does MtGox charge 0.6% of the BTC then do a trade, or does MtGox do a trade first, then charge 0.6% of the USD we receive?
Mtgox charges the fee from whatever you're buying.

So if you buy 100 btc for however many USD, you'll buy the BTC, then you'll be charged 0.6% of your 100btc as fee.

If you buy 100 USD for however many BTC (i.e., sell some btc), you'll get your USD, and will be charged 0.6% of your 100USD as fee.

Edit: This is actually configurable. If you go to the mtgox settings page in your account, you can set the fee to be taken out either as above (default), or out of your USD balance always.