<inp2:adm_SetPopupSize width="582" height="504"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="u" section="in-portal:user_list" grid="UserSelector" title_preset="user_select" pagination="1"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
	  	<td>
	  		<script type="text/javascript">
					a_toolbar = new ToolBar();
	  				a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', edit) );
					a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
								window_close();
							}
					 	) );

					a_toolbar.AddButton( new ToolBarSeparator('sep3') );

					a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
								show_viewmenu(a_toolbar,'view');
							}
					) );

					a_toolbar.Render();

					function edit() {
						var $opener = getWindowOpener(window);

						if ( $.isFunction($opener.processUserSelector) ) {
							$opener.processUserSelector('<inp2:m_Recall name="dst_field"/>', window);
							window_close();
						}
						else {
							submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnSelectUser');
						}
					}

					var $user_logins = {};
			</script>
		</td>

		<inp2:m_RenderElement name="search_main_toolbar" prefix="u" grid="UserSelector"/>
	</tr>
</tbody>
</table>

<inp2:m_DefineElement name="grid_login_td" format="" nl2br="" no_special="1" first_chars="" td_style="">
	<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>

	<script type="text/javascript">
		$user_logins[ <inp2:Field name="$IdField"/> ] = '<inp2:Field name="Username" js_escape="1"/>';
	</script>
</inp2:m_DefineElement>

<inp2:m_RenderElement name="grid" PrefixSpecial="u" IdField="PortalUserId" grid="UserSelector"/>
<script type="text/javascript">
	Grids['u'].SetDependantToolbarButtons( new Array('select') );
</script>

<inp2:m_include t="incs/footer"/>