Polar decompositions in finite dimensional indefinite scalar product spaces: General theory