Fixed Footer should disappear at the page footer

I have created a fixed footer which scrolls along the page upto end of the page. Now the problem is when it reaches end of page the fixed footer is hidding page footer. I need to some reference for Javascript to make the fixed footer disappear after reaching the end of page.