Button roll over

Hello,

How can i make this:
I have a square. It is a photo. When i want to roll over the square i want it to become black. But if you roll out it has to stay black for 2 seconds. It has to stay there for two seconds also when you only roll over quickly, like one 10th of a second it has to stay there for 2 seconds. I cant get this right. I think it is very simple:) And when you hit the button it has to play a other scene. thanks