function swapLargeImage(trg, newImagePath, newLargeImagePath)
{
	$('#product_image').attr('src', newImagePath);
	$('#product_image').parents('a:first').attr('href', newLargeImagePath);
	
	$('#alternate_views li.active').removeClass('active');
	$(trg).parents('li:first').addClass('active');
}

function copyBillingToShipping()
{
	var fieldsToCopy = {'billingfirstname' : 'shippingfirstname',
						'billinglastname' : 'shippinglastname',
						'billingaddress' : 'shippingaddress',
						'billingcity' : 'shippingcity'};
	var startKey;
	var startElement;
	var startVal;
	
	for (startKey in fieldsToCopy)
	{
		startElement = $('[title="' + startKey + '"]');
		if (startElement.length)
		{
			$('[title="' + fieldsToCopy[startKey] + '"]').val(startElement.val());
		}
	}
}

$(function ()
{

	$('#copyBillingToShipping').click(function ()	
	{
		copyBillingToShipping();
	});
	
	$('form#change_country select:gt(0)').removeAttr('onchange');

	// hook thickbox up to "Quick Look" buttons
	$('#two-columns .products .product-info strong').click(function (event)
	{
		// stop default behaviour
		event.preventDefault();
		// remove click border
		this.blur();
	
		// get caption: either title or name attribute
		var caption = this.title || this.name || "";
		
		// get rel attribute for image groups
		var group = $(this).attr('rel') || false;
		
		var link = $(this).attr('href');
		
		// display the box for the elements href
		TB_show(caption, link, group);
	});
	//tb_show('strong');
});
