/**
 * --------------------------------------------------------------------------------------------
 * VP Product Carousel - Joomla! 3 Module for VirtueMart 3.0
 * --------------------------------------------------------------------------------------------
 * @package    VP Product Carousel
 * @author     Abhishek Das
 * @copyright  Copyright (C) 2012-2021 VirtuePlanet Services LLP. All rights reserved.
 * @license    GNU General Public License version 2. http://www.gnu.org/licenses/gpl-2.0.html
 * @link       http://www.virtueplanet.com
 * --------------------------------------------------------------------------------------------
 */
jQuery(document).ready(function($) {
	$(document).on('showHideCustomProductSelection', function() {
		var group = $('#jform_params_product_group').val();
		if (group == 'custom') {
			$('#jform_params_product_id').parents('div.control-group').show(300);
			$('#jform_params_virtuemart_category_id-lbl').parents('div.control-group').hide(300);
		} else {
			$('#jform_params_product_id').parents('div.control-group').hide(300);
			$('#jform_params_virtuemart_category_id-lbl').parents('div.control-group').show(300);
		}
	});
	$(document).trigger('showHideCustomProductSelection');
	$('#jform_params_product_group').change(function() {
		$(document).trigger('showHideCustomProductSelection');
	});
});