The order of business is, assuming that the derailer hanger is not bent, or has been realigned, is limit screws, cable adjust, and b screew. See
http://www.sheldonbrown.com/derailer-adjustment.html . This site and the Park Tool site will give you all the information you need.
Leland Yee