<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php if ($shipping_methods) { ?>
<p><?php echo $text_shipping_method; ?></p>
<table class="radio">
  <?php foreach ($shipping_methods as $shipping_method) { ?>
  <tr>
    <td colspan="3"><b><?php echo $shipping_method['title']; ?></b></td>
  </tr>
  <?php if (!$shipping_method['error']) { ?>
  <?php foreach ($shipping_method['quote'] as $quote) { ?>
  <tr class="highlight">
    <td><?php if ($quote['code'] == $code || !$code) { ?>
      <?php $code = $quote['code']; ?>
      <input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" id="<?php echo $quote['code']; ?>" checked="checked" />
      <?php } else { ?>
      <input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" id="<?php echo $quote['code']; ?>" />
      <?php } ?></td>
    <td><label for="<?php echo $quote['code']; ?>"><?php echo $quote['title']; ?></label></td>
    <td style="text-align: right;"><label for="<?php echo $quote['code']; ?>"><?php echo $quote['text']; ?></label></td>
  </tr>
  <?php } ?>
  <?php } else { ?>
  <tr>
    <td colspan="3"><div class="error"><?php echo $shipping_method['error']; ?></div></td>
  </tr>
  <?php } ?>
  <?php } ?>
</table>
<br />
<?php } ?>
<div class="seltransportadora" style="display:none;">
	<b><?php echo $text_transportadora; ?></b>	
	<input type="text" MaxLength="100" name="comment" id="comment" style="width: 98%;" value="<?php echo $comment; ?>" />
	<b><p style="color:red;"><?php echo $text_fob ?></p></b>
</div>
<br />
<br />
<div class="buttons">
  <div class="right">
    <input type="button" value="<?php echo $button_continue; ?>" id="button-shipping-method" class="button" />
  </div>
</div>


<script>
   
   var tops = document.getElementsByTagName('input');  
   $('#comment').val('');   
   
	for (var i=0, len=tops.length; i<len; i++) {
		if ( tops[i].type === 'radio' ) {
			tops[i].onclick = function() {
			  if(this.id == 'fretedinamico.fretedinamico'){
			     $('.seltransportadora').css('display', 'block');			  
			  }else{
			    $('#comment').val('');
			    $('.seltransportadora').css('display', 'none');
			  }
			  
			}
		}
	}

</script>
