<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<div class='field'>
    <label for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo $this->__('Date of Birth') ?></label>
    <div class="input-box customer-dob">
    <?php
        $this->setDateInput('d',
            '<div class="dob-day">
                 <input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . $this->__('Day') . '" placeholder="DD" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> &nbsp;/&nbsp;
             </div>'
        );

        $this->setDateInput('m',
            '<div class="dob-month">
                 <input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth()  . '" title="' . $this->__('Month')  . '" placeholder="MM" class="input-text validate-custom" ' . $this->getFieldParams()  . ' /> &nbsp;/&nbsp;
             </div>'
        );

        $this->setDateInput('y',
            '<div class="dob-year">
                 <input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear()  . '" title="' . $this->__('Year')  . '" placeholder="YYYY" class="input-text validate-custom" ' . $this->getFieldParams()  . ' />
             </div>'
        );
    ?>
        <?php echo $this->getSortedDateInputs() ?>
        <div class="dob-full" style="display:none;">
            <input type="hidden" id="<?php echo $this->getFieldId('dob')?>" name="<?php echo $this->getFieldName('dob')?>" />
        </div>

        <div class="validation-advice" style="display:none;"></div>
    </div>
    <script type="text/javascript">
    //<![CDATA[
        var customer_dob = new Varien.DOB('.customer-dob', <?php echo $this->isRequired() ? 'true' : 'false' ?>, '<?php echo $this->getDateFormat() ?>');
    //]]>
    </script>
</div>