Nxn rubik's cube - how many orientations?

I'm sitting here with my new 5x5x5 rubik's cube, and I was just wondering how many possible orientations there were. I THOUGHT:
-Each corner has 3 orientations and 8 positions
-Each middle side has 2 orientations and 12 positions
-Each outer side has 2 orientations and 24 positions
-etc etc for each piece
-multiply each possible position and orientation together

However, I know that certain orientations are not physically possible to achieve. For example, you can't have a solved cube with only one corner with a different orientation. I'm not sure how to exclude these when trying to account for all physically possible orientations.

So my question: what is the total number of different ways a nxnxn rubik's cube can be presented assuming that with normal rotations of a rubik's cube, it can be solved. I tried generalizing it by looking at a 1x1x1 cube and 2x2x2 cube, but I'm still really lost.