Rotation and quaternions

I have a strange behavior using quaternions for rotations- if i turn to positive z axis the rotations around x axis are reversed(when moving mouse up and looking to negative z axis = rotate down, doing the same thing when turned to positive z axis = rotate up)Is it ok and I should make some checkings manually or is there a bug in my program ?