javascript onclick function changes orientation of cube.