<script type="text/javascript">

jQuery(document).ready(function($){
    //create the main events and their details from json
    var main_event_object = {
        getAllMainEvents: function(){
            return <?=$main_events_json?>;
        },
        getMainEventByID: function(event_main_id){
            var main_events = this.getAllMainEvents();
            var len = main_events.length;
            
            for(var i = 0; i < len; i++){
                if(main_events[i].event_main_id == event_main_id){
                    return main_events[i];
                }
            }
            
            return false;
        }
    };
    
    //open and close events for the lists
    $('.open-closer').click(function(){
        $(this).parent('div').parent('li').next('ul').toggle();
    });
    
    $('.open-closer-all').click(function(){
        $('.registrations').toggle();
        $('.events').toggle();
    });
    
    $('.open-closer-allin').click(function(){
        $('.registrations').fadeIn();
        $('.events').fadeIn();
    });
    
    $('.open-closer-allout').click(function(){
        $('.registrations').fadeOut();
        $('.events').fadeOut();
    });
    
   
    //create the edit event dialog
    $('#edit_event_dialog').dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#modositas_form').submit();
                $('#edit_event_dialog').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#edit_event_dialog').dialog('close');
            }
        }
    });
    
    
    //confirm the delete links
    $('.del_anchor').click(function(){
        var href = $(this).attr('href');
        var question = $(this).attr('question');
        
        //create the confirm dialog
        $('#confirm_dialog').dialog({
            autoOpen: false,
            modal: true,
            buttons: {
                'Törlés': function(){
                    window.location = href;
                },
                '<?=$this->lang->line('cancel')?>': function(){
                    $('#confirm_dialog').dialog('destroy');
                }
            }
        }).html(question).dialog('open');
        
        return false;
    });
    
    
    //edit the event details
    $('.edit_anchor').click(function(){
        //populate the dialog
        var con = $('#modositas_form');
        var event = $(this).parents('.event');
        
        $('#nev_hun', con).val(event.attr('event_name'));
        $('#nev_eng', con).val(event.attr('event_name_eng'));
        $('#cid', con).val(event.attr('c_id'));
        
        
        //open the dialog
        $('#edit_event_dialog').dialog('open');
        
        return false;
    });
    
    //create the new event dialog
    $('#new_event_dialog').dialog({
        autoOpen: false,
        modal: true,
		width: 500,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#rogzites_form').submit();
                $('#new_event_dialog').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#new_event_dialog').dialog('close');
            }
        }
    });
    
    //insert new event
    $('.new_anchor').click(function(){
        //populate the dialog
        var con = $('#rogzites_form');
        var event = $(this).parent('.new-link');
        
        $('#event_main_id_uj', con).val(event.attr('event_main_id'));
        
        //open the dialog
        $('#new_event_dialog').dialog('open');
        
        return false;
    });
    
	
	
    //create the new manufacturer dialog
    $('#gyarto_dialog_uj').dialog({
        autoOpen: false,
        modal: true,
        width: 500,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_gyarto_new').submit();
                $('#gyarto_dialog_uj').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#gyarto_dialog_uj').dialog('close');
            }
        }
    });
    
    //insert new brand
    $('.new-man').click(function(){
        //open the dialog
        $('#gyarto_dialog_uj').dialog('open');
        
        return false;
    });
	
	//create the new brand group dialog
    $('#gyartocsoport_dialog_uj').dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_gyartocsoport_new').submit();
                $('#gyartocsoport_dialog_uj').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#gyartocsoport_dialog_uj').dialog('close');
            }
		}
    });
	
	//insert new brand group
    $('.new-mangroup').click(function(){
        //open the dialog
        $('#gyartocsoport_dialog_uj').dialog('open');
        
        return false;
    });
	
	//edit the manufacturer name
    $('.edit_gyarto').click(function(){
        //populate the dialog
        var con = $('#form_gyarto_edit');
        var event = $(this).parents('.main_event');
        
        $('#name', con).val(event.attr('name'));
        $('#mid', con).val(event.attr('man_id'));
    //    $('#group_id', con).val(event.attr('grpid'));
		
		$('#group_id option', con).each(function(){
			$(this).attr('selected', false);
			var minta = ";"+$(this).val()+";";
			if(event.attr('grpid').indexOf(minta) != -1){
				$(this).attr('selected', true);
			}
		});
        
        
        //open the dialog
        $('#gyarto_dialog_edit').dialog('open');
        
        return false;
    });
	
	//
	$('#gyarto_dialog_edit').dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_gyarto_edit').submit();
                $('#gyarto_dialog_edit').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#gyarto_dialog_edit').dialog('close');
            }
        }
    });
    
    

    //edit the main event details
    $('.edit_main_anchor').click(function(){
        var event_main_id = $(this).parents('.main_event').attr('event_main_id');
        
        //open the dialog
        edit_main_event.clickEvent(event_main_id);
        
        return false;
    });
	
	$('.groupedit').click(function(){
        var con    = $('#form_gyartocsoport_edit');
		var grp_id = $(this).attr('grpid');
		
        $('#nev', con).val($(this).attr('nev'));
        $('#group_id', con).val(grp_id);
		
		$('#gyartocsoport_dialog_edit').dialog('open');
		
		return false;
    });
	
	$('#gyartocsoport_dialog_edit').dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_gyartocsoport_edit').submit();
                $('#gyartocsoport_dialog_edit').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#gyartocsoport_dialog_edit').dialog('close');
            }
        }
    });
	
	//insert new type
    $('.new-type').click(function(){
        //open the dialog
        $('#tipus_dialog_new').dialog('open');
        
        return false;
    });
	
	//create the new type dialog
    $('#tipus_dialog_new').dialog({
        autoOpen: false,
        modal: true,
        width: 600,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_tipus_new').submit();
                $('#tipus_dialog_new').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#tipus_dialog_new').dialog('close');
            }
		}
    });
	
	$('.typeedit').click(function(){
        var con    = $('#form_tipus_edit');
		
        $('#tipus', con).val($(this).attr('tipus'));
        $('#name_eng', con).val($(this).attr('name_eng'));
        $('#name_hun', con).val($(this).attr('name_hun'));
        $('#desc_eng', con).val($(this).attr('desc_eng'));
        $('#desc_hun', con).val($(this).attr('desc_hun'));
		
		$('#tipus_dialog_edit').dialog('open');
		
		return false;
    });
	
	$('#tipus_dialog_edit').dialog({
        autoOpen: false,
        modal: true,
        width: 550,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#form_tipus_edit').submit();
                $('#tipus_dialog_edit').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#tipus_dialog_edit').dialog('close');
            }
        }
    });
    
    //create the new main event dialog
    $('#new_main_event_dialog').dialog({
        autoOpen: false,
        modal: true,
        width: 800,
        buttons: {
            '<?=$this->lang->line('save')?>': function(){
                $('#rogzites_main_form').submit();
                $('#new_main_event_dialog').dialog('close');
            },
            '<?=$this->lang->line('cancel')?>': function(){
                $('#new_main_event_dialog').dialog('close');
            }
        }
    });
    
    //create the click event handler for the new main event anchor
    $('.new_main_anchor').click(function(){
        var con = $('#rogzites_main_form');
        
        $('#weboldal_uj', con).bind('keyup blur click', function(){
            $(this).next('.view_link_container').children('a.view_link').attr('href', $(this).val());
        });
        
        //set the select link's target
        $('select', con).each(function(){
            $(this).next('.view_link_container').children('a.view_link').attr('href', '/page/show/'+$(this).val());
        }).change(function(){
            $(this).next('.view_link_container').children('a.view_link').attr('href', '/page/show/'+$(this).val());
        });
        
        $('#new_main_event_dialog').dialog('open');
        
        return false;
    });
    
    //set the numeric fields
    $('.numeric').numeric();
});

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

ul.main_events, ul.events, ul.registrations{
    list-style-type: none;
    padding: 0px;
}

ul.main_events, ul.events{
    margin: 0px 0px 0px 20px;
}

ul.registrations{
    margin: 5px 0px 5px 40px;
}

li.main_event{
    font-weight: bold;
}

li.main_event, li.event{
    color: green;
    clear: both;
}

ul.events, ul.registrations{
    display: none;
}

li.full span.main_event_name, li.full span.event_date, li.full span.event_name{
    color: red !important;
}

li.inactive span.event_date, li.inactive span.main_event_name, li.inactive span.main_event_dates{
    color: gray !important;
    text-decoration: line-through;
}

li.new-link{
    margin: 5px 0px;
}

li.col_fajlok{
	clear: both;
}

li.main_event span.open-closer, span.main_event_name{
    font-size: 14px !important;
}

span.main_event_dates{
    font-weight: normal;
    margin: 0px 0px 0px 10px;
}

span.event_name{
    margin: 0px 10px 0px 0px;
}

span.open-closer, span.open-closer-all, span.open-closer-allout, span.open-closer-allin{
    margin-right: 10px;
    color: gray;
    cursor: pointer;
}

.mutato{
	cursor: pointer;
}

span.open-closer-space-holder{
    margin-right: 10px;
    color: white;
}

span.delete-link, span.edit-link, .edit_gyarto{
    margin: 0px 0px 0px 20px;
}

span.view_link_container{
    margin: 0px 0px 0px 10px;
}

span.reg_email{
	width: 50px;
}

div#edit_event_dialog table tr td, div#new_event_dialog table tr td, div#edit_main_event_dialog table tr td, div#new_main_event_dialog{
    text-align: left;
}

div.error{
    margin: 10px;
    color: red;
    font-weight: bold;
    text-align: center;
}

div.picture_link_container{
    margin: 0px 0px 10px 0px;
}

a.view_link{
    color: #003C70 !important;
    font-size: 10px !important;
}

tr.neccessary td{
    font-weight: bold;
}

tr.neccessary td input{
    font-weight: normal !important;
    border: 1px solid black;
    background-color: #fdb910;
}

div.col_szint1, div.col_szint2, div.col_szint3{
	float: left;
}

div.col_szint1{
	width: 190px;
}

div.col_szint2{
	width: 180px;
}

div.col_szint3{
	width: 192px;
}

.new-man, .new_anchor{
	clear: both;
	cursor: pointer;
	margin-top: 15px;
}

</style>
<?if($error):?>
<div class="error"><?=$error?></div>
<?endif;?>
<?if($gyartok):?>
<div id="confirm_dialog" style="display: none;" title="Törlés megerősítés"></div>
<div id="gyarto_dialog_edit" style="display: none;" title="Brand name">
	<form action="/admin/gyartoedit2" method="post" id="form_gyarto_edit" enctype='multipart/form-data'>
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="mid" id="mid" value="" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td><?=$this->lang->line('shwrm_ujnev')?>:</td>
            <td>
            	<input type='text' name='name' id='name' value='' />
            </td>
        </tr>
		<tr>
            <td><?=$this->lang->line('shwrm_logocs')?>:<br /><em>237 x 122 px</em></td>
            <td valign="top">
            	<input type="file" name="gyartokep" id="gyartokep" />
            </td>
        </tr>
		<?if( hun() || eng() ):?>
		<tr>
            <td align="right">Márka csoport: </td>
            <td valign="top">
				<select name="group_id[]" id="group_id" multiple="multiple" size="4">
            	<?foreach($brandgroup as $group):?>
				<option value="<?=$group->group_id?>"><?=$group->nev?></option>
				<?endforeach;?>
				</select>
            </td>
        </tr>
		<?endif;?>
    </table>
    </form>
</div>
<div id="gyartocsoport_dialog_edit" style="display: none;" title="<?=$this->lang->line('shwrm_brgred')?>">
	<form action="/admin/gyartocsopedit2" method="post" id="form_gyartocsoport_edit">
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="group_id" id="group_id" value="" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td><?=$this->lang->line('shwrm_ujnev')?>:</td>
            <td>
            	<input type='text' name='nev' id='nev' value='' />
            </td>
        </tr>
    </table>
    </form>
</div>
<?if(hun() || eng()):?>
<div id="gyartocsoport_dialog_uj" style="display: none;" title="Új márka csoport rögzítése">
	<form action="/admin/gyartocsopedit2" method="post" id="form_gyartocsoport_new">
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="group_id" id="group_id" value="uj" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td align="right">Név:</td>
            <td>
            	<input type='text' name='nev' id='nev' value='' />
            </td>
        </tr>
        <tr class="neccessary">
            <td align="right">
				azonosító:<br />
				<i>(csak az angol ábécé kisbetűi)</i><br />
				pl.: sanderson<br />
				(Beszédes url-hez kell.)
			</td>
            <td valign="top">
            	<input type='text' name='azon' id='azon' value='' />
            </td>
        </tr>
    </table>
    </form>
</div>
<?endif;?>
<div id="gyarto_dialog_uj" style="display: none;" title="<?=$this->lang->line('shwrm_ujbran')?>">
	<form action="/admin/gyartoedit2" method="post" id="form_gyarto_new" enctype='multipart/form-data'>
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="mid" id="mid" value="uj" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td align="right"><?=$this->lang->line('name')?>:</td>
            <td>
            	<input type='text' name='name' id='name' value='' />
            </td>
        </tr>
        <tr class="neccessary">
            <td align="right">
				<?=$this->lang->line('shwrm_mappa')?>
			</td>
            <td valign="top">
            	<input type='text' name='dir' id='dir' value='' />
            </td>
        </tr>
		<tr>
            <td align="right"><?=$this->lang->line('shwrm_logoke')?>: <br /><em>237 x 122 px</em> </td>
            <td valign="top">
            	<input type="file" name="gyartokep" id="gyartokep" />
            </td>
        </tr>
		<?if( hun() || eng() ):?>
		<tr>
            <td align="right">Márka csoport: </td>
            <td valign="top">
				<select name="group_id[]" id="group_id">
				<option value="" selected="selected">-- nincs csoportban --</option>
            	<?foreach($brandgroup as $group):?>
				<option value="<?=$group->group_id?>"><?=$group->nev?></option>
				<?endforeach;?>
				</select>
            </td>
        </tr>
		<?elseif(ita()):?>
		<tr style="display: none;">
            <td align="right">Márka csoport: </td>
            <td valign="top">
				<select name="group_id" id="group_id">
				<option value="<?=$brandgroup->group_id?>"><?=$brandgroup->nev?></option>
				</select>
            </td>
        </tr>
		<?endif;?>
    </table>
    </form>
</div>
<div id="edit_event_dialog" style="display: none;" title="Category name">
	<form action="/admin/kategedit2" method="post" id="modositas_form" enctype='multipart/form-data'>
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="cid" id="cid" value="" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td><?=$this->lang->line('name')?> hun:</td>
            <td>
            	<input type='text' name='nev_hun' id='nev_hun' value='' />
            </td>
        </tr>
        <tr class="neccessary">
            <td><?=$this->lang->line('name')?> eng:</td>
            <td>
            	<input type='text' name='nev_eng' id='nev_eng' value='' />
            </td>
        </tr>
        <tr>
            <td><?=$this->lang->line('kepvalt')?>:<br /><em>182 x 152 px</em></td>
            <td valign="top">
            	<input type="file" name="katkep" id="katkep" />
            </td>
        </tr>
    </table>
    </form>
</div>
<div id="new_event_dialog" style="display: none;" title="New category">
	<form action="/admin/kategedit2" method="post" id="rogzites_form" enctype='multipart/form-data'>
    <?=form_hidden('cid', 'uj')?>
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td><?=$this->lang->line('brand')?>:</td>
            <td>
				<select name="mid">
				<?foreach($gyartok as $tipus):?>
				<option value="<?=$tipus->id?>"><?=$tipus->name?></option>
				<?endforeach;?>
				</select>
			</td>
        </tr>
        <tr class="neccessary">
            <td><?=$this->lang->line('name')?> Hun:</td>
            <td><input type="text" name="nev_hun" id="nev_hun" /></td>
        </tr>
        <tr class="neccessary">
            <td><?=$this->lang->line('name')?> Eng:</td>
            <td><input type="text" name="nev_eng" id="nev_eng" /></td>
        </tr>
        <tr>
            <td><?=$this->lang->line('shwrm_katkep')?>:<br /><em>182 x 152 px</em></td>
            <td valign="top">
            	<input type="file" name="katkep" id="katkep" />
            </td>
        </tr>
    </table>
    </form>
</div>
<div id="tipus_dialog_edit" style="display: none;" title="Típus szerkesztése">
	<form action="/admin/coll2tipusedit" method="post" id="form_tipus_edit" enctype='multipart/form-data'>
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="tipus" id="tipus" value="" />
    <table cellspacing="0" cellpadding="10" border="0" align="center">
        <tr class="neccessary">
            <td>Angol név:</td>
            <td><input type='text' name='name_eng' id='name_eng' value='' /></td>
		</tr>
		<tr class="neccessary">
            <td>Magyar név:</td>
            <td><input type='text' name='name_hun' id='name_hun' value='' /></td>
        </tr>
        <tr>
            <td>Angol leírás:</td>
            <td><textarea name='desc_eng' id='desc_eng' rows="3" cols="45" style="text-align: right;"></textarea></td>
		</tr>
		<tr>
            <td>Magyar leírás:</td>
            <td><textarea name='desc_hun' id='desc_hun' rows="3" cols="45" style="text-align: right;"></textarea></td>
        </tr>
        <tr>
            <td>Új angol kép:<br>733x468 px</td>
            <td><input type='file' name='image_eng' id='image_eng' /></td>
		</tr>
		<tr>
            <td>Új magyar kép:<br>733x468 px</td>
            <td><input type='file' name='image_hun' id='image_hun' /></td>
        </tr>
    </table>
    </form>
</div>
<div id="tipus_dialog_new" style="display: none;" title="Új Típus felvétele">
	<form action="/admin/coll2tipusedit" method="post" id="form_tipus_new" enctype='multipart/form-data'>
    <input type="hidden" name="do" id="do" value="true" />
	<input type="hidden" name="tipus" id="tipus" value="new" />
    <table cellspacing="0" cellpadding="10" border="0" align="left" style="text-align: left;">
        <tr class="neccessary">
            <td>
				Hivatkozás:<br />
				(csak az angol ábécé kisbetűi)<br />
				pl.: kitchenfurniture<br />
				(Beszédes url-hez kell.) <br />
				Utólag nem módosítható!
			</td>
            <td><input type='text' name='typeurl' id='typeurl' value='' /></td>
		</tr>
		<tr class="neccessary">
            <td>Elem típusa:<br />(Tényleges típus,<br />ARCHLine.XP típus)</td>
            <td>
				<select name="type_download" id="type_download" style="width: 255px;">
					<?foreach($archlinetipusok as $tipus):?>
					<option value="<?=$tipus->type_download?>"><?=$tipus->type_download?></option>
					<?endforeach;?>
				</select>
			</td>
		</tr>
		<tr class="neccessary">
            <td>Angol név:</td>
            <td><input type='text' name='name_eng' id='name_eng' value='' /></td>
		</tr>
		<tr class="neccessary">
            <td>Magyar név:</td>
            <td><input type='text' name='name_hun' id='name_hun' value='' /></td>
        </tr>
        <tr>
            <td>Angol leírás:</td>
            <td><textarea name='desc_eng' id='desc_eng' rows="3" cols="45" style="text-align: right;"></textarea></td>
		</tr>
		<tr>
            <td>Magyar leírás:</td>
            <td><textarea name='desc_hun' id='desc_hun' rows="3" cols="45" style="text-align: right;"></textarea></td>
        </tr>
        <tr>
            <td>Angol kép:<br>733x468 px</td>
            <td><input type='file' name='image_eng' id='image_eng' /></td>
		</tr>
		<tr>
            <td>Magyar kép:<br>733x468 px</td>
            <td><input type='file' name='image_hun' id='image_hun' /></td>
        </tr>
    </table>
    </form>
</div>

<?if( hun() || eng() ):?><h2>Márkák, Kategóriák, Elemek szerkesztése</h2><?endif;?>

<p align="right">
	<?=ucfirst($this->lang->line('mindet'))?>
	<span class="open-closer-allin"><?=$this->lang->line('open')?></span> / <span class="open-closer-allout"><?=$this->lang->line('close')?></span>
</p>
<ul class="main_events">
    <?foreach($gyartok as $tipus):?>
    <li class="main_event" name="<?=$tipus->name?>" man_id="<?=$tipus->id?>" grpid="<?=$tipus->group_id?>">
        <div class="col_szint1">
        <span class="open-closer">+</span>
        <span class="main_event_name"><?=$tipus->name?></span>
        <span class="main_event_dates">(<?=$tipus->darab?>)</span>
        </div>
        <span class="edit-link"></span>
        <span class="view-link">
            <?=anchor($urlelotag.'collection2012/manufacturer/'.$tipus->dir, $this->lang->line('view'), 'target="_blank"')?>
			<a class="edit_gyarto mutato"><?=$this->lang->line('pages_h1_edit')?></a>
        </span>
		<?if(hun() || eng()):?>
		<span class="delete-link"><?=anchor('/admin/delman2/'.$tipus->id, $this->lang->line('news_button_delete'), 'class="del_anchor" question="Biztosan törli a gyártót?"')?></span>
		<?endif;?>
        <span class="delete-link"></span>
    </li>
        <ul class="events">
            <?if($tipus->kategoria):?>
            <?foreach($tipus->kategoria as $kategoria):?>
            <li class="event" event_name="<?=$kategoria->nev_hun?>" event_name_eng="<?=$kategoria->nev_eng?>" c_id="<?=$kategoria->c_id?>">
                <div class="col_szint2">
                <?if($kategoria->fajl):?>
                <span class="open-closer">+</span>
                <?else:?>
                <span class="open-closer-space-holder">+</span>
                <?endif;?>
                <span class="event_name"><? if(hun()) print $kategoria->nev_hun; else print $kategoria->nev_eng; ?></span>
                <span class="event_date">(<?=$kategoria->darab?>)</span>
                </div>
                <span class="edit-link">
					<?=anchor($urlelotag.'collection2012/category/'.$kategoria->c_id, $this->lang->line('view'), 'target="_blank"')?>
				</span>
                <span class="edit-link"><?=anchor('/admin/kategedit2/'.$kategoria->c_id, $this->lang->line('pages_h1_edit'), 'class="edit_anchor" event_id="'.$kategoria->c_id.'"')?>
                </span>
                <span class="delete-link"><?=anchor('/admin/delkateg2/'.$kategoria->c_id, $this->lang->line('news_button_delete'), 'class="del_anchor" question="Biztosan törli a kategóriát?"')?></span>
                <span class="edit-link"><?=anchor('/admin/col2categorybrandchange/'.$kategoria->c_id, 'Kategória áthelyezése más márkához')?></span>
            </li>
            <?if($kategoria->fajl):?>
            <ul class="registrations">
                <?foreach($kategoria->fajl as $fajl):?>
                <li class="col_fajlok">
                    <div class="col_szint3">
                    <span class="reg_email"><?=$fajl->title_eng?></span>
                    </div>
                    <span class="edit-link"><?=anchor($urlelotag.'admin/col2objedit/'.$fajl->o_id, $this->lang->line('pages_h1_edit'), 'class="edit_anchor888" event_id="'.$fajl->c_id.'"')?></span>
                    <span class="delete-link"><?=anchor('admin/delobjekt2/'.$fajl->o_id, $this->lang->line('news_button_delete'), 'class="del_anchor" question="Biztosan törli a fájlt?"')?></span>
					<span class="edit-link"><?=anchor($urlelotag.'admin/col2brandchange/'.$fajl->o_id, 'Brand váltás', 'class="edit_anchor888" event_id="'.$fajl->c_id.'"')?></span>
                </li>
                <?endforeach;?>
            </ul>
            <?endif;?>
            <?endforeach;?>
            <li class="new-link" event_main_id="<?=$main_event->event_main_id?>"></li>
            <?endif;?>
        </ul>
    <?endforeach;?>
	<?if(hun() || eng()):?>
	<li class="new-mangroup mutato"><br /><br /><u>Új gyártó csoport rögzítése</u></li>
	<li class="new-man mutato"><u>Új gyártó rögzítése</u></li>
	<li class="new_anchor mutato"><u>Új kategória rögzítése</u></li>
	<li class="new-type mutato"><br /><u>Új típus rögzítése</u></li>
	<?elseif(ita()):?>
	<li class="new-man mutato"><u><?=$this->lang->line('shwrm_ujbran')?></u></li>
	<li class="new_anchor mutato"><u><?=$this->lang->line('shwrm_ujkat')?></u></li>
	<?endif;?>
</ul>
<?else:?>
<p>No events!</p>
<?endif;?>

<?if(ita()):?>
<br /><h2>Italian group edit</h2>
<ul>
	<li>
		<div class="groupedit mutato col_szint1" grpid="<?=$brandgroup->group_id?>" nev="<?=$brandgroup->nev?>"><?=$brandgroup->nev?></div>
		<span class="view-link">
            <?=anchor($urlelotag.'collection2012/brandgroup/'.$brandgroup->azon, $this->lang->line('view'), 'target="_blank"')?>
		</span>
		<span class="edit-link">
            <a class="groupedit mutato" grpid="<?=$brandgroup->group_id?>" nev="<?=$brandgroup->nev?>"><?=$this->lang->line('pages_h1_edit')?></a>
        </span>
		<span class="delete-link"><?=anchor('/admin/delmangroup2/'.$brandgroup->group_id, $this->lang->line('news_button_delete'), 'class="del_anchor" question="Biztosan törli a csoportot?"')?></span>
	</li>
</ul>
<?elseif( hun() || eng() ):?>
<br /><h2>Márka csoportok szerkesztése</h2>
<ul>
	<?foreach($brandgroup as $group):?>
	<li>
		<div class="groupedit mutato col_szint1" grpid="<?=$group->group_id?>" nev="<?=$group->nev?>"><?=$group->nev?></div>
		<span class="view-link">
            <?=anchor($urlelotag.'collection2012/brandgroup/'.$group->azon, $this->lang->line('view'), 'target="_blank"')?>
		</span>
		<span class="edit-link">
            <a class="groupedit mutato" grpid="<?=$group->group_id?>" nev="<?=$group->nev?>"><?=$this->lang->line('pages_h1_edit')?></a>
        </span>
		<span class="delete-link"><?=anchor('/admin/delmangroup2/'.$group->group_id, $this->lang->line('news_button_delete'), 'class="del_anchor" question="Biztosan törli a csoportot?"')?></span>
	</li>
	<?endforeach;?>
</ul>
<p style="margin-top: 15px;"><a href="/admin/coll2stat">Letöltési statisztika</a></p>
<?endif;?>

<?if( hun() || eng() ):?><br />
<h2>Típusok szerkesztése</h2>
<?if($tipusok):?>
<ul>
	<?foreach($tipusok as $tipus):?>
	<li>
		<div class="mutato col_szint1"><?=$tipus->type?></div>
		<span class="view-link">
            <?=anchor($urlelotag.'showroom/types/'.$tipus->type, $this->lang->line('view'), 'target="_blank"')?>
		</span>
		<span class="edit-link">
            <a class="typeedit mutato" tipus="<?=$tipus->type?>" name_eng="<?=$tipus->name_eng?>" name_hun="<?=$tipus->name_hun?>" desc_eng="<?=$tipus->desc_eng?>" desc_hun="<?=$tipus->desc_hun?>">
				<?=$this->lang->line('pages_h1_edit')?>
			</a>
        </span>
	</li>
	<?endforeach;?>
</ul>
<?endif;?>
<?endif;?>