<?xml version='1.0'?>
<!DOCTYPE var:component>
<var:component
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:var="http://www.skyrix.com/od/binding"
  xmlns:const="http://www.skyrix.com/od/constant"
  xmlns:uix="OGo:uix"
  xmlns:label="OGo:label"
  className="UIxPageFrame"
  title="name"
  const:userDefaultsKeys="SOGoContactsCategories"
  const:popup="YES"
  >
  <div class="menu" id="categoriesMenu">
  </div>

  <form var:href="saveURL" name="editform" id="mainForm">
    <var:if condition="isNew"><div id="addressBookSelector">
        <style type="text/css">DIV#editorTabs { top: 30px; };</style>
        <var:string label:value="Add to:" />
        <var:popup const:id="addressBooksList"
          list="addressBooksList" item="addressBookItem"
          string="addressBookDisplayName"
          var:selection="componentAddressBook"
          />
      </div></var:if>

    <div class="tabsContainer" id="editorTabs">
      <ul>
        <li target="baseInfos">
          <span><var:string label:value="Contact" /></span>
        </li>
        <var:if condition="supportCategories"
          ><li target="categoryInfos">
            <span><var:string label:value="Categories" /></span></li
            ></var:if>
        <li target="addressesInfos">
          <span><var:string label:value="Address" /></span></li>
        <var:if condition="supportPhotos"
          ><li target="photos">
            <span><var:string label:value="Photos" /></span></li
            ></var:if>
        <li target="otherInfos">
          <span><var:string label:value="Other" /></span></li>
      </ul>
      <div class="tabs">
        <div id="baseInfos" class="tab">
          <span class="caption"><var:string label:value="Name" /></span>
          <table class="frame">
            <tr>
              <td>
                <label><var:string label:value="First:" />
                  <input type="text" class="textField" name="givenname"
                    id="givenname"
                    var:value="ldifRecord.givenname"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Last:" />
                  <input type="text" class="textField" name="sn" id="sn"
                    var:value="ldifRecord.sn"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Display:" />
                  <input type="text" class="textField" name="displayname" id="displayname"
                    var:value="ldifRecord.displayname"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Nickname:" />
                  <input type="text" class="textField" name="mozillanickname" id="mozillanickname"
                    var:value="ldifRecord.mozillanickname"
                    /></label>
              </td>
            </tr>
          </table>
          <span class="caption"><var:string label:value="Internet" /></span>
          <table class="frame" id="emailInfos">
            <tr>
              <td>
                <label><var:string label:value="Email:" />
                  <input type="text" class="textField" name="mail" id="mail"
                    var:value="ldifRecord.mail"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Additional Email:" />
                  <input type="text" class="textField" name="mozillasecondemail"
                    id="mozillasecondemail" var:value="ldifRecord.mozillasecondemail"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Screen Name:"
                    />
                  <input type="text" class="textField" name="nsaimid"
                    id="nsaimid" var:value="ldifRecord.nsaimid"
                    /></label>
              </td>
            </tr> 
            <tr>
              <td id="htmlMailFormat">
                <label><var:string
                    label:value="Prefers to receive messages formatted as:" />
                  <var:popup list="htmlMailFormatList" item="item"
                    label:noSelectionString="htmlMailFormat_UNKNOWN"
                    string="itemHtmlMailFormatText"
                    selection="ldifRecord.mozillausehtmlmail"
                   /></label>
              </td>
            </tr>
          </table>
          <span class="caption"><var:string label:value="Phones" /></span>
          <table class="frame">
            <tr>
              <td>
                <label><var:string label:value="Work:" />
                  <input type="text" class="textField"
                    name="telephonenumber"
                    id="telephonenumber"
                    var:value="ldifRecord.telephonenumber"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Home:" />
                  <input type="text" class="textField"
                    name="homephone" id="homephone"
                    var:value="ldifRecord.homephone"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Fax:" />
                  <input type="text" class="textField"
                    name="facsimiletelephonenumber"
                    id="facsimiletelephonenumber"
                    var:value="ldifRecord.facsimiletelephonenumber"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Pager:" />
                  <input type="text" class="textField"
                    name="pager"
                    id="pager"
                    var:value="ldifRecord.pager"
                    /></label>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Mobile:" />
                  <input type="text" class="textField" name="mobile" id="mobile"
                    var:value="ldifRecord.mobile"
                    /></label>
              </td>
            </tr>
          </table>
        </div>

        <var:if condition="supportCategories"
          ><div id="categoryInfos" class="tab">
            <div id="categoryContainer">
            </div>
            <var:if condition="canCreateOrModify"
              ><input type="text" class="textField" id="emptyCategory"
                const:readonly="readonly"
                const:name="emptyCategory"
              const:value="" /></var:if>
            <script type="text/javascript">
              var gCategories = <var:string value="contactCategoriesList" const:escapeHTML="NO"/>;
            </script>
          <input type="hidden" id="jsonContactCategories"
              const:name="jsonContactCategories"
              var:value="jsonContactCategories" />
          </div></var:if>

        <div id="addressesInfos" class="tab">
          <span class="caption"><var:string label:value="Home" /></span>
          <table class="frame">
            <tr>
              <td colspan="2">
                <label><var:string label:value="Address:" />
                  <input type="text" class="textField" name="mozillahomestreet"
                    id="mozillahomestreet"
                    var:value="ldifRecord.mozillahomestreet"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label>
                  <input type="text" class="textField" namCe="mozillahomestreet2"
                    id="mozillahomestreet2"
                    var:value="ldifRecord.mozillahomestreet2"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="City:" />
                  <input type="text" class="textField" name="mozillahomelocalityname"
                    id="mozillahomelocalityname"
                    var:value="ldifRecord.mozillahomelocalityname"
                    /></label>
              </td>
            </tr>
            <tr>
              <td class="firstColumn">
                <label><var:string label:value="State_Province:" />
                  <input type="text" class="textField" name="mozillahomestate"
                    id="mozillahomestate"
                    var:value="ldifRecord.mozillahomestate"
                    /></label>
              </td>
              <td class="secondColumn">
                <label><var:string
                    label:value="ZIP_Postal Code:"
                    />
                  <input type="text" class="textField" name="mozillahomepostalcode"
                    id="mozillahomepostalcode"
                    var:value="ldifRecord.mozillahomepostalcode"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="Country:" />
                  <input type="text" class="textField" name="mozillahomecountryname"
                    id="mozillahomecountryname"
                    var:value="ldifRecord.mozillahomecountryname"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label>
                  <var:string label:value="Web Page:" />
                  <input type="text" class="textField" name="mozillahomeurl"
                    var:value="ldifRecord.mozillahomeurl"
                    /></label>
              </td>
            </tr>
          </table> 
          <span class="caption"><var:string label:value="Work" /></span>
          <table class="frame">
            <tr>
              <td colspan="2">
                <label>
                  <var:string label:value="Title:" />
                  <input type="text" class="textField" name="title"
                    id="title"
                    var:value="ldifRecord.title"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label>
                  <var:string label:value="Department:" />
                  <input type="text" class="textField" name="ou"
                    id="ou"
                    var:value="ldifRecord.ou"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="Organization:" />
                  <input type="text" class="textField" name="o"
                    id="o" var:value="ldifRecord.o"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="Address:" />
                  <input type="text" class="textField" name="street"
                    id="street"
                    var:value="ldifRecord.street"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label>
                  <input type="text" class="textField" name="mozillaworkstreet2"
                    id="mozillaworkstreet2" var:value="ldifRecord.mozillaworkstreet2"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="City:" />
                  <input type="text" class="textField" name="l"
                    id="l" var:value="ldifRecord.l"
                    /></label>
              </td>
            </tr>
            <tr>
              <td class="firstColumn">
                <label><var:string label:value="State_Province:" />
                  <input type="text" class="textField" name="st"
                    id="st" var:value="ldifRecord.st"
                    /></label>
              </td>
              <td class="secondColumn">
                <label><var:string
                    label:value="ZIP_Postal Code:"
                    />
                  <input type="text" class="textField" name="postalcode"
                    id="postalcode" var:value="ldifRecord.postalcode"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="Country:" />
                  <input type="text" class="textField" name="c"
                    id="c" var:value="ldifRecord.c"
                    /></label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <label><var:string label:value="Web Page:" />
                  <input type="text" class="textField" name="mozillaworkurl"
                    var:value="ldifRecord.mozillaworkurl"
                    /></label>
              </td>
            </tr>
          </table>
        </div>

        <var:if condition="supportPhotos"
          ><div id="photos" class="tab">
            <var:if condition="hasPhoto"
              ><img var:src="photoURL" class="contactPhoto"
                /></var:if>
          </div
            ></var:if>

        <div id="otherInfos" class="tab">
          <table class="framenocaption">
            <tr>
              <td>
                <label><var:string label:value="Birthday (yyyy-mm-dd):"/>
                  <input type="text" class="textField" name="birthyear" id="birthyear"
                    var:value="ldifRecord.birthyear"
                    /></label>
                  -
                  <input type="text" class="textField" name="birthmonth" id="birthmonth"
                    var:value="ldifRecord.birthmonth" />
                  -
                  <input type="text" class="textField" name="birthday" id="birthday"
                    var:value="ldifRecord.birthday"/>
              </td>
            </tr>
            <tr>
              <td>
                <label><var:string label:value="Note:" />
                  <textarea var:value="ldifRecord.description" name="note" id="note"></textarea>
                </label>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div id="buttons">
      <var:if condition="canCreateOrModify"
        ><a class="button actionButton" name="submit" id="submitButton"> 
          <span><var:string label:value="Save" /></span>
        </a></var:if>
      <a id="cancelButton" class="button" name="cancel">
        <span><var:string label:value="Cancel"/></span>
      </a>
    </div>
  </form>
</var:component>
