<div class="list full_width camp_list">
{foreach $camps as $camp}
	
	<span onclick="block_action('camp_'+{$camp->get_camp_id()})" class="date_separator clickable">
		{$camp->get_camp_from()|substr:0:4}.
		{$months[$camp->get_camp_from()|date_format:"%m"]} {$camp->get_camp_from()|date_format:"%e"}. - 
		{if $camp->get_camp_from()|date_format:"%m" != $camp->get_camp_to()|date_format:"%m"}
			{$months[$camp->get_camp_to()|date_format:"%m"]}.
		{/if}
		{$camp->get_camp_to()|date_format:"%e"}., {$camp->get_camp_type()->get_ct_name()}


		({$camp->get_camp_city()})
		<img src="/_image/open_folder.png">
		<div class="float_right">
			{count($camp->get_camp_applies())} fő &nbsp;&nbsp;
		</div>
	</span>

	<div id="camp_{$camp->get_camp_id()}" class="month_block">
	{foreach $camp->get_camp_applies() as $apply}
		
	<a href="/{if $page == 'admin'}admin{else}taborvezeto{/if}/{if $page == 'admin'}apply{else}jelentkezes{/if}/{$apply->get_capp_id()}">
		<div class="list_item">
			<img src="/_image/person.png">
			{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
		</div>
	</a>
	{/foreach}
	</div>
{/foreach}

</div>

<script>

function open_block(block_id) {
	$("#"+block_id).slideDown("slow");
}

function close_block(block_id) {
	$("#"+block_id).slideUp("slow");
}

function block_action(block_id) {
	if ($("#"+block_id).is(':hidden')) {
		open_block(block_id);
	}
	else {
		close_block(block_id);
	}
}


$( document ).ready(function() {
    var divs = $( "div[class=month_block]" );
	$( ".list" ).find( divs ).hide();
	var div_list = $( ".list" ).find( divs );

	//open_block(div_list[0].id);
	
});


</script>