I have been on my iPhone 3gs contract for a while now and it ends in February.. I was wondering if at the end of my contract I would be able to upgrade my iPhone for the new HTC Desire HD, also If it would be free or not..?

Additionally, would it be possible to do it before the contract ends, And would it cost? If so how much.. Thankyou so much