I'm looking to design product pages in which the customer can select the type of shirt, color of the shirt and the size of the shirt but where it will change the image displayed of the shir (like t-shirt hell for example). That's not a problem. The problem is I don't understand the manner in which the details of the purchase are relayed to the shopping cart and how I can create linked drop down menus that can do that. I know it has to deal with Ajax but I don't know much about that yet.

I didn't design my current product pages for my site but it has an option to change the size and input the quantity for an order and submit it to the shopping cart. I'd like a similar effect but including a product ID that I'll provide that comes along with an option on a drop down menu.
Here's one of the current product pages I have

Any and all help in this matter would certainly be appreciated