changed from win to doc for on scroll event subscription

For on scroll pagination. It's not working with win.scroll. I switched it to doc.scroll and it's working fine. 

Also, I didn't see any reason 'doc' should not be a local variable instead of a global. so put a 'var' in front of it. 

These changes are working fine for my use case. i.e. twitter style on-scroll pagination.