<div id="installment-plan-info-<?php echo $module; ?>" class="installment-plan-info installment-plan-info-<?php echo $key ?  $key : $module; ?>">
  <div class="ipi-heading"><?php if ($heading_title_link) { ?><a href="<?php echo $heading_title_link; ?>"><?php echo $heading_title; ?></a><?php } else { ?><?php echo $heading_title; ?><?php } ?></div>
  <div class="ipi-content">
    <div class="ipi-installment-plans">
      <div class="ipi-general-promo-message"><?php echo html_entity_decode($general_promo_message); ?></div>
      <?php if ($promo_msgs) { ?>
        <ul class="ipi-promo-messages">
          <?php foreach ($promo_msgs as $promo_msg) { ?>
            <?php if ($promo_msg) { ?>
              <li><?php echo html_entity_decode($promo_msg); ?></li>
            <?php } ?>
          <?php } ?>
        </ul>
      <?php } ?>
      <?php if ($installment_plans) { ?>
        <?php $class = 'odd'; ?>
        <ul class="ipi-payment-plans">
          <?php foreach ($installment_plans as $plan) { ?>
            <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
            <li class="<?php echo $class; ?>">
              <span class="ipi-no-of-instal"><?php echo $plan['no_of_instal']; ?>x</span>
              <span class="ipi-payment-amount">
                <?php foreach ($plan['payments'] as $payment) { ?>
                  <?php if ($plan['plan_type'] == 1 ) { ?>
                    <?php echo $payment['formatted_amount']; ?>
                  <?php } else if ($plan['plan_type'] == 2 ) { ?>
                    <span class="ipi-instal">(<?php echo $payment['installment']; ?>) </span> <?php echo $payment['formatted_amount']; ?><?php echo $payment !== end($plan['payments']) ? ' ' : ''; ?>
                  <?php } ?>
                <?php } ?>
              </span>
              <span class="ipi-comment"><?php echo html_entity_decode($plan['comment']); ?></span>
            </li>
          <?php } ?>
        </ul>
      <?php } ?>
    </div>
    <?php if ($payment_methods) { ?>
      <ul class="ipi-payment-methods">
        <?php foreach ($payment_methods as $payment_method) { ?>
          <?php if ($payment_method['thumb']) { ?>
          <li><img src="<?php echo $payment_method['thumb']; ?>" alt="<?php echo $payment_method['name']; ?>" title="<?php echo $payment_method['name']; ?>" /><span class="ipi-pm-meth-no-of-install"><?php echo $payment_method['no_of_instal']; ?></span></li>
          <?php } ?>              
        <?php } ?>
      </ul>
    <?php } ?>
  </div>
  
  <div class="ipi-ajaxloader"></div>
  
  <input type="hidden" name="content_id" value="<?php echo $setting['content_id']; ?>" />
  <input type="hidden" name="image_width" value="<?php echo $setting['image_width']; ?>" />
  <input type="hidden" name="image_height" value="<?php echo $setting['image_height']; ?>" />
  <input type="hidden" name="layout_id" value="<?php echo $setting['layout_id']; ?>" />
  <input type="hidden" name="position" value="<?php echo $setting['position']; ?>" />
  <input type="hidden" name="status" value="<?php echo $setting['status']; ?>" />
  <input type="hidden" name="sort_order" value="<?php echo $setting['sort_order']; ?>" />
  <input type="hidden" name="module" value="<?php echo $module; ?>" />
  <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
  
</div>
<script type="text/javascript"><!--

$(function() {
  var options = {};
  $(document).installmentPlanInfo(options);
});
//--></script>

<script type="text/javascript"><!--
$(function() {
  // Get max width of child div's and apply it to "li".
  $('#installment-plan-info-<?php echo $module; ?>').find('.ipi-payment-plans > li').width(     
    Math.max.apply(Math, 
      $('#installment-plan-info-<?php echo $module; ?>').find('.ipi-payment-plans > li').map(function(){
        return $(this).css({'padding-right': '7px', 'padding-left': '7px'}).width();
      }).get()
    )
  );
});
//--></script>