
	
			
			var price_with_options_ajax_call = function() {
													$.ajax({
														type: 'POST',
														url: 'index.php?route=cyclesoft/ajaxoptions/index&pid=23400',
														data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
														dataType: 'json',
														beforeSend: function() {
															// you can add smth useful here
														},
														complete: function() {
															// you can add smth useful here
														},
														success: function(json) {
															if (json.success) {
																if ($('.price-tax').length > 0 && json.new_price.tax) {
																	animation_on_change_price_with_options('.price-tax', json.new_price.tax);
																}
																if ($('.price-old').length > 0 && json.new_price.price) {
																	animation_on_change_price_with_options('.price-old', json.new_price.price);
																}
																if ($('.price-new').length > 0 && json.new_price.special) {
																	animation_on_change_price_with_options('.price-new', json.new_price.special);
																}
																if ($('#price_container').length > 0 && json.new_price.price) {
																	animation_on_change_price_with_options('#price_container', json.new_price.price);
																}
															}
														},
														error: function(error) {
															console.log(error);
														}
													});
												}
			
			var animation_on_change_price_with_options = function(selector_class_or_id, new_html_content) {
				$(selector_class_or_id).fadeOut(150, function() {
					$(this).html(new_html_content).fadeIn(50);
				});
			}
			
			if ( jQuery.isFunction(jQuery.fn.on) ) 
				{

					$(document).on('change', '#product input[type=\'text\'], #product input[type=\'hidden\'], #product textarea, #product #input-quantity', function(e) { 
price_with_options_ajax_call();

					});

					$('#product select').bind('change', function(e) { 
						price_with_options_ajax_call();
					});


					$(document).on('click', '#product input[type=\'radio\'], #product input[type=\'checkbox\']', function(e) { 
price_with_options_ajax_call();

					});

			} else {

					$('#product input[type=\'text\'], #product input[type=\'hidden\'], #product select, #product textarea, #product #input-quantity').bind('change', function() {
						price_with_options_ajax_call();
					});

					$('#product input[type=\'radio\'], #product input[type=\'checkbox\']').bind('click', function() {
						price_with_options_ajax_call();
					});
				}	