<?php
if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
    $discount = $sf_user->getAttribute('active_discount');
} else {
    $discount = false;
}
?>
<div class="header_mobile mobile <?php echo ($discount ? 'discount d' . $discount : '' )?>">
	<table cellspacing="0" cellpadding="0" width="100%">
		<tbody align="left" valign="middle">
			<tr>
				<td colspan="2">
					<?php echo csSettings::get('phone') ? '<a href="tel:'. csSettings::get('phone') .'" class="header_mobile__phone_link">'. csSettings::get('phone') .'</a>' : ''; ?>
					
				</td>
				<td width="1" align="right">
					<a href="<?php echo url_for("@search"); ?>" class="header_mobile__search_link"></a>
				</td>
			</tr>
			<tr>
				<td width="1">
					<a href="" class="header_mobile__menu_link"></a>
				</td>
				<td align="center">
					<a href="<?php echo url_for("@homepage"); ?>" class="header_mobile__logo"></div>
				</td>
				<td width="1" align="right">
					<a href="<?php echo url_for("@basket"); ?>" class="header_mobile__basket_link"></a>
				</td>
			</tr>
		</tbody>
	</table>
</div>

<div class="burder mobile">
	<div class="burger__close"></div>
	<ul class="burder__menu">
		<li><a href="<?php echo url_for("@catalog"); ?>">Каталог</a></li>
		<li><a href="<?php echo url_for("@video"); ?>">Смотреть</a></li>
		<li><a href="<?php echo url_for("@article"); ?>">Читать</a></li>
		<li><a href="<?php echo url_for("@review"); ?>">Отзывы</a></li>
		<li><a href="<?php echo url_for("@page_show?alias=delivery"); ?>">Доставка</a></li>
	</ul>
	<div class="burder__contacts">
		<?php if (csSettings::get('phone')) {
            echo __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" class="anb">' . csSettings::get('phone') . '</a><i class="br10"></i>';
        }
        if (csSettings::get('email')) {
            echo __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a>';
        } ?>
	</div>
	<a href="" class="btn white_b_btn burder__callback_link" onclick="callback.open();return false;">Заказать звонок</a>
</div>



<script>

	$('.header_mobile__menu_link').click(function(e){
		$('.burder').addClass('show');
		$('body').css('overflow-y','hidden');
		return false;
	});

	$('.burger__close').click(function(e){
		$('.burder').removeClass('show');
		$('body').css('overflow-y','auto');
		return false;
	});

</script>