Need help with a JQuery script

On my page: http://funmedusa.com

there is a script that I am using for the progress bar that fills as you scroll down the page just under the nav links. It works great, but it does not fill to 100% when you reach the bottom of the page. Can someone help me get this working, please?

Here is the script:

jQuery(window).scroll(function() {
var h = jQuery(document).height();
var w = jQuery(window).height();
var s = jQuery(window).scrollTop();
var t = (s / h) * w;
console.log(s + ' ' + h + ' ' + w );

var p = Math.ceil((s + t) / h * 100) + 1;
if(s==0){ p = 0; }
jQuery('#progress-bar').width(p + '%');
});

Here is the post from which I got the original code. It’s a bit over my head, but maybe it can help you figure this out.

http://davidkelley.me/2013/07/16/scrolling-progress-bar.html

Thanks