<table class="vcard">
    <tbody class="n">
        <span class="fn" style="display: none;">{$address_info|address_long}</span>
        <tr {if $address_info_derived->name}class="infobluerow"{/if}>
            <td>{$i.addresses_name}</td>
            <td class="org {if empty($address_info->contact_person)}family-name{/if}">{$address_info->name}</td>
        </tr>
        <tr {if $address_info_derived->comp_supp}class="infobluerow"{/if}>
            <td>{$i.addresses_comp_supp}</td>
            <td>{$address_info->comp_supp}</td>
        </tr>

        <tr {if $address_info_derived->title}class="infobluerow"{/if}>
            <td>{$i.addresses_title}</td>
            <td>{$address_info->title}</td>
        </tr>
        <tr {if $address_info_derived->academic_title}class="infobluerow"{/if}>
            <td>{$i.addresses_academic_title}</td>
            <td>{$address_info->academic_title}</td>
        </tr>
        <tr {if $address_info_derived->first_name}class="infobluerow"{/if}>
            <td>{$i.addresses_first_name}</td>
            <td class="given-name">{$address_info->first_name}</td>
        </tr>
        <tr {if $address_info_derived->contact_person}class="infobluerow"{/if}>
            <td>{$i.addresses_contact_person}</td>
            <td {if !empty($address_info->contact_person)}class="family-name"{/if}>{$address_info->contact_person}</td>
        </tr>
        <tr {if $address_info_derived->master_title}class="infobluerow"{/if}>
            <td>{$i.addresses_master_title}</td>
            <td>{$address_info->master_title}</td>
        </tr>          
    </tbody>

    <tbody class="adr">
        <span class="type" style="display: none;">work</span>
        <tr {if $address_info_derived->street}class="infobluerow"{/if}>
            <td>{$i.addresses_street}</td>
            <td class="street-address">{$address_info->street}</td>
        </tr>
        <tr {if $address_info_derived->street2}class="infobluerow"{/if}>
            <td>{$i.addresses_street2}</td>
            <td class="street-address">{$address_info->street2}</td>
        </tr>        
        <tr {if $address_info_derived->zip_town}class="infobluerow"{/if}>
            <td>
                {$i.addresses_zip} / {$i.addresses_town}
            </td>
            <td><span class="postal-code">{$address_info->zip}</span> <span class="locality">{$address_info->town}</span></td>
        </tr>
        <tr {if $address_info_derived->country}class="infobluerow"{/if}>
            <td>{$i.addresses_country}</td>
            <td class="country-name">{$address_info->country}</td>
        </tr>
    </tbody>

    <tbody>
        <tr {if $address_info_derived->phone1}class="infobluerow"{/if}>
            <td>
                {$i.addresses_phone1}
            </td>
            <td class="tel">
                <span class="type" style="display: none;">work</span>
                <span class="value">
                {$address_info->phone1}
                </span>
            </td>
        </tr>
        <tr {if $address_info_derived->phone2}class="infobluerow"{/if}>
            <td>
                {$i.addresses_phone2}
            </td>
            <td class="tel">
                <span class="type" style="display: none;">work</span>
                <span class="value">
                {$address_info->phone2}
                </span>
            </td>
        </tr>
        <tr {if $address_info_derived->mobile_phone}class="infobluerow"{/if}>
            <td>
                {$i.addresses_mobile_phone}
            </td>
            <td class="tel">
                <span class="type" style="display: none;">cell</span>
                <span class="value">
                {$address_info->mobile_phone}
                </span>
            </td>
        </tr>
        <tr {if $address_info_derived->fax}class="infobluerow"{/if}>
            <td>
                {$i.addresses_fax}
            </td>
            <td class="tel">
                <span class="type" style="display: none;">fax</span>
                <span class="value">
                {$address_info->fax}
                </span>
            </td>
        </tr>
        <tr {if $address_info_derived->modem}class="infobluerow"{/if}>
            <td>{$i.addresses_modem}</td>
            <td class="tel">
                <span class="type" style="display: none;">pager</span>
                <span class="value">
                {$address_info->modem}
                </span>
            </td>
        </tr>
        <tr {if $address_info_derived->url}class="infobluerow"{/if}>
            <td>
                {$i.addresses_url}
            </td>
            <td>{$address_info->url}
            </td>
        </tr>
        <tr {if $address_info_derived->email}class="infobluerow"{/if}>
            <td>{$i.addresses_email}</td>
            <td>
                <a href="{emailsimple email=$address_info->email address_id=$address_info->id}" class="email">{$address_info->email}</a>
                <a href="{emailsimple email=$address_info->email address_id=$address_info->id force_mailto=true}" class="email"><span class="dialog_make_btn16 email smallbtns ui-corner-all"></span></a>
            </td>
        </tr>
        <tr>
            <td>{$i.addresses_emails}</td>
            <td>
                {$address_info->emails}
                </div>
            </td>
        </tr>
        <tr {if $address_info_derived->vat}class="infobluerow"{/if}>
            <td>{$i.addresses_vat}</td>
            <td>{$address_info->vat}</td>
        </tr>
        <tr>
            <td>
                {$i.addresses_description}
            </td>
            <td>
                {$address_info->description}
            </td>
        </tr>
        <tr {if $address_info_derived->categories}class="infobluerow"{/if}>
            <td>{$i.addresses_categories}</td>
            <td>
                {$address_info->categories}
                </div>
            </td>
        </tr>
        <tr>
            <td>{$i.addresses_longitude}</td>
            <td>{if !empty($address_info->longitude)}{islongfloat value=$address_info->longitude}{/if}</td>
        </tr>
        <tr>
            <td>{$i.addresses_latitude}</td>
            <td>{if !empty($address_info->latitude)}{islongfloat value=$address_info->latitude}{/if}</td>
        </tr>
        {foreach from=$addi_list item=field}
            <tr>
                {if $field->type eq US_exmodel::T_BLOCK}
                    <th colspan="2" style="text-align:center; {if isset($field->color)}background:{$field->color}{/if}">{$field->name}</th>
                {else}
                    <td style="{if isset($field->color)}background:{$field->color}{/if}">{$field->name}</td>
                    <td>
                        {assign var='field_id' value=$field->field}
                        {addiview field=$field value=$address_info->$field_id item=$address_info} 
                    </td>
                {/if}
            </tr>
        {/foreach}
    </tbody>
</table>