eRep BM by hesar  completely rewritten code for new battle page