$(document).ready(function()
{
	$('form.addItem').submit(function(e)
	{
		e.preventDefault();
		
		// Get all input elements in the form.
		var parameters = $(':input', $(this));
		
		addItem(parameters);
	});
});

function addItem(parameters)
{
	// Send request.
	$.ajax(
	{
		url: 'ajax/addItem.asp', 
		type: 'POST', 
		data: parameters, 
		dataType: 'html', 
		success: function(html)
		{
			showMessageBox(html);
			updateCartSummary();
		}
	});
}
