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

$(document).ready(function() {
	var validator = $("#convert").validate(
	{ 
		rules: 
		{ 
			Vorname: {required: true},
			Nachname: {required: true},
			Benutzername: {required: true, remote: "index.php?do=user&sub=checkuserdata"},
			Strasse_Nr: {required: true},
			Postleitzahl: {required: true},
			Ort: {required: true},
			Kennwort: {required: true, minLength:5},
			Email: {required: true,email:true, remote: "index.php?do=user&sub=checkuserdata"}
		},
		messages: 
		{
			Email:{remote: jQuery.format("{/literal}{#Validate_usedMail#}{literal}")},
			Benutzername:{remote: jQuery.format("{/literal}{#Validate_usedUName#}{literal}")}
		},
			
		submitHandler: function() 
		{ 
			document.forms['convert'].submit();
		},
		
		success: function(label) 
		{
			label.html("&nbsp;").addClass("checked");
		}
	});
});

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

<form method="post" action="" name="convert" id="convert">
<div class="popbox">
<div class="header">{#User_convertGuestToUserT#}</div>
<div class="subheaders">{#User_convertGuestToUser#}</div>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td width="180" class="row_left">{#User_first#}</td>
    <td class="row_right"><input class="input" type="text" name="Vorname" value="{$res->Rng_Vorname}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_last#}</td>
    <td class="row_right"><input class="input" type="text" name="Nachname" value="{$res->Rng_Nachname}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_username#}</td>
    <td class="row_right"><input class="input" type="text" name="Benutzername" value="{$res->Rng_Vorname} {$res->Rng_Nachname|truncate:2:'.'}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_street#}</td>
    <td class="row_right"><input class="input" type="text" name="Strasse_Nr" value="{$res->Rng_Strasse}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_zip#}</td>
    <td class="row_right"><input class="input" type="text" name="Postleitzahl" value="{$res->Rng_Plz}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_town#}</td>
    <td class="row_right"><input class="input" type="text" name="Ort" value="{$res->Rng_Ort}"></td>
  </tr>

  <tr>
    <td class="row_left">{#User_phone#}</td>
    <td class="row_right"><input class="input" type="text" name="Telefon" value="{$res->Rng_Fon}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_fax#}</td>
    <td class="row_right"><input class="input" type="text" name="Telefax" value="{$res->Rng_Fax}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_company#}</td>
    <td class="row_right"><input class="input" type="text" name="Firma" value="{$res->Rng_Firma|koobispecialchars}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_ustid#}</td>
    <td class="row_right"><input class="input" type="text" name="UStId" value=""></td>
  </tr>
    <tr>
    <td class="row_left">{#User_email#}</td>
    <td class="row_right"><input class="input" type="text" name="Email" value="{$res->Rng_Email}"></td>
  </tr>
  <tr>
    <td class="row_left">{#User_ugroup#}</td>
    <td class="row_right">
    <select class="input" style="width:130px" name="Gruppe">
    {foreach from=$groups item=g}
    {if $g->Id!=2}<option value="{$g->Id}" {if $g->Id==3}selected="selected"{/if}>{$g->Name_Intern|koobispecialchars}</option>{/if}
    {/foreach}
    </select>    </td>
  </tr>
  <tr>
    <td class="row_left">{#User_ugroupmisc#}</td>
    <td class="row_right">
    <select name="GruppeMisc[]" size="5" multiple="multiple" class="input" style="width:130px">
    {foreach from=$groups item=g}
    {if $g->Id!=2 && $g->Id!=1}
     <option value="{$g->Id}" {if $g->Id==3}selected="selected"{/if}>{$g->Name_Intern|koobispecialchars}</option>{/if}
    {/foreach}
    </select>
    </td>
  </tr>
  <tr>
    <td class="row_left">
    <img {popup sticky=$config_vars.POPSTICKY   text=$config_vars.User_markteamI} class="absmiddle" src="{$imgpath}/help.png" alt="" />
    
    {#User_team#}</td>
    <td class="row_right">
    <label><input type="radio" name="team" value="1" />{#Yes#}</label>
    <label><input type="radio" name="team" value="0" checked="checked" />{#No#}</label>    </td>
  </tr>
  <tr>
    <td class="row_left">{#User_country#}</td>
    <td class="row_right">
    <select class="input" style="width:130px" name="Land">
    {foreach from=$countries item=c}
    <option value="{$c->Code|lower}" {if $c->Code|lower==$country_short|lower}selected="selected"{/if}>{$c->Name|koobispecialchars}</option>
    {/foreach}
    </select>    </td>
  </tr>
    <tr>
    <td class="row_left">{#User_pass#}</td>
    <td class="row_right"><input class="input" type="text" name="Kennwort" value="{$password}"></td>
  </tr>
    <tr>
      <td class="row_left">{#User_semail#}</td>
      <td class="row_right">
      <label><input name="send_mail" type="radio" id="send_mail" value="1" checked="checked" />{#Yes#}</label>
      <label><input type="radio" name="send_mail" value="0" />{#No#}</label>      </td>
    </tr>
    <tr>
      <td class="row_left">{#User_emailtext#}</td>
      <td class="row_right"><textarea name="mail_text" id="mail_text" class="input" style="width:300px; height:100px">{#Shop_convertGuestMail#}</textarea></td>
    </tr>
</table>
<input class="button big" type="submit" name="button" value="{#Save#}">
<input class="button big" type="button" name="button" onclick="window.close();" value="{#Close#}">
<input name="save" type="hidden" id="save" value="1" />
</div>
</form>
