Programming Layout Changes into Theme Templates & CSS Files
Many existing themes already provide this kind of feature (usually using a preprocess function) so I would recommend looking at a theme like Zen or another popular base theme for examples of varying the page layout with a body class which specifies the overall structure of the page.