<?
$i = 0;
foreach($v["OFFERS"] as $intKey => $arOffer)
{
if($i < 1){
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
echo <b>div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 0 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
}else{
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
echo <b><div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 1 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
}
$i++;
}
?>
<?php
$i = 0;
foreach($v["OFFERS"] as $intKey => $arOffer)
{
if($i < 1){
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
?><b>div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 0 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
<?php
}else{
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
?><b><div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 1 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
<?php
}
$i++;
}
?>