<table cellpadding='0' cellspacing='0' width="1233px" align="left">
    <tr>
        <td width="100%">
            <!-- Title, Logo, Welcome text -->
            <table cellpadding='0' cellspacing='0' width="100%">
            <tr style="background-color:#f5f6f6;">
                <td style="padding-top:12px;padding-left:40px;"> 
                    #if $context.getGlobal() and $context.getGlobal().getValue('Attachment'):
                        <img src="/$metadata.getApplication().getSheetId()/1/$context.getUserLogin().getSheetMetadata().getSheetId()/$context.getUserLogin().getValue('Status')/$context.getUserLogin().getSheetMetadata().getSheetId()/$context.getUserLogin().getSheetId()/$context.getGlobal().getSheetMetadata().getSheetId()/global/attachment"/>
                    #else
                        <img src="/static/images/nologo.gif"/>
                    #end if
                </td>
                <td valign="top" style="width:40%;padding-left:20px;padding-top:5px">
                	<table>
                		<tr height="10px">
                			<td>
                			</td>
                		</tr>
                		<tr>
                			 <td class="siteheader">
                			 	$metadata.getApplication().getSheetName()
                			 </td>
                		</tr>
               		</table>
                </td>
                <td valign="bottom" align="right" style="width:100%;">
                	<table style="padding-right:8px">
						<tr height="10px">
							<td>
							</td>
						</tr>
						<tr>
							 <td>
								<span style="color:#d56d11; font-size: 14px; font-family: Segoe, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;">Welcome $context.getUser().getValue('FirstName')!</span>
							 </td>
                             <td>|</td>
                               #if $context.getUser().getSheetMetadata().getPublicCellMetadataDict().has_key('UserProfile') and $context.getUser().getValue('UserProfile') == 'Administration' :
                               <td> <a style="text-decoration:none; color:black; font-size: 14px; font-family: arial, Tahoma, Verdana, 'Comic Sans MS';" href="/$metadata.getApplication().getSheetId()/1/$context.getUser().getSheetMetadata().getValue('SheetId')/$context.getUser().getValue('Status')/$context.getUser().getSheetMetadata().getValue('SheetId')/$context.getUser().getValue('SheetId')?mimetype=text/html&form=ManageApp">Manage This Application</a> &nbsp;&nbsp;|&nbsp;&nbsp;</td>
                             #end if
							 <td>
							 	<span>
							 	<a style="text-decoration:underline; color:#343434; font-size: 14px; font-family: Segoe, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif" href="$helper.getLogoutUrl()">Logout</a></span>
							 </td>
						</tr>
               		</table>
                </td>
            </tr>
            </table>
        </td>
    </tr>

</table>