Thanks mate, now all my buttons work, i have an mx510 so now i can finally use it for what its worth :D

However, you are right about button 4 becoming button 6 when reaching the top of the page....