  We present an unquenched lattice calculation for the $B^0-\bar{B}^0$
transition amplitude. The calculation, carried out at an inverse lattice
spacing $1/a$ = 2.22(4) GeV, incorporates two flavors of dynamical quarks
described by the fully $O(a)$-improved Wilson fermion action and heavy quarks
described by NRQCD. A particular attention is paid to the uncertainty that
arises from the chiral extrapolation, especially the effect of pion loops, for
light quarks, which we find could be sizable for the leptonic decay of the
$B_d$ meson, whereas it is small for the $B_s$ meson and the $B$ parameters. We
obtain $f_{B_d}=191(10)(^{+12}_{-22})$ MeV, $f_{B_s}/f_{B_d}=1.13(3)(^{+13}_{-\
2})$, $B_{B_d}(m_b)=0.836(27)(^{+56}_{-62})$,
$B_{B_s}/B_{B_d}=1.017(16)(^{+56}_{-17})$, $\xi=1.14(3)(^{+13}_{- 2})$, where
the first error is statistical, and the second is systematic, including
uncertainties due to chiral extrapolation, finite lattice spacing, heavy quark
expansion and perturbative operator matching.
