I have a Mac OSX 10.5

This just started happening when I turn it on. When I open firefox or sarari, equal lines start running across the bar. So i went to quit. I go to the the drop down box to do this, and the bar to pick something, well it wont stop its moving fast and its clicking through. Unless your quick, you cant pick shut down. I found out if I go into the search engine and just manage to type something then search then it stops this nonsense. It is only on start up.

I dont know what to do. I was going to sell this and upgrade but I cant with this nonsense.