<?php
/*
 * @author     M2E Pro Developers Team
 * @copyright  M2E LTD
 * @license    Commercial use is forbidden
 */

// @codingStandardsIgnoreFile

/** @var $this Ess_M2ePro_Block_Adminhtml_Widget_Button_DropDown */

?>

<script type="text/javascript">

    var initDropDown = function() {
        var ddEl = $$('.<?php echo $this->getTargetCssClass() ?>')[0];
        if (ddEl) {
            ddEl.innerHTML += '<?php echo Mage::helper('M2ePro')->escapeJs($this->getDropDownHtml()) ?>';
            DropDownObj = new DropDown();
            DropDownObj.prepare(ddEl);
        }
    };

    <?php if (!$this->getRequest()->isXmlHttpRequest()): ?>
        Event.observe(window, 'load', initDropDown);
    <?php else: ?>
        initDropDown();
    <?php endif; ?>
</script>