</td>
          <td align="right">
<?php 
    echo html_button_field('estimate', TEXT_ESTIMATE, 'onclick="FreightList()"');
    echo ORD_SHIP_CARRIER . ' ' . html_pull_down_menu('ship_carrier', $methods, $default = '', 'onchange="buildFreightDropdown()"');
    echo ' ' . ORD_FREIGHT_SERVICE . ' ' . html_pull_down_menu('ship_service', gen_null_pull_down(), '');
    echo ' ' . ORD_FREIGHT . ' ';
    echo html_input_field('freight', $currencies->format($order->freight ? $order->freight : '0.00', true, $order->currencies_code, $order->currencies_value), 'size="15" maxlength="20" onchange="updateTotalPrices()" style="text-align:right"');
    ?>
		  </td>
        </tr>
<?php 
} else {
    echo '        <tr style="display:none"><td colspan="2">' . chr(10);
    echo html_pull_down_menu('ship_carrier', gen_null_pull_down(), '', 'style="visibility:hidden"');
    echo html_pull_down_menu('ship_service', gen_null_pull_down(), '', 'style="visibility:hidden"');
    echo html_hidden_field('ship_gl_acct_id', '');
    echo html_hidden_field('freight', '0') . chr(10);
    echo '        </td></tr>' . chr(10);
}
?>
        <tr>
          <td><?php 
echo TEXT_SELECT_FILE_TO_ATTACH . ' ' . html_file_field('file_name');
?>
</td>
          <td align="right">
<?php 
echo $account_type == 'v' ? ORD_PURCHASE_TAX . ' ' : ORD_SALES_TAX . ' ';
echo ' ' . html_input_field('sales_tax', $currencies->format($order->sales_tax ? $order->sales_tax : '0.00', true, $order->currencies_code, $order->currencies_value), 'readonly="readonly" size="15" maxlength="20" onchange="updateTotalPrices()" style="text-align:right"');
?>
?>
 		</label></li>
	</ol>
</fieldset>

<fieldset id="customer_div">
	<ol>
		<li><label>
<?php 
echo ORD_ACCT_ID . ' ' . html_input_field('search', isset($order->short_name) ? $order->short_name : TEXT_SEARCH, 'size="21" maxlength="30" title="' . TEXT_SEARCH . '" onchange="accountGuess(true)"');
echo '&nbsp;' . html_icon('actions/system-search.png', TEXT_SEARCH, 'small', 'align="top" style="cursor:pointer" onclick="accountGuess(true)"');
?>
	  	</label></li>
		<li><label>
<?php 
echo html_pull_down_menu('bill_to_select', gen_null_pull_down(), '', 'onchange="fillAddress(\'bill\')"');
?>
		</label></li>
<?php 
echo '<li><label>' . html_input_field('bill_primary_name', $order->bill_primary_name, 'size="33" maxlength="32" onfocus="clearField(\'bill_primary_name\', \'' . GEN_PRIMARY_NAME . '\')" onblur="setField(\'bill_primary_name\', \'' . GEN_PRIMARY_NAME . '\')"', true) . chr(10);
echo html_checkbox_field('bill_add_update', '1', $order->bill_add_update ? true : false, '', '') . TEXT_ADD_UPDATE . '</label></li>';
echo '<li><label>' . html_input_field('bill_contact', $order->bill_contact, 'size="33" maxlength="32" onfocus="clearField(\'bill_contact\', \'' . GEN_CONTACT . '\')" onblur="setField(\'bill_contact\', \'' . GEN_CONTACT . '\')"', ADDRESS_BOOK_CONTACT_REQUIRED) . '</label></li>';
echo '<li><label>' . html_input_field('bill_address1', $order->bill_address1, 'size="33" maxlength="32" onfocus="clearField(\'bill_address1\', \'' . GEN_ADDRESS1 . '\')" onblur="setField(\'bill_address1\', \'' . GEN_ADDRESS1 . '\')"', ADDRESS_BOOK_ADDRESS1_REQUIRED) . '</label></li>';
echo '<li><label>' . html_input_field('bill_address2', $order->bill_address2, 'size="33" maxlength="32" onfocus="clearField(\'bill_address2\', \'' . GEN_ADDRESS2 . '\')" onblur="setField(\'bill_address2\', \'' . GEN_ADDRESS2 . '\')"', ADDRESS_BOOK_ADDRESS2_REQUIRED) . '</label></li>';
echo '<li><label>' . html_input_field('bill_city_town', $order->bill_city_town, 'size="25" maxlength="24" onfocus="clearField(\'bill_city_town\', \'' . GEN_CITY_TOWN . '\')" onblur="setField(\'bill_city_town\', \'' . GEN_CITY_TOWN . '\')"', ADDRESS_BOOK_CITY_TOWN_REQUIRED) . chr(10);
echo html_input_field('bill_state_province', $order->bill_state_province, 'size="3" maxlength="24" onfocus="clearField(\'bill_state_province\', \'' . GEN_STATE_PROVINCE . '\')" onblur="setField(\'bill_state_province\', \'' . GEN_STATE_PROVINCE . '\')"', ADDRESS_BOOK_STATE_PROVINCE_REQUIRED) . chr(10);
echo '<li><label>' . html_input_field('bill_postal_code', $order->bill_postal_code, 'size="11" maxlength="10" onfocus="clearField(\'bill_postal_code\', \'' . GEN_POSTAL_CODE . '\')" onblur="setField(\'bill_postal_code\', \'' . GEN_POSTAL_CODE . '\')"', ADDRESS_BOOK_POSTAL_CODE_REQUIRED) . '</label></li>';
echo '<li><label>' . html_pull_down_menu('bill_country_code', gen_get_countries(), $order->bill_country_code ? $order->bill_country_code : COMPANY_COUNTRY) . '</label></li>';
echo '<li><label>' . html_input_field('bill_telephone1', $order->bill_telephone1, 'size="21" maxlength="20" onfocus="clearField(\'bill_telephone1\', \'' . GEN_TELEPHONE1 . '\')" onblur="setField(\'bill_telephone1\', \'' . GEN_TELEPHONE1 . '\')"', ADDRESS_BOOK_TELEPHONE1_REQUIRED) . chr(10);
echo '<li><label>' . html_input_field('bill_email', $order->bill_email, 'size="35" maxlength="48" onfocus="clearField(\'bill_email\', \'' . GEN_EMAIL . '\')" onblur="setField(\'bill_email\', \'' . GEN_EMAIL . '\')"', ADDRESS_BOOK_EMAIL_REQUIRED) . '</label></li>';
?>
	  <td align="right">
	    <?php 
echo JOURNAL_ID == 20 || !isset($_SESSION['admin_encrypt']) ? '&nbsp;' : BNK_TEXT_SAVE_PAYMENT_INFO . html_checkbox_field('save_payment', '1', $order->save_payment ? true : false, '', '');
?>
	  </td>
	  <td>
	    <?php 
echo html_pull_down_menu('payment_id', gen_null_pull_down(), '', 'style="visibility:hidden" onchange=\'fillPayment()\'') . chr(10);
?>
	  </td>
	</tr>
	<tr>
	  <td valign="top">
<?php 
echo JOURNAL_ID == 18 ? TEXT_RECEIVE_FROM : TEXT_PAY_TO;
echo html_pull_down_menu('bill_to_select', gen_null_pull_down(), '', 'onchange=\'fillAddress("bill")\'') . chr(10);
echo '<br />' . html_input_field('bill_primary_name', $order->bill_primary_name, 'size="33" maxlength="32" onfocus="clearField(\'bill_primary_name\', \'' . GEN_PRIMARY_NAME . '\')" onblur="setField(\'bill_primary_name\', \'' . GEN_PRIMARY_NAME . '\')"') . chr(10);
echo '<br />' . html_input_field('bill_contact', $order->bill_contact, 'size="33" maxlength="32" onfocus="clearField(\'bill_contact\', \'' . GEN_CONTACT . '\')" onblur="setField(\'bill_contact\', \'' . GEN_CONTACT . '\')"') . chr(10);
echo '<br />' . html_input_field('bill_address1', $order->bill_address1, 'size="33" maxlength="32" onfocus="clearField(\'bill_address1\', \'' . GEN_ADDRESS1 . '\')" onblur="setField(\'bill_address1\', \'' . GEN_ADDRESS1 . '\')"') . chr(10);
echo '<br />' . html_input_field('bill_address2', $order->bill_address2, 'size="33" maxlength="32" onfocus="clearField(\'bill_address2\', \'' . GEN_ADDRESS2 . '\')" onblur="setField(\'bill_address2\', \'' . GEN_ADDRESS2 . '\')"') . chr(10);
echo '<br />' . html_input_field('bill_city_town', $order->bill_city_town, 'size="25" maxlength="24" onfocus="clearField(\'bill_city_town\', \'' . GEN_CITY_TOWN . '\')" onblur="setField(\'bill_city_town\', \'' . GEN_CITY_TOWN . '\')"') . chr(10);
echo html_input_field('bill_state_province', $order->bill_state_province, 'size="3" maxlength="5" onfocus="clearField(\'bill_state_province\', \'' . GEN_STATE_PROVINCE . '\')" onblur="setField(\'bill_state_province\', \'' . GEN_STATE_PROVINCE . '\')"') . chr(10);
echo html_input_field('bill_postal_code', $order->bill_postal_code, 'size="11" maxlength="10" onfocus="clearField(\'bill_postal_code\', \'' . GEN_POSTAL_CODE . '\')" onblur="setField(\'bill_postal_code\', \'' . GEN_POSTAL_CODE . '\')"') . chr(10);
echo '<br />' . html_pull_down_menu('bill_country_code', gen_get_countries(), $order->bill_country_code) . chr(10);
echo '<br />' . html_input_field('bill_email', $order->bill_email, 'size="40" maxlength="64" onfocus="clearField(\'bill_email\', \'' . GEN_EMAIL . '\')" onblur="setField(\'bill_email\', \'' . GEN_EMAIL . '\')"') . chr(10);
?>
	  </td>
	  <td valign="top">
		<table class="ui-widget" style="border-style:none;">
		 <tbody class="ui-widget-content">
		  <tr>
?>
";</script></td>
		</tr>
		<tr>
		  <td class="main" width="33%"><?php 
echo constant('ORD_TEXT_' . JOURNAL_ID . '_BILL_TO');
?>
		    <?php 
echo html_pull_down_menu('bill_to_select', gen_null_pull_down(), '', 'onchange="fillAddress(\'bill\')"');
?>
		  </td>
		  <td class="main" width="40%"><?php 
echo ENABLE_SHIPPING_FUNCTIONS ? ORD_SHIP_TO : '&nbsp;';
?>
		    <?php 
echo html_pull_down_menu('ship_to_select', gen_null_pull_down(), '', 'disabled="disabled" onchange="fillAddress(\'ship\')"');
?>
		  </td>
		  <td width="27%" rowspan="2" valign="top">
			<table width="100%"  border="0" cellspacing="2" cellpadding="2">
<?php 
if (ENABLE_MULTI_CURRENCY) {
    // show currency slection pulldown
    ?>
			  <tr>
				<td class="main" align="right"><?php 
    echo TEXT_CURRENCY;
    ?>
</td>
				<td class="main">
				  <?php