Smectic Layer Orientation in Confined Geometries