  Let $R$ be a commutative ring with $ 1 \neq 0$. We recall that a proper ideal
$I$ of $R$ is called a semiprimary ideal of $R$ if whenever $a,b\in R$ and $ab
\in I$, then $a\in \sqrt{I}$ or $b\in \sqrt{I}$. We say $I$ is a {\it weakly
semiprimary ideal} of $R$ if whenever $a,b\in R$ and $0 \not = ab \in I$, then
$a\in \sqrt{I}$ or $b\in \sqrt{I}$. In this paper, we introduce a new class of
ideals that is closely related to the class of (weakly) semiprimary ideals. Let
$I(R)$ be the set of all ideals of $R$ and let $\delta: I(R) \rightarrow I(R)$
be a function. Then $\delta$ is called an expansion function of ideals of $R$
if whenever $L, I, J$ are ideals of $R$ with $J \subseteq I$, then $L \subseteq
\delta(L)$ and $\delta(J) \subseteq \delta(I)$. Let $\delta$ be an expansion
function of ideals of $R$. Then a proper ideal $I$ of $R$ (i.e., $I \not = R$)
is called a ({\it $\delta$-semiprimary}) {\it weakly $\delta$-semiprimary}
ideal of $R$ if ($ab \in I$) $0 \not = ab \in I$ implies $a \in \delta(I)$ or
$b \in \delta(I)$. For example, let $\delta: I(R) \rightarrow I(R)$ such that
$\delta(I) = \sqrt{I}$. Then $\delta$ is an expansion function of ideals of $R$
and hence a proper ideal $I$ of $R$ is a ($\delta$-semiprimary) weakly
$\delta$-semiprimary ideal of $R$ if and only if $I$ is a (semiprimary) weakly
semiprimary ideal of $R$. A number of results concerning weakly
$\delta$-semiprimary ideals and examples of weakly $\delta$-semiprimary ideals
are given.
