

<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=shop&sub=categ_icon&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['new'].submit();
	}
});

$().ready(function() {
	$("#new").validate(
	{ // validate
	rules: {
				Titel: {required: true,minLength: 5},
				Artikelnummer: {required: true,minLength: 5},
				Preis_Liste: {required: true,number: true, min:1},
				Gewicht: {required: true,number: true, min:0},
				Lagerbestand: {required: true,number: true},
				MinBestellung: {required: true,number: true, min:0},
				MaxBestellung: {required: true,number: true, min:0}
			},
			messages: 
			{
				Preis_Liste:{required:{/literal}'{#Shop_articles_edit_jsnoprice#}'{literal}}
			}
	}
	);
}
);
// -->
</script>
{/literal}

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

<form name="new" id="new" action="" method="post" enctype="multipart/form-data">
<div id="main">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
 <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY   text=$config_vars.Shop_articles_artInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_title#}</td>
    <td class="row_right"><input type="text" class="input" name="Titel" style="width:250px" value="{$row.Titel|stripslashes}"></td>
    </tr>

 <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY   text=$config_vars.Shop_articles_artnrInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_artnr#}</td>
    <td class="row_right"><input autocomplete="off" type="text" class="input" name="Artikelnummer" style="width:250px" value=""></td>
    </tr>
	   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_matchwordsinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_matchwords#}</td>
     <td class="row_right"><input type="text" class="input" name="Schlagwoerter" style="width:250px" value="{$row.Schlagwoerter|stripslashes}"></td>
   </tr>

  <tr>
 <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.FSK18_ShopProductinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#FSK18_ShopProduct#}</td>
    <td class="row_right">
	<label><input type="radio" name="Fsk18" value="1" {if $row.Fsk18==1}checked="checked"{/if} />{#Yes#}</label>
    <label><input type="radio" name="Fsk18" value="0" {if $row.Fsk18==0}checked="checked"{/if}  />{#No#}</label>	 
    </td>
    </tr>
<tr>
    <td width="180" class="row_left">{#Shop_articles_descr#}</td>
    <td class="row_right">
	{$text}
	 </td>
    </tr>
  <tr>
    <td width="180" class="row_left">{#Shop_articles_descr2#}</td>
    <td class="row_right">{$text2}</td>
    </tr>


  <tr>
 <td width="180" class="row_left">{#Shop_articles_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">{#Shop_articles_startpage#}</td>
    <td class="row_right"><label><input type="radio" name="Startseite" value="1" checked="checked" />{#Yes#}</label>
    <label><input type="radio" name="Startseite" value="0"  />{#No#}</label>	</td>
  </tr>
</table>



</div>

<br />
<div id="pricing_details">
<div class="header">{#Shop_articles_edit_pricing#}</div>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_priceinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_price#}</td>
    <td class="row_right"><input class="input" style="width:100px" name="Preis_Liste" type="text" id="Preis_Liste" value="99.00" /></td>
    </tr>
  <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_price_offerinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_price_offer#}</td>
    <td class="row_right"><input class="input" style="width:100px" name="Preis" type="text" id="Preis" value="0.00" />      </td>
    </tr>
  <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_price_offerinf2} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_price_offertill#}</td>
    <td class="row_right">
    <input class="input" id="dateinput" name="Preis_Liste_Gueltig" style="width:100px" type="text" maxlength="10" value="" readonly="readonly" />  
    </td>
    </tr>
  <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_categInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_categ#}</td>
    <td class="row_right">
	<select class="input" style="width:200px" name="Kategorie">
	{foreach from=$shop_search_small_categs item=scs}
	<option {if $scs->bold==1}class="shop_selector_back"{else}class="shop_selector_subs"{/if} value="{$scs->catid}" {if $row.Kategorie==$scs->catid}selected="selected" {/if}>{$scs->visible_title|specialchars}</option>
	{/foreach}
	</select>	</td>
    </tr>
  <tr>
    <td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_categsInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_categs#}</td>
    <td class="row_right">
	<select name="Kategorie_Multi[]" size="8" multiple="multiple" class="input" style="width:200px">
	{foreach from=$shop_search_small_categs item=scs}
	<option {if $scs->bold==1}class="shop_selector_back"{else}class="shop_selector_subs"{/if} value="{$scs->catid}">{$scs->visible_title|specialchars}</option>
	{/foreach}
	</select>	</td>
    </tr>
  <tr>
    <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_weightInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />  {#Shop_articles_art_weight#}</td>
    <td class="row_right"><input class="input" style="width:100px" name="Gewicht" type="text" value="100" />&nbsp;{#Shop_articles_art_wunit#}</td>
  </tr>
 <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_weightRawInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />  {#Shop_articles_art_weightRaw#}</td>
     <td class="row_right"><input class="input" style="width:100px" name="Gewicht_Ohne" type="text" value="0" />&nbsp;{#Shop_articles_art_wunit#}</td>
   </tr>
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_artHBLCInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_HBL#}</td>
     <td class="row_right"><input class="input" style="width:100px" name="Abmessungen" type="text" value="" />&nbsp;{#Shop_articles_artHBLC#}</td>
   </tr>
   <tr>
<td width="180" class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_manufacturerInf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Manufacturer#}</td>
<td class="row_right">
<select class="input" style="width:200px" name="Hersteller" id="Hersteller">
<option value="0"></option>
{foreach from=$manufaturer item=m}
<option value="{$m->Id}" {if $m->Id==$row.Hersteller}selected="selected"{/if} >{$m->Name|stripslashes}</option>
{/foreach}
</select></td>
</tr>

   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_counts_unitinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_counts_unit#}</td>
     <td class="row_right">
	 <input class="input" style="width:50px" name="EinheitCount" type="text" value="0.00" />
	 <select name="EinheitId" class="input" style="width:143px" >
	 <option value=""></option>
	 {foreach from=$units item=u}
	 <option value="{$u.Id}" {if $u.Id==$row.EinheitId}selected="selected" {/if}>{$u.Name|stripslashes} ({$u.Mz|stripslashes})</option>
	 {/foreach}
	 </select>	 </td>
   </tr>
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_onstoreinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_onstore#}</td>
     <td class="row_right"><input class="input" style="width:100px" name="Lagerbestand" id="ls" type="text" value="1000" /></td>
   </tr>
   <tr>
     <td class="row_left">
     <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_edit_readyforshippinginf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
     {#Shop_articles_edit_readyforshipping#}</td>
     <td class="row_right">
     
     <select class="input" style="width:350px" name="Lieferzeit">
	{foreach from=$shipping_time item=st}
	<option value="{$st->Id}" {if $st->Id==$row.Lieferzeit}selected="selected"{/if} >{$st->Name|stripslashes}</option>
	{/foreach}
	</select>     </td>
   </tr>
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_availabilityinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_availability#}</td>
     <td class="row_right">
	 <select class="input" style="width:350px" onchange="if(this.options[this.selectedIndex].value=='2') {ldelim}document.getElementById('ls').value='0';document.getElementById('Bestellt').checked=true;document.getElementById('Bestellt').disabled=false{rdelim}else{ldelim}document.getElementById('Bestellt').checked=false;document.getElementById('Bestellt').disabled=true{rdelim}" name="Verfuegbar">
	{foreach from=$available item=av}
	<option id="s_{$av.Id}" value="{$av.Id}" {if $av.Id==1}selected="selected"{/if} >{$av.Name|stripslashes}</option>
	{/foreach}
	</select>
	 <label><input name="Bestellt" type="checkbox" id="Bestellt" value="1" onclick="if(document.getElementById('Bestellt').checked==true){ldelim}document.getElementById('s_2').selected=true;document.getElementById('ls').value='0'{rdelim}" {if $row.Bestellt=='1'}checked="checked"{/if} />{#Shop_articles_edit_isordered#}</label>  
     <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_edit_isorderedinf} class="absmiddle" src="{$imgpath}/help.png" alt="" />        </td>
   </tr>
   
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_ordermininf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_ordermin#}</td>
     <td class="row_right"><input class="input" style="width:100px" name="MinBestellung" type="text" value="0" /></td>
   </tr>
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_ordermaxinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_ordermax#}</td>
     <td class="row_right"><input class="input" style="width:100px" name="MaxBestellung" type="text" value="0" /></td>
   </tr>
   
   <tr>
     <td class="row_left"><img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_articles_art_onceorderinf} class="absmiddle" src="{$imgpath}/help.png" alt="" /> {#Shop_articles_art_onceorder#}</td>
     <td class="row_right">
	 <label><input type="radio" name="EinzelBestellung" value="1" />{#Yes#}</label>
     <label><input type="radio" name="EinzelBestellung" value="0" checked="checked" />{#No#}</label></td>
   </tr>
</table>
</div>

<br />
<div id="images">
<div class="header">{#Shop_articles_edit_images#}</div>
<div class="__edit_body">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  
  <tr>
    <td width="180" class="row_left">{#Image#}</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/','1','200');" value="{#Global_Upload#}" />
   <input type="hidden" name="newImg_1" id="newFile_1" />
   <!-- Uploadform -->   
    </td>
  </tr>
  
  <tr>
    <td width="180" class="row_left">{#Shop_articles_edit_moreimages_upload#}</td>
    <td class="row_right">
	{section name=loooo loop=5}
<input style="margin-bottom:1px" type="file" name="files[]" /><br />
{/section}	</td>
  </tr>
</table>

</div>
</div>


<input class="button big" type="submit" value="{#Save#}" />
<input type="hidden" name="new" value="1" />
<input type="hidden" name="closeafter" value="{$smarty.request.closeafter}" />
</form>
</div>


<script language="javascript" src="{$jspath}/calendar.js" type="text/javascript"></script>
<style type="text/css" media="screen,projection">
@import url({$csspath}/calendar.css);
</style>


<script type="text/javascript">
	jQuery(function($){ldelim}
	$.datepicker.setDefaults({ldelim}
	{include file="$incpath/other/calendar.conf.tpl"}
	{rdelim}); 
	$("#dateinput").attachDatepicker();
	{rdelim});
</script>
 