Any other anomalies that occur when it happens? If you're having an issue where the cursor flies to the corners of the screen and sometimes the right click menu appears, then you get the max zoom, I believe this is usually caused by an interruption in the mouse's PS/2 communication. Unfortunately it's just a random problem I've had with mice in the past and I believe a flaw in the architecture. For optical mice, they seemed to do it more frequently if it lost tracking (IE using without a mousepad).
If this is similar your problem, you may want to look into getting a USB mouse. I usually use Microsoft or Logitech optical mice, last forever, do a good job and usually only cost around $10 from Newegg.