Everything you ever wanted to know about the salary cap, luxury tax and all things related to the Collective Bargaining Agreement can be found here:
http://members.cox.net/lmcoon/salarycap.htm
As to your scenario, when two teams are both over the salary cap (like the Spurs and Wizards), the value of the contracts traded must be within 125% plus $100K. So with Manu making 10.7M next year, the Wizards would have to send between 8.4 and 13.5M in contracts back to the Spurs. Caron Butler would work, but why would the Wizards trade Butler and a top 5 draft pick to get Manu?