  In this paper the necessary conditions of optimality in the form of maximum
principle are derived for a very general class of variational problems. This
class includes problems with any optimization criteria and constraints that can
be constructed by combining some basic types (differential equation, integral
equations, algebraic equation, differential equations with delays, etc). For
each problem from this class the necessary optimality conditions are produced
by constructing its Lagrange function $R$ and then by dividing its variables
into three groups denoted as $u(t)$, $x(t)$ and $a$ correspondingly. $a$ are
parameters which are constant over time. The conditions of optimality state
that a non-zero vector function of Lagrange multipliers exists such that on the
optimal solution function $R$ attains maximum on $u$, is stationary on $x$, and
the integral of $R$ over the control period $S$ can't be improved locally.
Similar conditions are also obtained for sliding regimes. Here solution is
given by the limit of maximizing sequence on which the variables of the second
group are switching with infinite frequency between some (basic) values.
