Can you try this:
1: Set the property ClientIDMode="Static" for your label lTotalPayment in footer.
2: Then try this modification for the js function:
function footer() {
var lbl = document.getElementById('lTotalPayment');
lbl.innerText="SomeValue";
}
I haven't tested it but see if that works but should be something along that line for sure.