Click the link below for more information on the loan modification process. It's been helpful to many so far.
Let me know if you have other questions.
From your post it appears that you are selling and buying, so selling a home for less money than you owe is called a "short sale". If that is the case then you should post another question regarding "short sales".
Also visit http://www.hud.gov for more tips for homeowners.