<?php
/**
 * Maho
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Adminhtml_Block_Promo_Catalog_Edit_Js $this */
?>
<script type="text/javascript">
//<![CDATA[
function hideShowSubproductOptions()
{
    if ($('rule_sub_is_enable').value == 1) {
        $('rule_sub_simple_action').up('tr').show();
        $('rule_sub_discount_amount').up('tr').show();
        $('rule_sub_discount_amount').addClassName('required-entry validate-not-negative-number');
    } else {
        $('rule_sub_simple_action').up('tr').hide();
        $('rule_sub_discount_amount').up('tr').hide();
        $('rule_sub_discount_amount').removeClassName('required-entry').removeClassName('validate-not-negative-number');
    }

    return true;
}

document.observe("dom:loaded", hideShowSubproductOptions);
//]]>
</script>
