Not sure what is in pain, but you really need to exercise at least lightly, or you will end up losing muscle, not fat.
At 13 yrs old and 5'7" tall, you are not 39 pounds overweight. If you only weighed 100 pounds at your height, you'd look like a scarecrow, and you still wouldn't fit in.
You're still a child and your body is not fully developed; losing weight at too rapid weight, can cause lasting damage.
I would NEVER recommend a detox or anything like it, to someone your age.
You can try getting a detox from the health-food store. This will help get rid of toxins in your body plus water weight.
Another thing you can try is just a better diet. Cut down saturated fats, sugars, sodium, and white-flour. Eat whole grains, lots of veggies (especailly green veggies), lots of fruit, and low-fat meets (like white meat or fish, unbreaded). Look up the "My Plate" diet online, this is what I use and it's very helpful in losing weight.
Cutting back on junk food, fast food, and deserts is also helpful. Never cut them out completely (cut it down to "once a month" or "only on special occasions") because you need to make sure your body can still handle it. Diets that require you to cut something out competely will almost always fail because you will crave the food, then you will binge. There are very good replacements--Frozen yogurt instead of ice cream, 100% all-natural low-sugar fruit juice or diet tea instead of soda, and low-fat pretzels instea of potato chips, for example.
Cut soda out competely. You don't need that. And trust me, once you cut it out you will feel SO much better. I can barely stomach the stuff anymore, it actually makes me sick. When I want to drink something sweet, I drink diet iced tea or diet Crystal Light because they have no sugar, carbs, or calories.
Also, up your water intake.
I hope this helps!
~ Em
p.s i am 5 foot 7inches female