Bifurcations in nonlinear Schrödinger equations with double well potentials