<script language="javascript">
{include file="$incpath/other/validate_js.tpl"}
{literal}
$(document).ready(function() {
	var t = document.getElementById('Template').options[document.getElementById('Template').selectedIndex].value;
	var validator = $("#editform").validate(
	{ 
		rules: 
		{ 
			Name: {required: true},
			LimitNews: {required: true,range: [2, 25]},
			LimitNewsArchive: {required: true,range: [5, 50]},
			CSS_Theme:{required:true, minlength:3, remote:'index.php?do=settings&sub=checkcsspath&t=' + t}
		},
		messages: 
		{
			CSS_Theme:{remote: jQuery.format("{/literal}{#Validate_wrongCSSPath#}{literal}")}
		},
			
		submitHandler: function() 
		{ 
			document.forms['editform'].submit();
		},
		
		success: function(label) 
		{
			label.html("&nbsp;").addClass("checked");
		}
	});
});

function caa()
{
	if(document.getElementById('sa').checked==true)
		document.getElementById('catr').style.display='';	
	else 
		document.getElementById('catr').style.display='none';	
}
{/literal}
</script>
<div class="popbox">
<form action="" method="post" name="editform" id="editform">
<div class="header">{#Sections_Edit#}</div>

<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="200" class="row_left">{#Sections_spez#}</td>
    <td class="row_right"><input class="input" style="width:150px" name="Name" type="text" id="Name" value="{$res->Name|koobispecialchars}"></td>
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY text=$config_vars.Sections_ThemeInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />   
    {#Sections_theme#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Template" id="Template">
    {foreach from=$folders item=tp}
      <option value="{$tp->Name}" {if $tp->Name==$res->Template}selected="selected"{/if}>{$tp->Name}</option>
      {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Sections_CssInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Sections_Css#}</td>
    <td class="row_right"><input class="input" style="width:150px" name="CSS_Theme" type="text" value="{$res->CSS_Theme|koobispecialchars}"></td>
    <td>  
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Sections_InActiveInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Sections_active#}</td>
    <td class="row_right">
      <label><input onclick="caa()" type="radio" name="Aktiv" value="1" {if $res->Aktiv==1}checked="checked"{/if}>{#Yes#}</label>  
      <label><input onclick="caa()" type="radio" name="Aktiv" id="sa"  value="0" {if $res->Aktiv!=1}checked="checked"{/if}>{#No#}</label></td>

    </td>
  </tr>
  <tr id="catr">
    <td class="row_left">{#Sections_msginactive#}</td>
    <td class="row_right"><textarea class="input" style="width:350px; height:100px" name="Meldung" id="Meldung">{$res->Meldung|koobispecialchars}</textarea>    </td>
  </tr>
  <tr>
    <td class="row_left">
 
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Sections_OpenPassInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />    
    {#Sections_Pass#}</td>
    <td class="row_right"><input type="text" class="input" style="width:150px" name="Passwort" id="pw" value="{$res->Passwort}" />
      <input class="button" onclick="popup('../index.php?area={$res->Id}&pass=' + document.getElementById('pw').value,'','980','800',1)" type="button" value="{#Sections_OpenPass#}" /></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_newslimit#}</td>
    <td class="row_right"><input class="input" name="LimitNews" type="text" id="LimitNews" value="{$res->LimitNews}" size="4" maxlength="2"></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_newslimit_arc#}</td>
    <td class="row_right"><input class="input" name="LimitNewsArchive" type="text" id="LimitNewsArchive" value="{$res->LimitNewsArchive}" size="4" maxlength="2"></td>
  </tr>
  </table>
  <input type="submit" value="{#Save#}" class="button big">
<input type="button" class="button big" value="{#Close#}" onclick="window.close()" />
  <table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td colspan="2" class="headers">{#Sections_tTemplates#}</td>
    </tr>
  <tr>
    <td width="200" class="row_left">{#Sections_start#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_index">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_index==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_shop#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_shop">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_shop==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_content#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_content">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_content==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_news#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_news">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_news==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>
    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_newsarc#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_newsarchive">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_newsarchive==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_newsletter#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_newsletter">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_newsletter==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>
    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_sitemap#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_sitemap">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_sitemap==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_useractions#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_useraction">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_useraction==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_calendar#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_calendar">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_calendar==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_faq#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_faq">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_faq==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_gallery#}</td>
    <td class="row_right">
    <select class="input" style="width:150px" name="Tpl_gallery">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_gallery==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_articles#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_articles">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_articles==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_products#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_products">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_products==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_downloads#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_downloads">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_downloads==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_links#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_links">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_links==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_signup#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_register">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_register==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_forums#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_forums">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_forums==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_userlist#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_members">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_members==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_pn#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_pn">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_pn==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_passlost#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_pwlost">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_pwlost==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_manufacturer#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_manufacturer">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_manufacturer==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_cheats#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_cheats">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_cheats==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_polls#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_polls">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_poll==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
   <tr>
    <td class="row_left">{#Sections_guestbook#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_guestbook">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_guestbook==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_denied#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_denied">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_denied==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_misc#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_misc">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_misc==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_imprint#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_imprint">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_imprint==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
  <tr>
    <td class="row_left">{#Sections_search#}</td>
    <td class="row_right"><select class="input" style="width:150px" name="Tpl_search">
    {foreach from=$templates item=t}
    <option value="{$t->Name}" {if $res->Tpl_search==$t->Name}selected="selected"{/if}>{$t->Name}</option>
    {/foreach}
    </select></td>
  </tr>
</table>
<input name="save" type="hidden" value="1" />
<input name="section" type="hidden" id="section" value="{$smarty.request.section|default:1}">
<input type="submit" value="{#Save#}" class="button big">
<input type="button" class="button big" value="{#Close#}" onclick="window.close()" />
</form>

</div>
<script>
<!--
caa();
-->
</script>
