{literal}
<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script type="text/javascript"> 
<!-- //

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;
		//document.getElementById('ajax_form').style.display = 'none';
		
	})
	.ajaxComplete(function(){
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{/literal}{#Global_Upload#}{literal}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
		//document.getElementById('ajax_form').style.display = '';
	});

	$.ajaxFileUpload
	(
		
		{
			
			url:'index.php?do=shop&sub=categ_icon_upload&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;
}

function checkForm()
{
	if(document.getElementById('NameCateg').value=='')
	{
		alert('{/literal}{#Shop_cat_JSnoName#}{literal}');
		document.getElementById('NameCateg').focus();
		return false;
	}
}

// -->
</script>
{/literal}

<div class="popbox">
<div class="header">{#Global_NewCateg#}</div>

<form name="form" action="" method="post" onsubmit="return checkForm()" enctype="multipart/form-data">
 {if $error}
 {foreach from=$error name=ee item=e}
 {$e}
 {/foreach}
 {/if}
<table width="100%" border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td nowrap="nowrap" class="row_left">{#Global_CategParent#}</td>
    <td class="row_right">
    <select name="Parent" class="input" style="width:200px; padding:0px" >
    <option value="0">{#Global_noParent#}</option>
	{foreach from=$shop_search_small_categs item=scs}
	{if $scs->Subcount<28}<option {if $scs->bold==1}class="shop_selector_back"{else}class="shop_selector_subs"{/if} value="{$scs->catid}" {if $smarty.request.id==$scs->catid}selected="selected" {/if}>{$scs->visible_title|specialchars}</option>{/if}
	{/foreach}
    </select>
    </td>
  </tr>
  <tr>
    <td width="160" nowrap="nowrap" class="row_left">{#Global_name#}</td>
    <td class="row_right"><input name="Name_1" id="NameCateg" type="text" class="input" size="40" style="width:200px;" value="{$row->Name|koobispecialchars}" /></td>
  </tr>
  <tr>
    <td width="160" nowrap="nowrap" class="row_left">{#Global_descr#}</td>
    <td class="row_right">{$Editor} </td>
  </tr>
  {if $row->Bild_Kategorie}
  <tr>
    <td width="160" nowrap="nowrap" class="row_left">
    <span {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_cat_catimageinf}>
    <img class="absmiddle" src="{$imgpath}/help.png" alt="" />    </span> 
    {#Shop_cat_catimage#}    </td>
    <td class="row_right">
    {$row->Bild_Kategorie}    </td>
    </tr>
    {/if}
    <tr>
    <td width="160" nowrap="nowrap" class="row_left">
    <span {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_cat_newcatimage_inf}>
    <img class="absmiddle" src="{$imgpath}/help.png" alt="" />    </span> 
    {#Shop_cat_newcatimage#}    </td>
    <td class="row_right">
 
	<!-- Uploadform  -->  
	<!-- Status Upload -->  
    <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>
   <!-- Status Upload -->  
   <input id="fileToUpload_1" type="file" size="45" name="fileToUpload_1" class="input" />
   <input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('/uploads/shop/icons_categs/','1','120');" value="{#Global_Upload#}" />
   <input type="hidden" name="newImg_1" id="newFile_1" />
   <!-- Uploadform -->   </td>
  </tr>
  
    {if $row->Bild_Navi}
    <tr>
      <td width="160" nowrap="nowrap" class="row_left">
      <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_cat_catnavimageinf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
      {#Shop_cat_catnavimage#}      </td>
      <td class="row_right">{$row->Bild_Navi}</td>
    </tr>
    {/if}
    <tr>
    <td width="160" nowrap="nowrap" class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_cat_catnavimage_newinf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Shop_cat_catnavimage_new#}        </td>
    <td class="row_right">
    
    <!-- Uploadform  -->  
	<!-- Status Upload -->  
    <div id="UpInf_2"></div><div id="loading_2" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
   <!-- Status Upload -->  
   <input id="fileToUpload_2" type="file" size="45" name="fileToUpload_2" class="input" />
   <input type="button" class="button" id="buttonUpload_2" onclick="return ajaxFileUpload('/uploads/shop/navi_categs/','2','25');" value="{#Global_Upload#}" />
   <input type="hidden" name="newImg_2" id="newFile_2" />
   <!-- Uploadform -->    </td>
  </tr>
   
    <tr>
    <td width="160" nowrap="nowrap" class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_cat_ustidinf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Shop_cat_ustid#}    </td>
    <td class="row_right">
    <select name="UstId" id="UstId">
    {foreach from=$ust_elements item=ust}
      <option value="{$ust->Id}"{if $ust->Id==$row->UstId} selected="selected"{/if}>{$ust->Name} ({$ust->Wert}%)</option>
     {/foreach}
    </select>    </td>
  </tr>
  
    <tr>
      <td class="row_left">{#Global_PosiNavi#}</td>
      <td class="row_right"><input name="Position" type="text" class="input" id="posi" value="1" size="3" maxlength="2" /></td>
    </tr>
    <tr>
    <td width="160" class="row_left">&nbsp;</td>
    <td class="row_right">
    <input class="button" type="submit" id="" value="{#Global_save#}" />
      <input class="button" type="button" onclick="window.close();" value="{#Global_close#}" />
     
      <input type="hidden" name="save" value="1" />      </td>
  </tr>
</table>
</form>
</div>