<div id="offerExtraFields_{$idOffer}" style="display:none;" class="extraFieldsDiv">

	<table class="extraFieldsTable" cellpadding="0" cellspacing="0">

		{* --- calculation type --- *}
		{$calcsCnt=0}
		{foreach $serviceCalculationNames[$offerDetails.location] as $loc=>$calcDet}
			{if !$calcDet['deleted']}
				{$calcsCnt=$calcsCnt+1}
			{/if}
		{/foreach}

		{if $calcsCnt>1 and ($serviceStatusFin=="NI" or $idOffer!=$chosenOfferId)} {* if more than 1 calculations *}
			<tr>
				<td class="extraFieldTableCell">
					{$_LANG.reservations.serviceOffers.tpl.calculationType}
				</td>
				<td class="extraFieldTableCell">

					<select name="calculationType[{$idOffer}]" size="1" style="width:150px">
						{foreach $serviceCalculationNames[$offerDetails.location] as $thisCalculationType=>$thisCalculationDet}
							{if !$thisCalculationDet['deleted'] or $offerDetails.calculationType==$thisCalculationType}
								<option value="{$thisCalculationType}"
									{if $offerDetails.calculationType==$thisCalculationType}selected="1"{/if}
									{if $thisCalculationDet['deleted']}class="grey"{/if}
								>
									{$_LANG.locations.countriesCriteria.short[$offerDetails['location']]}
									{if $thisCalculationDet['name']} - {$thisCalculationDet['name']}{/if}
									{if $thisCalculationDet['deleted']}({$_LANG['reservations']['serviceOffers']['tpl']['deletedCalc']}){/if}
								</option>
							{/if}
						{/foreach}
					</select>

				</td>
			</tr>
		{else} {* only one calculation = calculation 0*}
			<input type="hidden" name="calculationType[{$idOffer}]" value="{$offerDetails.calculationType}" />
		{/if}

		{* --- comments --- *}
		<tr>
			<td class="extraFieldTableCell">
				{$_LANG.reservations.serviceOffers.tpl.comments}
			</td>
			<td class="extraFieldTableCell">
				<textarea style="width:150px;height:20px;" name="offerComments[{$idOffer}]"
				>{$offerDetails.comments}</textarea>
			</td>
		</tr>
		
		{* --- cancellation policy --- *}
		{if $serviceOfferFields['cancellationPolicy']!='invisible'}
			<tr>
				<td class="extraFieldTableCell">
					{$_LANG.reservations.serviceOffers.tpl.cancelPol} {if $serviceOfferFields['cancellationPolicy']=='mandatory'}<span style="color:red;">*</span>{/if}
				</td>
				<td class="extraFieldTableCell">
					<textarea style="width:150px;height:20px;" name="offerCancellationPolicy[{$idOffer}]"
					>{$offerDetails.cancellationPolicy}</textarea>
				</td>
			</tr>
		{/if}
		
		{* --- ignore supplier on invoice --- *}
		{if $serviceIgnoreSupplierOnDocuments!='hidden'}
			<tr>
				<td class="extraFieldTableCell">
					{$_LANG.reservations.serviceOffers.tpl.ignoreSupplier}
				</td>
				<td class="extraFieldTableCell">
					<a href="#;" class="icon-infoOrange help" tooltip="{$_LANG.reservations.serviceOffers.tpl.ignoreSupplierTooltip}" data-tooltip-contentType='text-long'></a>
					<input id="ignoreSupplierRadioNo_{$idOffer}" name="ignoreSupplierOnDocuments[{$idOffer}]" value="0" type="radio" class="noBorder"
						{if !$offerDetails.ignoreSupplierOnDocuments}checked="1"{/if}
					/><label for="ignoreSupplierRadioNo_{$idOffer}">{$_LANG.no}</label>
					&nbsp;
					<input id="ignoreSupplierRadioYes_{$idOffer}" name="ignoreSupplierOnDocuments[{$idOffer}]" value="1" type="radio" class="noBorder"
						{if $offerDetails.ignoreSupplierOnDocuments}checked="1"{/if}
					/><label for="ignoreSupplierRadioYes_{$idOffer}">{$_LANG.yes}</label>
				</td>
			</tr>
		{/if}

		{* product name *}
		{if $serviceProductName.type and $serviceProductName.type!='none'}
			<tr>
				<td class="extraFieldTableCell">
					{$serviceProductName.fieldName}
				</td>
				<td class="extraFieldTableCell">

					{if $serviceProductName.type=="both" or $serviceProductName.type=="text"}
						<div style="margin: 1px">
							<input type="text" style="width:130px"
								name="productName[{$idOffer}]" value="{$offerDetails.productName}"
							/> {if $serviceProductName.type=="both"}({$_LANG.reservations.serviceOffers.tpl.productNameNew}){/if}
						</div>
					{/if}

					{if $serviceProductName.type=="both" or $serviceProductName.type=="autocomplete"}
						<div style="margin: 1px">

							<a href="#;" class="icon-infoOrange help" tooltip="<div>{$_LANG.reservations.serviceOffers.tpl.prNameAutocompleteTooltip1}:</div><div>{$_LANG.reservations.serviceOffers.tpl.prNameAutocompleteTooltip2}:<b>`{$serviceName}`</b></div><div>{$_LANG.reservations.serviceOffers.tpl.prNameAutocompleteTooltip3}: <b>`{$offerDetails.supplierAlias}`</b></div>"></a>

							<input id="typeSupplierService_{$idOffer}" type="text" style="width:115px"
								name="typeSupplierService[{$idOffer}]" value="{$offerDetails.typeSupplierService}"
							/>
							<span style="margin-left:5px;">{if $serviceProductName.type=="both"}({$_LANG.reservations.serviceOffers.tpl.productNameExistent}){/if}</span>
							<input id="idSupplierProduct_{$idOffer}" type="hidden" name="idSupplierProduct[{$idOffer}]" value="{$offerDetails.idSupplierProduct}" />

							<script language="javascript">
								new DCsAutocomplete({ldelim}
									autocompleteField:"typeSupplierService_{$idOffer}",
									url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=SupplierProduct",
									autocompleteFieldValue:"typeSupplierService_{$idOffer}",
									autocompleteFieldCode:"idSupplierProduct_{$idOffer}",
									clearOnCancel:true,
									clearOnSelect:false,
									noResultsText:'{$_LANG.autocompleteNoResults}'
								{rdelim});
							</script>
						</div>
					{/if}

				</td>
			</tr>
		{/if}

		{* --- confirmed offer --- *}
		<tbody id="confirmOfferTbody_{$idOffer}" {if $chosenOfferId!=$idOffer}style="display:none"{/if}>
			<tr class="extResTrs">
				<td colspan="2" class="extraFieldsSeparator">&nbsp;</td>
			</tr>

			<tr class="extResTrs">
				<td class="extraFieldTableCell">
					<label for="confirmSupplier_{$idOffer}">{$_LANG.reservations.serviceOffers.tpl.confirmedOffer}</label>
				</td>
				<td class="extraFieldTableCell">

					<label for="confirmSupplier_{$idOffer}" style="float:right">(
						{$_LANG.reservations.serviceOffers.tpl.serviceStatus}: <b>
							<span id="stsServOp_OF_{$idOffer}" {if $offerDetails.supplierConfirmedCheckbox}style="display:none"{/if}>{$_LANG.reservationServices.statusOpName.OF}</span>
							<span id="stsServOp_OK_{$idOffer}" {if !$offerDetails.supplierConfirmedCheckbox}style="display:none"{/if}>{$_LANG.reservationServices.statusOpName.OK}</span>
						</b>
					)</label>

					<input id="confirmSupplier_{$idOffer}" type="checkbox" class="noBorder"
						value="1"
						{if $offerDetails.supplierConfirmedCheckbox}checked="1"{/if}
						{if !$offerDetails.supplierConfirmedDisableCheckbox}
							name="supplierConfirmed[{$idOffer}]"
							onclick="
								$('stsServOp_OF_{$idOffer}').toggle();$('stsServOp_OK_{$idOffer}').toggle();
								//if (lastOpenedOfferExtraFields!='0')
									//repositionExtraFieldsMaskIframe(lastOpenedOfferExtraFields);
							"
						{else}
							disabled="1"
						{/if}
					/>

				</td>
			</tr>
		</tbody>

		{* --- externalReservationId and externalReservationDate --- *}
		<tbody class="externalReservationDetails">
			{if $serviceOfferFields['externalSystemReservationDate']!='invisible'}
				<tr class="extResTrs">
					<td class="extraFieldTableCell">
						{$_LANG.reservations.serviceOffers.tpl.externalResDate} {if $serviceOfferFields['externalSystemReservationDate']=='mandatory'}<span style="color:red;">*</span>{/if}
					</td>
					<td class="extraFieldTableCell">
						<input id="extResDate_{$idOffer}" type="text" class="input-old-date1" onBlur="dateValidation(this, '{$dateStandard}');"
							name="externalSystemReservationDate[{$idOffer}]"
							value="{$offerDetails.externalSystemReservationDateStd}"
						/>
						<img class="calendar" src="{$smarty.const.SMARTY_BLANKGIF}" id="extResDateBtn_{$idOffer}" align="absmiddle" />
						<script>Calendar.setup({ldelim}inputField:"extResDate_{$idOffer}", button:"extResDateBtn_{$idOffer}", ifFormat:Date.displayFormat{rdelim});</script>
					</td>
				</tr>
			{/if}
			
			{if $serviceOfferFields['externalSystemReservationId']!='invisible'}
				<tr class="extResTrs">
					<td class="extraFieldTableCell">
						{$_LANG.reservations.serviceOffers.tpl.externalResId} {if $serviceOfferFields['externalSystemReservationId']=='mandatory'}<span style="color:red;">*</span>{/if}
					</td>
					<td class="extraFieldTableCell">
						<input type="text" name="externalSystemReservationId[{$idOffer}]" style="width:110px"
							value="{$offerDetails.externalSystemReservationId}"
						/>
					</td>
				</tr>
			{/if}
		</tbody>

		{* --- confirmation number --- *}
		<tbody>
			{if $serviceOfferFields['confirmationNumber']!='invisible'}
				<tr class="extResTrs">
					<td class="extraFieldTableCell">
						{$_LANG['reservations']['serviceOffers']['tpl']['confNo']} {if $serviceOfferFields['confirmationNumber']=='mandatory'}<span style="color:red;">*</span>{/if}
					</td>
					<td class="extraFieldTableCell">
						<input type="text" name="confirmationNumber[{$idOffer}]" style="width:110px" maxlength="50"
							value="{$offerDetails.confirmationNumber}"
						/>
					</td>
				</tr>
			{/if}
		</tbody>

		{* --- option date --- *}
		<tbody>
			{if $serviceOfferFields['optionDate']!='invisible'}
				<tr class="extResTrs">
					<td class="extraFieldTableCell">
						{$_LANG['reservations']['serviceOffers']['tpl']['optionDate']} {if $serviceOfferFields['optionDate']=='mandatory'}<span style="color:red;">*</span>{/if}
					</td>
					<td class="extraFieldTableCell">
						<input id="optionDate_{$idOffer}" type="text" class="input-old-date1" onBlur="dateValidation(this, '{$dateStandard}');"
							name="optionDate[{$idOffer}]"
							value="{$offerDetails.optionDateStd}"
						/>
						<img class="calendar" src="{$smarty.const.SMARTY_BLANKGIF}" id="optionDateBtn_{$idOffer}" align="absmiddle" />
						<script>Calendar.setup({ldelim}inputField:"optionDate_{$idOffer}", button:"optionDateBtn_{$idOffer}", ifFormat:Date.displayFormat{rdelim});</script>
					</td>
				</tr>
			{/if}
		</tbody>

		{* close button *}
		<tr>
			<td colspan="2" class="extraFieldsSeparator"></td>
		</tr>
		<tr>
			<td colspan="2" class="right">
				<button type="button"
					onclick="
						$('offerExtraFields_'+lastOpenedOfferExtraFields).hide();
						lastOpenedOfferExtraFields='0';
						//$('extraFieldsMaskIframe').hide();
					"
				>{$_LANG.reservations.serviceOffers.tpl.closeButton}</button>
			</td>
		</tr>
	</table>
</div>