{include file="$gentemplates/$header_tpl"}
	<h2>{$lang.payment.carousel_service}</h2>
	<p>
		{if $form.page eq 'list'}
			{if $user_photos ne ""}
            {if $form.service_available eq 1}
			<form method="POST" id="carousel_photos" action="{$site_root}/{$seo.payment}?sel=service&service=carousel_act"> 
				<ul>
				{foreach item=item from=$user_photos}
					<li class="float_left" style="padding-bottom:10px; padding-{$default_right}:10px; text-align: center;">
						<input type="checkbox" value="{$item.id}" class="id_photos" name="photos[]" id="photos_{$item.id}">
						<span class="imgcanvas_container"><img src="{$item.path}" class="imgcanvas" /></span>
						<br>						
					</li>
				{/foreach}
				</ul>
				<div style="clear:both"></div>
				{if $form.carousel_day}
				<p style="overflow:hidden;">
					<span class="float_left">{$lang.payment.for}:&nbsp;</span> 
					<span class="float_left">{$form.carousel_day}&nbsp;</span> 
					<span class="float_left">{$lang.pays.periods.day}</span> 
				</p>
				{/if}
				<p style="overflow:hidden;">
					<span class="float_left">{$lang.payment.your_credit}:&nbsp;</span> 
					<span class="float_left">{$form.user_account}&nbsp;</span> 
					<span class="float_left">{$form.cur}</span> 
				</p>
				<p style="overflow:hidden;">
					<span class="float_left">{$lang.payment.service_costs}:&nbsp;</span> 
					<span class="float_left">{$form.price}&nbsp;</span> 
					<span class="float_left">{$form.cur}</span> 
				</p>
				<p style="overflow:hidden;">
					<input type="button" value="{$lang.button.carousel_now}" onClick="Check();">
				</p>
				{else}
				<p style="overflow:hidden;">
					<span class="float_left">{$lang.pays.service_price}:</span> 
					<span class="float_left">{$form.price}&nbsp;</span>
					<span class="float_left">{$form.cur}</span>
				</p>
				<p>
					{$not_enough_account}
				</p>
			</form>
			{/if}
            {else}
                {$lang.payment.photo_err}&nbsp;<a href="{$add_link}">{$lang.payment.add_photo}</a>
            {/if}
		{elseif $form.page eq 'done'}
			<p>{$your_profile_added}</p>
		{/if}
	</p>
	<script>
		{literal}
			function Check(){
				if ($('.id_photos:checked').length == 0)
					alert('{/literal}{$lang.payment.service.carousel.select_photo|escape:javascript}{literal}');
				else if($('.id_photos:checked').length > {/literal}{$settings.carousel_count_photos}{literal})
					alert('{/literal}{$lang.payment.service.carousel.much_photo|escape:javascript}{literal}');
				else
					$('#carousel_photos').submit();
				return;
			}
		{/literal}
	</script>
{include file="$gentemplates/$footer_tpl"}