Not bitter then Merlin? lol
Davie, I was in a similar situation at a similar age to your daughter except I HAD to live with my mother and watch this all going on in front of me, and it caused me a great deal of problems and in some ways, although I love her dearly and we get on well now and I'd never ever hold it against her or tell her how I feel, deep down I don't think I can forgive my mum properly for not being there for me when I was falling apart and she was galavanting with her fling. Sadly although I would have loved to, living with my dad was not an option, he went to stay at his parents' house and there was no room, plus I had to stay whre my younger brother was to make sure he was ok - at 14/15 I was old enough to care for myself.
Please just talk, talk and talk with your daughter, don't let it become competition between you and you wife, above all ensure your daughter knows you love her more than anything and whatever she chooses is ok with you. She may choose to live with her mum (at 13 the freedom her mum is giving her, although for the wrong reasons, may seem attractive to start with), then in two weeks want to stay with you. Give her time to adjust and to settle, but just make sure she knows she is wanted and safe wherever she is. Don't use the treatment of your ddaughter as a way to get back at your ex.
Best of luck with everything x x x