{if $mode eq "new"}
  {include file="$gentemplates/_header.tpl" pagetitle="$createnewcontact"}
  {include file="$gentemplates/_navi.tpl" pagetitle="$createnewcontact"}
  <form name="f1" action="index.php" method="POST">
  <input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">			
  <input type="hidden" name="op" value="create">			
  <input type="hidden" name="npage" value="{$npage}">			
  <input type="hidden" name="list" value="{$list}">			
  <input type="hidden" name="searchterm" value="{$searchterm}">			
{else}
  {include file="$gentemplates/_header.tpl" pagetitle="$editcontact"}
  {include file="$gentemplates/_navi.tpl" pagetitle="$editcontact"}
  <form name="f1" action="index.php" method="POST">
  <input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">			
  <input type="hidden" name="id" value="{$itemid}">
  <input type="hidden" name="op" value="edit">
  <input type="hidden" name="npage" value="{$npage}">			
  <input type="hidden" name="list" value="{$list}">			
  <input type="hidden" name="searchterm" value="{$searchterm}">			
{/if}
	
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr><td class="lines2" height="2" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="2"></td></tr>
  <tr align="left">
    <td class="tab" height="20" width="20"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="tab" width="150">&nbsp;</td>
    <td class="tab">&nbsp;</td>
  </tr>

  <tr><td class="lines2" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$titletext} / {$honpref}</td>
    <td class="formhead">{$title|smarty:nodefaults}&nbsp;&nbsp;<input type="text" name="honpref" size="7" maxlength="20" value="{$td.honorific_prefix|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$lastname} / {$namesuffix}</td>
    <td class="formhead"><input type="text" name="lastname" size="30" maxlength="100" value="{$td.lastname|escape:"html"}">&nbsp;&nbsp;<input type="text" name="namesuffix" size="7" maxlength="20" value="{$td.name_suffix|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$addname}</td>
    <td class="formhead"><input type="text" name="addname" size="30" maxlength="100" value="{$td.name_add|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$firstname}</td>
    <td class="formhead"><input type="text" name="firstname" size="30" maxlength="100" value="{$td.firstname|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$nickname}</td>
    <td class="formhead"><input type="text" name="nickname" size="30" maxlength="100" value="{$td.nickname|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$occupation}</td>
    <td class="formhead"><input type="text" name="function" size="30" value="{$td.function|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$atcompany}</td>
    <td class="formhead">{$companysb|smarty:nodefaults}<br />
      {$hashmap.enternewcompany}<br />
      <input type="text" size="30" name="newcomp" onchange="document.f1._company.selectedIndex=0" /></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$group}</td>
    <td class="formhead">{$groupsb|smarty:nodefaults}</td>
  </tr>

  <tr><td class="lines2" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>

  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$email}</td>
    <td class="formhead"><input type="text" name="email" size="30" maxlength="100" value="{$td.email|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$email} 2</td>
    <td class="formhead"><input type="text" name="email2" size="30" maxlength="100" value="{$td.email2|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$email} 3</td>
    <td class="formhead"><input type="text" name="email3" size="30" maxlength="100" value="{$td.email3|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$phone_company}</td>
    <td class="formhead"><input type="text" name="telefon_firma" size="30" maxlength="100" value="{$td.tel_company|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$phone_privat}</td>
    <td class="formhead"><input type="text" name="telefon_privat" size="30" maxlength="100" value="{$td.priv_telefon|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$phone_mobile}</td>
    <td class="formhead"><input type="text" name="telefon_mobil" size="30" maxlength="100" value="{$td.tel_mobile|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$fax}</td>
    <td class="formhead"><input type="text" name="telefax" size="30" maxlength="100" value="{$td.priv_fax|escape:"html"}"></td>
  </tr>

  <tr><td class="lines2" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>

  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_street}</td>
    <td class="formhead"><input type="text" name="priv_strasse" size="30" maxlength="100" value="{$td.priv_street|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_additional}</td>
    <td class="formhead"><input type="text" name="priv_zusatz" size="30" maxlength="100" value="{$td.priv_additional|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_zip_city}</td>
    <td class="formhead"><input type="text" name="priv_plz" size="10" maxlength="20" value="{$td.priv_zip|escape:"html"}"> <input type="text" name="priv_ort" size="20" maxlength="100" value="{$td.priv_city|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_region}</td>
    <td class="formhead"><input type="text" name="priv_region" size="30" maxlength="100" value="{$td.priv_region|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_state}</td>
    <td class="formhead"><input type="text" name="priv_state" size="30" maxlength="100" value="{$td.priv_state|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$priv_country}</td>
    <td class="formhead">{$countrysb|smarty:nodefaults}</td>
  </tr>

  <tr><td class="lines2" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>

  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$birthday}</td>
    <td class="formhead">&nbsp;<br><input type="checkbox" name="setbirthday" value="1" {$setbirthday} />&nbsp;{mgw_html_select_date prefix=birthday start_year=-80 time=$td.birthday}&nbsp;{datepick form="f1" field="birthdayYear,birthdayMonth,birthdayDay"}<br>&nbsp;</td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$url}</td>
    <td class="formhead"><input type="text" name="url" size="40" maxlength="100" value="{$myurl|escape:"html"}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$note}</td>
    <td class="formhead">&nbsp;<br><textarea name="bemerkung" cols="50" rows="8">{$td.note}</textarea><br>&nbsp;</td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$publickey}</td>
    <td class="formhead">&nbsp;<br><textarea name="pubkey" cols="50" rows="4" wrap="none">{$td.publicKey}</textarea><br>&nbsp;</td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$public}</td>
    <td class="formhead"><input type="radio" name="public" value="1"{$pubcheckedyes}>{$yes}<br><input type="radio" name="public" value="0"{$pubcheckedno}>{$no}</td>
  </tr>
  
  <tr><td class="lines2" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">&nbsp;</td>
    <td class="formhead"><input type="submit" name="{$suname}" value="{if $mode eq "new"}{$create}{else}{$edit}{/if}" class="{$suclass}"></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
</table>
</form>

{include file="$gentemplates/_footer.tpl" aktUser=$username}
