<script type="text/javascript">
jQuery(document).ready(function($){
	$('table.compare tr:odd').addClass('paros');
	
	$('.event_chooser input:radio').click(function(){
		$('input:radio').parent('td').removeClass('selected');
		$('input:radio:checked').parent('td').addClass('selected');
	});
});

function checkForm(){
	var nyelv = <?if(hun()):?>'hun'<?else:?>'eng'<?endif;?>;
	if( checkFormPersonal(nyelv) ){
		jQuery('#registration_form').submit();
	}
}
</script>
<style type="text/css">
div.registration_form_container{
	margin: 20px;
	padding: 10px;
	border: 1px solid #c4c4c4;
}

.registration_form_container input, .registration_form_container textarea, .registration_form_container select{
	background: #ddd;
	width: 350px;
	border: 1px solid #ccc;
}

tr.rejtett{
	display: none;
}

div.banner_picture{ text-align: center; margin: 40px 0px; }

td.date{
	font-size: 14px;
	font-weight: bold;
	text-align: center;
	padding: 5px 10px !important;
}

th.times{
	color: white;
	background-color: black;
	text-align: center;
}

tr.paros{ background-color: #EDEAE8; }
td.selected{ background: url('/public/img/bg/jqueryui/84bc71_light_green_crossed.png') repeat scroll 50% 50% #84bc71; }
div.error{ color: red; text-align: center; }
div.event_chooser td.full{
	background: url('/public/img/bg/jqueryui/c1bebe_light_gray_crossed.png') repeat scroll 50% 50% #c1bebe;
}
</style>


<?
	$lap = $this->mpages->get_row(679);
	print $lap->page_body;
	$hetnapok = array("hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat", "vasárnap");
	$honapok  = lang('honapok');
?>


<?if(false && $esemenyek):?>
<?=form_open('workshop/construmaeloadasok', array('id' => 'registration_form'))?>
<?=form_hidden('do', 'OK')?>
<div class="event_chooser" style="margin: 20px 0px;">
	<?
		foreach($esemenyek as $k=>$v){
			$kezdotime = $k; break;
		}
		$elsonap = (int)date('d',$kezdotime);
		$n = (int)date('d',$kezdotime)+count($esemenyek)-1;
	?>
	
	<table cellpadding="5" cellspacing="0" border="1" align="center" class="compare">
	<tr class="head">
        <th>&nbsp;</th>
	<?for($i=$elsonap;$i<=$n;$i++):?>
		<th class="times">2014. április <?=$i?>.</th>
	<?endfor;?>
	</tr>
	
	<?foreach($times as $time):?>
	<tr>
		<td class="date"><?=$esemenyek[$kezdotime][$time]->name."<br />".$time?></td>
		
		<?for($i=0;$i<count($esemenyek);$i++):?>
			<?if( time() > $kezdotime+($i*60*60*24) || !isset($esemenyek[$kezdotime+($i*60*60*24)][$time])):?>
			<td class="full">&nbsp;</td>
			<?elseif($esemenyek[$kezdotime+($i*60*60*24)][$time]->able_to_reg):?>
			<td align="center"<?if(!$esemenyek[$kezdotime+($i*60*60*24)][$time]->able_to_reg):?> class="full"<?endif;?>>
				<input type="radio" name="construma2012" value="<?=$esemenyek[$kezdotime+($i*60*60*24)][$time]->event_id?>" />
				
			<?else:?>
				<td align="center"<?if(!$esemenyek[$kezdotime+($i*60*60*24)][$time]->able_to_reg):?> class="full"<?endif;?>>
				Full
			<?endif;?>
			</td>
		<?endfor;?>
		
	</tr>
	<?endforeach;?>
	</table>
	
	<br /><br />
	
</div>
<?if($error):?>
<div class="error"><?=$error?></div>
<?endif;?>
<div class="registration_form_container">
    <table cellpadding="10" cellspacing="0" align="center">
		<?=$this->load->view('form_general')?>
		<tr>
			<td width="75"><?=lang('events_form_comment')?>:</td>
			<td><?=form_input('comment',$this->input->post('comment'))?></td>
		</tr>
		<tr>
			<td align="center" colspan="2">
				<input type="button" class="send" name="mehet" value="Regisztrálok" style="width: 120px;" onclick="checkForm()" />
			</td>
		</tr>
	</table>
</div>
<?=form_close()?>
<?endif;?>