Montana teacher gets day in jail for inappropriate messages