$offer = intval($_REQUEST["offer"]);
if ($offer > 0):
foreach ($arResult['JS_OFFERS'] as $key => $jsOffer):
if ($jsOffer["ID"] == $offer):
$arResult['OFFERS_SELECTED'] = $key;
break;
endif;
endforeach;
endif;