

<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;
		//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&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,minLength: 2},
				Versanddauer: {required: true,minLength: 1},
				'Laender[]':{required: true},
				'Gruppen[]':{required: true},
				'Versandarten[]':{required: true}
			},
			messages: 
			{
				'Laender[]':{required:{/literal}'{#Shop_shipper_NoGC#}'{literal}},
				'Gruppen[]':{required:{/literal}'{#Shop_shipper_NoGI#}'{literal}},
				'Versandarten[]':{required:{/literal}'{#Shop_payment_SM#}'{literal}}
			}
	}
	);
}
)
// -->
</script>
{/literal}
<div class="popbox">

<div class="header">{#Shop_payment_edit#}: {$row->Name|koobispecialchars}</div>
<div class="header_inf">
<form method="post" action="">
<select class="input" onchange="eval(this.options[this.selectedIndex].value);" name="langcode" id="langcode">


<option id="l_1" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=shop&sub=editpaymentmethod&Id={$smarty.request.Id}&lc=1&noframes=1';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.lc}').selected=true;{rdelim}" {if $smarty.request.lc=='1'}selected="selected"{/if}>{#Shop_payment_editin#}  - {$language_long_1|upper} - {#Shop_articles_editinb#}</option>
<option id="l_2" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=shop&sub=editpaymentmethod&Id={$smarty.request.Id}&lc=2&noframes=1';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.lc}').selected=true;{rdelim}" {if $smarty.request.lc=='2'}selected="selected"{/if}>{#Shop_payment_editin#}  - {$language_long_2|upper} - {#Shop_articles_editinb#}</option>
<option id="l_3" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=shop&sub=editpaymentmethod&Id={$smarty.request.Id}&lc=3&noframes=1';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.lc}').selected=true;{rdelim}"  {if $smarty.request.lc=='3'}selected="selected"{/if}>{#Shop_payment_editin#}  - {$language_long_3|upper} - {#Shop_articles_editinb#}</option>

</select>
<img class="absmiddle" src="{$imgpath}/arrow_right.png" alt="" />
</form>
</div>
<form method="post" action="" name="editForm" id="editForm" enctype="multipart/form-data">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
{if $smarty.request.lc == 1}
 <tr>
    <td width="180"  class="row_left">{#SavDataAllLangsT#}</td>
    <td class="row_right"><label><input type="checkbox" name="saveAllLang" value="1" />{#SavDataAllLangs#}</label></td>
  </tr>
  {/if}
<tr>
<td width="180" class="row_left">{#Global_Name#}</td>
<td class="row_right"><input style="width:200px" name="Name" type="text" class="input" id="Name" value="{$row->Name|koobispecialchars}"></td>
</tr>

<tr>
  <td width="180" class="row_left">
  {#Shop_payment_pd#}  </td>
  <td class="row_right">{$intro}</td>
</tr>
<tr>
  <td width="180" class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_pdLongInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_pdLong#}  </td>
  <td class="row_right">{$text}</td>
</tr>
{if $smarty.request.lc<2}
<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_pInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_p#}</td>
  <td class="row_right">{$payinf}</td>
</tr>
{if $row->Icon}
<tr>
  <td class="row_left">{#Shop_payment_Img#}</td>
  <td class="row_right">
  
  <img src="../uploads/shop/payment_icons/{$row->Icon}" alt="" border="0" />
  <input type="hidden" name="IconDelOld" value="{$row->Icon}" />
  <hr noshade size="1" />
  <label><input type="checkbox" name="IconDel" value="1"> {#Shop_payment_dImg#}</label>  </td>
</tr>
{/if}
<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_ImgInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_nImg#}</td>
  <td class="row_right">
  {if $writable==1}
  <!-- 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/payment_icons/','1','0');" value="{#Global_Upload#}" />
   <input type="hidden" name="newImg_1" id="newFile_1" />
   <!-- Uploadform -->  
   {else}
   {#Shop_payment_NW#}
   {/if}  </td>
</tr>
<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_aCInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_aC#}  </td>
  <td class="row_right">
  <select name="Laender[]" size="8" multiple class="input" id="Laender" style="width:200px">
  {foreach from=$countries item=c}
    <option value="{$c->Code}" {if in_array($c->Code,$countries_in)}selected="selected"{/if}>{$c->Name|koobispecialchars}</option>
  {/foreach}
  </select>  </td>
</tr>
<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_aGInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_aG#}  </td>
  <td class="row_right">
    <select name="Gruppen[]" size="8" multiple class="input" id="Gruppen" style="width:200px">
  {foreach from=$groups item=g}
    <option value="{$g->Id}" {if in_array($g->Id,$groups_in)}selected="selected"{/if}>{$g->Name_Intern|koobispecialchars}</option>
  {/foreach}
  </select>  </td>
</tr>
<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_aSInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_aS#}  </td>
  <td class="row_right">
  <select name="Versandarten[]" size="8" multiple class="input" id="Versandarten" style="width:200px">
  {foreach from=$shipper item=s}
    <option value="{$s->Id}" {if in_array($s->Id,$shipper_in)}selected="selected"{/if}>{$s->Name|koobispecialchars}</option>
  {/foreach}
  </select>  </td>
</tr>

<tr>
  <td class="row_left">
  <img {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Shop_payment_RZInf} class="absmiddle" src="{$imgpath}/help.png" alt="" />
  {#Shop_payment_RZ#}  </td>
  <td class="row_right">
  <select class="input" name="KostenOperant" id="KostenOperant">
    <option value="+" {if $row->KostenOperant=='+'}selected="selected"{/if}>{#Shop_payment_ZZ#}</option>
    <option value="-" {if $row->KostenOperant=='-'}selected="selected"{/if}>{#Shop_payment_AZ#}</option>
  </select>
  <input style="width:50px" name="Kosten" type="text" class="input" value="{$row->Kosten}">
  <select class="input" name="KostenTyp">
  <option value="pro" {if $row->KostenTyp=='pro'}selected="selected"{/if}>{#Shop_payment_PR#}</option>
  <option value="wert" {if $row->KostenTyp=='wert'}selected="selected"{/if}>{#Shop_payment_WE#}</option>
  </select>  </td>
</tr>

{if $smarty.request.Id==1 || $smarty.request.Id==2 || $smarty.request.Id==4 || $smarty.request.Id==7 || ($row->ZTyp=='Eigen')}
{else}
<tr>
  <td class="row_left">{#Shop_payment_BZ#}</td>
  <td class="row_right"><input style="width:200px" name="Betreff" type="text" class="input" value="{$row->Betreff|koobispecialchars}"></td>
</tr>
<tr>
  <td class="row_left">{#Shop_payment_TM#}</td>
  <td class="row_right"><input style="width:200px" name="Testmodus" type="text" class="input" value="{$row->Testmodus|koobispecialchars}"></td>
</tr>
<tr>
  <td class="row_left">{#Shop_payment_II#}</td>
  <td class="row_right"><input style="width:200px" name="Install_Id" type="text" class="input" value="{$row->Install_Id|koobispecialchars}"></td>
</tr>
{/if}
{/if}
</table>
<input type="submit" name="button" 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" />
<input name="lc" type="hidden"  value="{$smarty.request.lc}" />
</form>

</div>