
<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script type="text/javascript"> 
{include file="$incpath/other/validate_js.tpl"}
{literal}

<!-- //
function ajaxFileUpload(updir,divid,resize)
{
	$("#loading_" + divid)
	.ajaxStart(function(){
		$(this).show();
		document.getElementById('buttonUpload_' + divid).value = '{/literal}{#Global_Wait#}{literal}';
		document.getElementById('buttonUpload_' + divid).disabled = true;
		
	})
	.ajaxComplete(function(){
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{/literal}{#Global_Upload#}{literal}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
	});

	$.ajaxFileUpload
	(
		{
			url:'index.php?do=gallery&sub=categicon&updir=' + updir + '&divid=' + divid + '&resize=' + resize,
			secureuri:false,
			fileElementId:'fileToUpload_' + divid,
			dataType: 'json',
			success: function (data, status)
			{
				if(typeof(data.error) != 'undefined')
				{
					if(data.error != '')
					{
						document.getElementById('UpInf_' + divid).innerHTML  = data.error;
					}else
					{
						document.getElementById('UpInf_' + divid).innerHTML = data.msg;
						document.getElementById('newFile_' + divid).value =  data.html;
						
					}
				}
			},
			error: function (data, status, e)
			{
				document.getElementById('UpInf_' + divid).innerHTML = e;
			}
		}
	)
	return false;
}


$.validator.setDefaults({
	submitHandler: function() 
	{ 
		document.forms['editForm'].submit();
	}
});

$().ready(function() 
{
	$("#editForm").validate(
	{ 
	rules: {
				Name_1: {required: true},
				Tags: {maxLength: 255}
			}, 
			messages: 
			{
			}
	}
	);
}
)
// -->
</script>
{/literal}
<div class="popbox">
<div class="header">{#Gallery_CategNew#}</div>
<form name="editForm" id="editForm" method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="180" class="row_left">{#Global_Name#} ({$language_long_1})</td>
      <td class="row_right"><input name="Name_1" type="text" class="input" value="{$res->Name_1|koobispecialchars}" size="50"></td>
    </tr>
    <tr>
      <td class="row_left">{#Global_Name#} ({$language_long_2})</td>
      <td class="row_right"><input name="Name_2" type="text" class="input" value="{$res->Name_2|koobispecialchars}" size="50"></td>
    </tr>
    <tr>
      <td class="row_left">{#Global_Name#} ({$language_long_3})</td>
      <td class="row_right"><input name="Name_3" type="text" class="input" value="{$res->Name_3|koobispecialchars}" size="50"></td>
    </tr>
    <tr>
      <td class="row_left">{#Global_descr#} ({$language_long_1})</td>
      <td class="row_right">{$Beschreibung_1}</td>
    </tr>
    <tr>
      <td class="row_left">{#Global_descr#} ({$language_long_2})</td>
      <td class="row_right">{$Beschreibung_2}</td>
    </tr>
    <tr>
      <td class="row_left">{#Global_descr#} ({$language_long_3})</td>
      <td class="row_right">{$Beschreibung_3}</td>
    </tr>
     {if $res->Img}
    <tr>
      <td class="row_left">{#Gallery_CategIcon#}</td>
      <td class="row_right">
      {$res->Img}
      <br />
      <label>
      <input type="checkbox" name="delold" value="1" />{#Gallery_delOldCategIcon#}
      </label>
      <input type="hidden" name="oldimg" value="{$res->ImgPath}" />
      </td>
    </tr>
    {/if}
    <tr>
      <td class="row_left">{#Gallery_CategIconNew#}</td>
      <td class="row_right">
      <!-- Uploadform --> 
      <div id="UpInf_1"></div><div id="loading_1" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
       <input id="fileToUpload_1" type="file" size="45" name="fileToUpload_1" class="input" />
       <input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('','1','{$gs->Kategorie_Icon_Breite}');" value="{#Global_Upload#}" />
       <input type="hidden" name="newImg_1" id="newFile_1" />
       <!-- Uploadform -->   
      </td>
    </tr>
    <tr>
      <td class="row_left">{#Global_Active#}</td>
      <td class="row_right">
       <label><input type="radio" name="Aktiv" value="1" checked="checked" />{#Yes#}</label>
      <label><input type="radio" name="Aktiv" value="0" />{#No#}</label>      </td>
    </tr>
    <tr>
      <td class="row_left">
      <span {popup sticky=$config_vars.POPSTICKY   width=400 text=$config_vars.GalleryTagHelp}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
      {#Tags#}      </td>
      <td class="row_right"><input type="text" name="Tags" class="input" value="{$res->Tags|koobispecialchars}" style="width:90%" maxlength="255"></td>
    </tr>
   
  </table>
<input type="submit" class="button big" value="{#Save#}" />
<input type="button" onclick="window.close();" class="button big" value="{#Close#}" />
<input name="save" type="hidden" id="save" value="1">
</form>
</div>
