Going to Spain

There are different dialects of Spanish, and I have been wanting to learn the spanish that they speak in Spain. I know that it is different than the Spanish that they speak in Mexico, but it must be similar enough because it came from the same place. That is why I am going to learn spanish through this program that I bought. I know that the basic words are very similar. There are just some phrases and other dialect things that are a bit different. I would love to be able to speak it very well when I take my trip to Spain.