code reformatted, compatibility in most browsers fixed.