
<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)
{
	var width = document.getElementById('Avatar_B').value;
	if(width<10 || width>200)
	{
		alert('{/literal}{#Groups_AvatarError#}{literal}');
		document.getElementById('Avatar_B').focus();
		return false;
	}
		
	$("#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=groups&sub=iconupload&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(
	{ // validate
	rules: {
				Name: {required: true},
				Name_Intern: {required: true},
				Rabatt: {required: true, range:[0,99]},
				MaxPn: {required: true, range:[0,500]},
				MaxPn_Zeichen: {required: true, range:[250,5000]},
				Signatur_Laenge: {required: true, range:[50,500]},
				MaxZeichenPost: {required: true, range:[500,15000]},
				MaxAnlagen: {required: true, range:[0,10]},
				Avatar_B: {required: true, range:[50,200]},
				Avatar_H: {required: true, range:[50,200]}
			},
			messages: 
			{
				//
			}
	}
	);
}
);
// -->
</script>
{/literal}


<div class="popbox">
<form action="" method="post" name="editform" id="editform">
<div class="header">{#Groups_Edit#}</div>

<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="200" class="row_left">{#Global_Name#}</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">{#Groups_NameIntern#}</td>
    <td class="row_right"><input class="input" style="width:150px" name="Name_Intern" type="text" value="{$res->Name_Intern|koobispecialchars}"></td>
  </tr>
  
  <tr>
    <td colspan="2" class="headers">{#Groups_ShopSettings#} {if $ispro==1}{/if}</td>
    </tr>
  
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Groups_ShopDedInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Groups_ShopDed#}</td>
    <td class="row_right"><input class="input" name="Rabatt" type="text" value="{$res->Rabatt}" size="4" maxlength="5">%</td>
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Groups_ShopDispInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    {#Groups_ShopDisp#}</td>
    <td class="row_right">

    <select class="input" name="ShopAnzeige">
     <option value="b2c" {if $res->ShopAnzeige=='b2c'}selected="selected"{/if}>Brutto-Anzeige / B2C (Standard)</option>
   	 <option value="b2b" {if $res->ShopAnzeige=='b2b'}selected="selected"{/if}>Netto-Anzeige / B2B</option>
    </select>
 
    </td>
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Groups_TakeVatInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />   
    {#Groups_TakeVat#}</td>
    <td class="row_right">
    
    <select class="input" name="VatByCountry">
     <option value="1" {if $res->VatByCountry=='1'}selected="selected"{/if}>{#Yes#} ({#Global_Std#})</option>
   	 <option value="2" {if $res->VatByCountry=='2'}selected="selected"{/if}>{#No#}</option>
    </select>    </td>
  </tr>
  {if $smarty.request.id!=2}
 <tr>
    <td colspan="2" class="headers">{#Groups_PN#}</td>
   </tr>
  <tr>
    <td class="row_left">{#Groups_MaxPn#}</td>
    <td class="row_right"><input class="input" name="MaxPn" type="text" id="MaxPn" value="{$res->MaxPn}" size="4" maxlength="4"></td>
  </tr>
  <tr>
    <td class="row_left">{#Groups_MaxC#}</td>
    <td class="row_right"><input class="input" name="MaxPn_Zeichen" type="text" value="{$res->MaxPn_Zeichen}" size="4" maxlength="5"></td>
  </tr>
   <tr>
    <td colspan="2" class="headers">{#Groups_Sig#}</td>
   </tr>
   <tr>
     <td class="row_left">{#Groups_SigAllow#}</td>
     <td class="row_right">
    <label><input type="radio" name="Signatur_Erlaubt" value="1" {if $res->Signatur_Erlaubt=='1'}checked="checked"{/if} />{#Yes#}</label>
    <label><input type="radio" name="Signatur_Erlaubt" value="0" {if $res->Signatur_Erlaubt=='0'}checked="checked"{/if} />{#No#}</label> </td>
   </tr>
    <tr>
     <td class="row_left">{#Groups_Koobicode#}</td>
     <td class="row_right">
    <label><input type="radio" name="KoobiCode_Signatur" value="1" {if $res->KoobiCode_Signatur=='1'}checked="checked"{/if} />{#Yes#}</label>
    <label><input type="radio" name="KoobiCode_Signatur" value="0" {if $res->KoobiCode_Signatur=='0'}checked="checked"{/if} />{#No#}</label> </td>
   </tr>
   <tr>
    <td class="row_left">{#Groups_MaxC#}</td>
    <td class="row_right"><input class="input" name="Signatur_Laenge" type="text" value="{$res->Signatur_Laenge}" size="4" maxlength="5"></td>
  </tr>
  {/if}
  
  
     <tr>
    <td colspan="2" class="headers">{#Groups_PostF#}</td>
   </tr>
   <tr>
     <td class="row_left">{#Groups_MaxC#}</td>
     <td class="row_right">
    <input class="input" name="MaxZeichenPost" type="text" value="{$res->MaxZeichenPost}" size="4" maxlength="5"> </td>
   </tr>
    <tr>
     <td class="row_left">{#Groups_MaxAttach#}</td>
     <td class="row_right">
    <input class="input" name="MaxAnlagen" type="text" value="{$res->MaxAnlagen}" size="4" maxlength="2"> </td>
   </tr>
  
   {if $smarty.request.id!=2}
  <tr>
    <td colspan="2" class="headers">{#Groups_Avatar#}</td>
   </tr>
   {if $avatar}
    <tr>
     <td class="row_left">{#Groups_AvatarCurrent#}</td>
     <td class="row_right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td width="150">{$avatar}</td>
         <td><input name="Avdel" type="checkbox" id="Avdel" value="1" />
           Avatar l&ouml;schen</td>
       </tr>
     </table></td>
    </tr>
   {/if}
   <tr>
     <td class="row_left">{#Groups_AvatarNew#}</td>
     <td class="row_right">
     {if $not_writable==1}
    {#Groups_AvDirNw#}
     {else}
      <!-- 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/avatars/default/','2',document.getElementById('Avatar_B').value);" value="{#Global_Upload#}" />
   <input type="hidden" name="newImg_2" id="newFile_2" />
   <!-- Uploadform -->  
   {/if} 
     </td>
   </tr>
    <tr>
     <td class="row_left">{#Groups_MaxWidth#}</td>
     <td class="row_right">
    <input class="input" name="Avatar_B" id="Avatar_B" type="text" value="{$res->Avatar_B}" size="4" maxlength="3">    </td>
   </tr>
    <tr>
      <td class="row_left">{#Groups_MaxHeight#}</td>
      <td class="row_right">
      <input class="input" name="Avatar_H" type="text" value="{$res->Avatar_H}" size="4" maxlength="3">      </td>
    </tr>
    <tr>
      <td class="row_left">{#Groups_SetDefault#}</td>
      <td class="row_right">
      
    <label><input type="radio" name="Avatar_Default" value="1" {if $res->Avatar_Default=='1'}checked="checked"{/if} />{#Yes#}</label>
    <label><input type="radio" name="Avatar_Default" value="0" {if $res->Avatar_Default=='0'}checked="checked"{/if} />{#No#}</label> 
      </td>
    </tr>
    {/if}
  </table>
  <input type="submit" value="{#Save#}" class="button big">
<input type="button" class="button big" value="{#Close#}" onclick="window.close()" />
<input name="save" type="hidden" value="1" />
</form>

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