Rotation

I need to write a program that draws a 3D object in prespective view and allows the user to rotate this object around one of the space’s axis (x, y, or z) which the user selected (by keyboard key). Rotation around one axis mustn’t effect rotations around other axises. The rotation angle is calculated in addition to the mouse’s last movement.
Please help me, i am stuck with this problem for a too long while.
Thanks!!!

Quaternions @ www.gametutorials.com