12. Given the ellipse $C: \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$ with an eccentricity of $\frac{2}{3}$, $A_{1}, A_{2}$ are the left and right vertices of the ellipse $C$, $B$ is the upper vertex of the ellipse, $F_{1}$ is the left focus of the ellipse $C$, and the area of $\triangle A_{1} F_{1} B$ is $\frac{\sqrt{5}}{2}$.
(1) Find the equation of the ellipse $C$;
(2) Let the moving line $l$ passing through the point $D(1,0)$ intersect the ellipse $C$ at points $E, F$ (point $E$ is above the $x$-axis), and let $M, N$ be the points where the lines $A_{1} E, A_{2} F$ intersect the $y$-axis, respectively. Find the value of $\frac{|O M|}{|O N|}$.
(1) According to the problem, $\left\{\begin{array}{l}\frac{b^{2}}{a^{2}}=\frac{5}{9}, \\ (a-c) b=\sqrt{5}\end{array} \Rightarrow\left\{\begin{array}{l}a=3, \\ b=\sqrt{5} .\end{array}\right.\right.$ Therefore, the equation of the ellipse $C$ is $\frac{x^{2}}{9}+\frac{y^{2}}{5}=1$.
(2) Let $E\left(x_{1}, y_{1}\right), F\left(x_{2}, y_{2}\right), A_{1}(-3,0), A_{2}(3,0)$, then $k_{A_{1} E}=\frac{y_{1}}{x_{1}+3}$
$\Rightarrow A_{1} E: y=\frac{y_{1}}{x_{1}+3}(x+3)$, let $x=0 \Rightarrow M\left(0, \frac{3 y_{1}}{x_{1}+3}\right)$.
Similarly, $A_{2} F: y=\frac{y_{2}}{x_{2}-3}(x-3)$, let $y=0 \Rightarrow N\left(0, \frac{-3 y_{2}}{x_{2}-3}\right)$.
Let $l: x=n y+1$, combining $\left\{\begin{array}{l}x=n y+1, \\ 5 x^{2}+9 y^{2}=45\end{array} \Rightarrow\left(5 n^{2}+9\right) y^{2}+10 n y-40=0\right.$.
From $\frac{x_{1}^{2}}{9}+\frac{y_{1}^{2}}{5}=1 \Rightarrow \frac{y_{1}^{2}}{5}=\frac{9-x_{1}^{2}}{9} \Rightarrow \frac{3 y_{1}}{x_{1}+3}=\frac{5\left(3-x_{1}\right)}{3 y_{1}}$,
thus $\frac{|O M|}{|O N|}=\left|\frac{5\left(x_{1}-3\right)\left(x_{2}-3\right)}{9 y_{1} y_{2}}\right|=\left|\frac{5\left(n y_{1}-2\right)\left(n y_{2}-2\right)}{9 y_{1} y_{2}}\right|$
$=\left|\frac{5 n^{2} y_{1} y_{2}-10 n\left(y_{1}+y_{2}\right)+20}{9 y_{1} y_{2}}\right|=\left|\frac{-200 n^{2}+100 n^{2}+20\left(5 n^{2}+9\right)}{360}\right|=\frac{1}{2}$.