<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');
        });
    });

</script>
<style type="text/css">

    div.registration_form_container{
        margin: 20px;
        padding: 10px;
        border: 1px solid #c4c4c4;
    }
    
    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>
<?if($main_event):?>
<h2><?=$main_event->name?></h2>
<p><?=substr($main_event->description, 0, 400), '...'?></p>
<div class="right_links" style="text-align: right;">
    <a href="page/show/<?=$main_event->archline_page?>" title="<?=$main_event->name?>">read more</a>
</div>
<div class="banner_picture">
    <a href="<?=$main_event->homepage?>" title="<?=$main_event->name?> official website" target="_blank"><img src="/public/img/events/banner/<?=$main_event->picture_name?>" /></a>
</div>
<?endif;?>
<?if($events):?>
<?=form_open('events/decorex2010', array('id' => 'registration_form'))?>
<?=form_hidden('do', 'OK')?>
<div class="event_chooser" style="margin: 20px 0px;">
    <table cellpadding="5" cellspacing="0" border="1" align="center" class="compare">
    <tr class="head">
        <th>&nbsp;</th>
        <?foreach($times as $time):?>
        <th class="times"><?=$time?></th>
        <?endforeach;?>
    </tr>
    <?foreach($events as $timestamp => $event_times):?>
    <tr>
        <td class="date">
            <?=date('Y', $timestamp)?><br />
            <?=date('F d.', $timestamp)?><br />
            <?=date('l', $timestamp)?>
        </td>
        <?foreach($times as $time):?>
        <?if(isset($event_times[$time])):?>
        <td align="center"<?if(!$event_times[$time]->able_to_reg):?> class="full"<?endif;?>>
            <?if($event_times[$time]->able_to_reg):?>
            <input type="radio" name="event_main_<?=$event_times[$time]->event_main_id?>" value="<?=$event_times[$time]->event_id?>" />
            <?endif;?>
        </td>
        <?else:?>
        <td class="full">&nbsp;</td>
        <?endif;?>
        <?endforeach;?>
    </tr>
    <?endforeach;?>
    </table>
</div>
<?if($error):?>
<div class="error"><?=$error?></div>
<?endif;?>
<div class="registration_form_container">
    <table cellpadding="10" cellspacing="0" align="center">
		<tr>
			<td width="75"><strong>Name:</strong></td>
			<td><?=form_input('nev',$this->input->post('nev'))?></td>
		</tr>
		<tr>
			<td width="75">Company name:</td>
			<td><?=form_input('cegnev',$this->input->post('cegnev'))?></td>
		</tr>
		<tr>
			<td width="75"><strong>City:</strong></td>
			<td><?=form_input('varos',$this->input->post('varos'))?></td>
		</tr>
		<tr>
			<td width="75"><strong>ZIP Code:</strong></td>
			<td><?=form_input('irsz',$this->input->post('irsz'))?></td>
		</tr>
		<tr>
			<td width="75"><strong>Address:</strong></td>
			<td><?=form_input('cim',$this->input->post('cim'))?></td>
		</tr>
		<tr>
			<td width="75"><strong>Phone number:</strong></td>
			<td><?=form_input('tel',$this->input->post('tel'))?></td>
		</tr>
		<tr>
			<td width="75"><strong>E-mail:</strong></td>
			<td><?=form_input('email',$this->input->post('email'))?></td>
		</tr>
		<tr>
			<td width="75">Comment:</td>
			<td><?=form_input('comment',$this->input->post('comment'))?></td>
		</tr>
		<tr>
			<td align="center" colspan="2"><?=form_button(array('type' => 'submit', 'id' => 'mehet', 'name' => 'mehet', 'content'=> 'Register'))?></td>
		</tr>
	</table>
</div>
<?=form_close()?>
<?endif;?>