The best thing you can do is avoid any mudslinging on your own and ignore anything the mother does. Don't allow the child to talk bad about her mother at your house, and don't respond to any of it. See, kids do what they feel they need to do in order to survive at each house. It's completely natural.
Just make each visit as good as possible and the future will take care of itself. I'm a step mom twice and I promise you, it gets better, they all grow up. My kids are now 26, 21, 20, and 18... the last two being step kids.
My youngest told me not that long ago how much she appreciated that we don't talk bad about her mother, or allow her to. So it does work.