Update header.js

Efficiency improvements in scroll logic. 

This handler runs repeatedly every time you scroll. Why evaluate all this logic, when scrolling==false is enough to make them all evaluate false. Also, if one of them happens, the others are automatically excluded, so how about some "else if" action?

Let's not repeat ourselves so much.