Application of the background-field method to the electroweak standard model