Hi,
There is a lot that could be optimised there,
Make a local copy of timeon and make sure its a char
Use a while loop and count down to 0
Make i a char instead of int
Thats without looking at your logic.
There is a recent on my blog rcarduino.blogspot.com tht will show you how to view the assembly output of your sketch, you should see you loop get smaller after these changes
Duane B