<script type="text/javascript">
jQuery(document).ready(function($){
	$('#mehet').click(function(){
		var error = "";
		
		if( $('input[name=kep]:checked').val() == undefined ){
			error += "<?=lang("ek_valkepet")?>";
		}
		
		if(error == ""){
			$('#szavazas_form').submit();
		}else{
			alert(error);
		}
		
		return false;
	});
});
</script>
<style>
.tsznagytop{
	background: url(/public/img/galeria/picture_frame_sprite.png) -729px 0 no-repeat;
	height: 11px;
	width: 729px;
}
.tsznagycenter{
	background: url(/public/img/galeria/picture_frame_sprite.png) -1458px 0 repeat-y;
	padding: 7px 19px 0px 19px;
}
.tsznagycenter img{
	margin: 0px 5px 0px 0px;
	float: left;
	max-width: 692px;
	min-width: 692px;
}
</style>

<?if( !in_array($kategoria,array("amator","felhasznalo")) ):?>
<div style="text-align: center; padding-top: 100px; font-size: 20px;">
<?if(hun()):?>
	<a href="/design-a-teraszon/szavazas/felhasznalo">Felhasználó kategória</a><br /><br />
	<a href="/design-a-teraszon/szavazas/amator">Amatőr kategória</a>
<?else:?>
	<a href="/design-a-teraszon/voting/user">User category</a><br /><br />
	<a href="/design-a-teraszon/voting/amature">Amature category</a>
<?endif;?>
</div>
<?return;?>
<?endif;?>


<? $honapoknevei = lang('honapok'); ?>

<div style="text-align: center">
<br>
<?
$header_suffix = $this->uri->segment(3);

if($header_suffix=="amator" && !file_exists('public/img/designateraszon/designateraszon_header_amator.jpg'))
	$header_suffix="amature";
elseif($header_suffix=="felhasznalo" && !file_exists('public/img/designateraszon/designateraszon_header_felhasznalo.jpg'))
	$header_suffix="user";

if($header_suffix!="")$header_suffix = "_".$header_suffix;

if(eng())$header_suffix = $header_suffix."_ENG";
?>
<img src="http://www.archline.hu/public/img/designateraszon/designateraszon_header<?=$header_suffix?>.jpg" alt="Design a teraszon">
</div>

<div id="baloldal">


<?		/* Kis képek */		?>
<?$i = $ui = 1; $u = 0; $elozo = "";?>
<?foreach($kepek as $kep):?>
<?$kepadatok = explode('_-_',$kep); ?>
<?if($kepadatok[0]==$elozo):?>
	<?$ui++;?>
<?else:?>
	<?$ui = 1; $u++;?>
	<div class="clear"></div>
<?endif;?>
<div style="float: left; width: 182px; text-align: center;">
<p style="text-align: center;"><?=$u/*."/".$ui*/?>. <?=str_replace(array('_',"Pal Zsuzsanna"),array(' ',"Pál Zsuzsanna"),$kepadatok[0])?></p>
<a href="/<?=$dir?><?=$kep?>" class="fancy" rel="csop1" title="<?=$kep?>">
	<img src="/<?=$dir?>thumbs/<?=$kep?>" alt="" style="margin: 0px 2px 0px 0px;" />
	</a>
</div>
<?$i++;?>
<?$elozo = $kepadatok[0];?>
<?endforeach;?>
<div class="clear"></div>


<?		/* Nagy képek */		?>
<?$i = $ui = 1; $u = 0; $elozo = "";?>
<?foreach($kepek as $kep):?>
<?$kepadatok = explode('_-_',$kep); ?>
<?if($kepadatok[0]==$elozo):?>
	<?$ui++;?>
<?else:?>
	<?$ui = 1; $u++;?>
	<div class="clear"></div>
<?endif;?>
<div class="hkheadertop"></div>
<div class="hkkeret">
	<table width="100%"><tr>
	<td>
		<div class="gal-cim2 feherbetu" style="margin-bottom: 10px; color: #fff !important;"><?=$u/*."/".$ui*/?>.</div>
	</td>
	<td align="right">
		<div class="gal-cim2 vcard" style="margin-bottom: 10px; text-align: right;">
			<?=lang('hk_keszitette')?>: <span class="feherbetu fn" style="color: #fff;"><?=str_replace(array('_',"Pal Zsuzsanna"),array(' ',"Pál Zsuzsanna"),$kepadatok[0])?></span>
		</div>
	</td>
	</tr></table>
</div>
<div class="hkheaderbottom"></div>

<div class="designateraszonnagytop"></div>
<div class="designateraszonnagycenter">
	<a href="/<?=$dir?><?=$kep?>" class="fancy" title="<?=$kep?>">
	<img src="/<?=$dir?><?=$kep?>" alt="" />
	</a><span style="font-size: 5px;">&nbsp;</span>
</div>
<div style="background: url(/public/img/galeria/picture_frame_sprite.png) no-repeat; height: 13px; width: 729px;"></div>
<?$i++;?>
<?$elozo = $kepadatok[0];?>
<?endforeach;?>

</div>


<?		/* Eredmeny */		?>
<div id="jobboldal" style="padding-top: 10px;">
	<?/*<img src="/public/img/galeria/ek_banner<?if(hun()):?>_hun<?else:?>_eng<?endif;?>.png" alt="<?=lang('hk')?>" />*/?>
	
	<div class="hkheadersmalltop"></div>
	<div class="hkkeretsmall">
		<?=lang('designateraszon_leiras')?>
	</div>
	<div class="hkheadersmallbottom"></div>
	
	<div class="hkheadersmalltop"></div>
	<div class="hkkeretsmall">
		<form action="/<?=$this->uri->segment(1)?>/<?print hun()? "eredmeny" : "result"?>/<?=$this->uri->segment(3)?>" method="post" id="szavazas_form">
		<input type="hidden" name="kategoria" value="<?=$kategoria?>" />
		<div class="gal-cim2"><?=lang('designateraszon_melyikt')?></div>
		
		
		
		<?
		$palyazok = array();
		foreach($kepek as $kep){
			$kepadatok = explode('_-_',$kep);
			if(!isset($kepadatok[0],$palyazok[$kepadatok[0]])){
				$palyazok[$kepadatok[0]] = 1;
				continue;
			}
			
			$palyazok[$kepadatok[0]]++;
		}
		?>
		
		<?$i=1;?>
		<?foreach($palyazok as $user => $darab):?>
		<input type="radio" name="kep" value="<?=$user?>" id="designateraszon<?=$i?>" />
		<label for="designateraszon<?=$i?>">
			<?$tmpsorszam = "";?>
			<?for($xx=1;$xx<=$darab;$xx++):?><? $tmpsorszam .= $i."/".$xx.", " ?><?endfor;?>
			<?//=trim($tmpsorszam,", ")." ".str_replace('_',' ',$user)?>
			<?=$i.". ".str_replace(array('_',"Pal Zsuzsanna"),array(' ',"Pál Zsuzsanna"),$user)?>
		</label><br />
		<?$i++;?>
		<?endforeach;?>
		
		
		<br />
		<?=lang('designateraszon_felfuggesztve')?>
		<button name="mehet" type="submit" id="mehet" style="width: 100%" ><?=lang('ek_szavkuld')?></button><br />
		<button type="button" onclick="location.href='/<?=$this->uri->segment(1)?>/<?print hun()? "eredmeny" : "result"?>/<?=$this->uri->segment(3)?>'" style="width: 100%" ><?=lang('ek_eredall')?></button>
		</form>
	</div>
	<div class="hkheadersmallbottom"></div>
	
	
	<div class="hkheadersmalltop"></div>
	<div class="hkkeretsmall">
		<?if(hun()):?>
			<?if($kategoria=="amator"):?>
				<a href="/design-a-teraszon/szavazas/felhasznalo">Felhasználó kategória</a>
			<?else:?>
				<a href="/design-a-teraszon/szavazas/amator">Amatőr kategória</a>
			<?endif;?>
		<?else:?>
			<?if($kategoria=="amator"):?>
				<a href="/design-a-teraszon/voting/user">Professional category</a>
			<?else:?>
				<a href="/design-a-teraszon/voting/amature">Amature category</a>
			<?endif;?>
		<?endif;?>
	</div>
	<div class="hkheadersmallbottom"></div>
	
</div>


