If I unlock my iPhone, will that void my 2-year contract with AT&T?

I have an iPhone 3gs. I'm planning on getting the iPhone 5 very soon. If I were to unlock either of these devices on my own, would that void my contract with AT&T? Would I have to pay an early termination fee? I'm still going to use AT&T as my provider. I'm not planning on switching to any other provider. I just want to unlock my iPhone in the case that I ever go to a foreign country and want to use my phone with a different SIM card. I don't want to get in trouble though. I know jailbreaking voids your warranty with Apple, but will unlocking the iPhone cause any problems for me?

Short answer: No, factory unlocking won't void your warranty.

No it will not.