CSS rotation

For any object (eg. square) the first rotation should be in the clockwise direction, the next should be in the anti-clockwise direction(back to original state). The next again in the clockwise direction. This order should continue on each mouseover .
The square rotates on mouseover in clockwise direction for odd numbered mouseover and in anticlockwise direction for even numbered mouseover