jQuery(document).ready(function($){ 

		
		

	$(".CheckOutProceed form").submit(function(event) {
		
			event.preventDefault();
			
		var productIDVal = $('input[name="product_id"]', $(this)).val();
			
		console.log(productIDVal);
		
		var productX 	= $("#ProductListItem" + productIDVal + ' .ProductListImageRelative').offset().left;
		var productY 	= $("#ProductListItem" + productIDVal + ' .ProductListImageRelative').offset().top;
		
		console.log(productY);
		

			var basketX 		= $("#RightColumn").offset().left;
			var basketY 		= $("#RightColumn").offset().top;

		                         
		var gotoX 			= basketX - productX;
		var gotoY 			= basketY - productY;
		
		var newImageWidth 	= $("#ProductListItem" + productIDVal + ' .ProductListImageRelative img').width() / 3;
		var newImageHeight	= $("#ProductListItem" + productIDVal + ' .ProductListImageRelative img').height() / 3;
		
		console.log(newImageWidth);
		
		$("#ProductListItem" + productIDVal + ' .ProductListImageRelative img')
		.clone()
		.prependTo("#ProductListItem" + productIDVal + ' .ProductListImageRelative')
		.css({'position' : 'absolute'})
		.animate({opacity: 0.4}, 100 )
		.animate({opacity: 0.1, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 1200, function() {
																																																																										  			$(this).remove();
	
	
			
			
		
		});
		
					$.ajax({  
				type: "POST",  
				url: "/_source/modules/shop_cart/cart.actions.php",  
				data: { product_id: productIDVal, item_product: "1", action: "add"},
				contentType: "application/x-www-form-urlencoded;charset=ISO-8859-1",
				success: function(response) {
					var basket = $('#shoppingcart-box', response);
					console.log(basket);
					
					if ($("#shoppingcart-box").length>0) {
					$("#shoppingcart-box").replaceWith(basket);
					} else {
						$("#RightColumn").prepend(basket);	
					}
					
				}
			}); 
		
	});
	
	

});

