Slovenia acceded to both NATO and the EU in the spring of 2004 ; it joined the eurozone in 2007 .