function loadProductInfoAsync(pID) {
	var loadURL = 'product_info_async.php?products_id=' + pID;
	
	$('#cboxLoadedContent').html('<p class="loading_text">Loading...</p>');
	$.fn.colorbox.resize();
	
	$.ajax({
		url: loadURL,
		success: function(data) {
			$('#cboxLoadedContent').html(data);
			var options = { 
			    target:     '#product_cart_container', 
			    success:    function(responseText, statusText, xhr, $form) { 
			        //$('#header_cart_info').html(responseText);
			        $.ajax({
						url: 'update_cart_async.php',
						success: function(data) { $('#header_cart_info').html(data);}
					});
			        $.fn.colorbox.close();
			    } 
			}; 
			
			//$(".cBoxProductInfoMove").colorbox({width:"625px"});
			// product_info colorbox
			loadcBoxProductInfo();
			
			// pass options to ajaxForm 
			$('#addProductToCartForm').ajaxForm(options);
			
			$.fn.colorbox.resize();	
		}
	});
}

function processAddToCart() {
	$.fn.colorbox.close();
	
	var options = { 
        target:        '#add_product_frame'   // target element(s) to be updated with server response 
    };
	
	$('#addProductToCartForm').ajaxSubmit(options);
	return;
}

function updateCart() {
	$('#cart_details_wrapper').load('update_cart_async.php');
}

/* function processAfterResponse(responseText, statusText, xhr, $form) {
	alert ('Successfully Added!');
	$('#cart_details_wrapper').load('update_cart_async.php');
} */
