It seems like it is probably close. This is something we could help with in a premier support ticket.
I see that it is moving the position to absolute onload when it shouldn't... so it is getting into the if statement:
if (($(document.body).height()+footerHeight) < ($(window).height())) {
I'd add an alert below it that has:
alert($(document.body).height() + "\n" + footerHeight +"\n" + $(window).height());
See if you can figure out which of those numbers isn't being calculated correctly and why it is getting into that If statement when it shouldn't be.