<h2>{$header.basket_select_user}</h2>
<div style="padding: 12px 12px 0px;height:480px;overflow-y:auto;" align="{$default_left}">
	<h3 class="p-b5" style="margin: 0px height: 25px;">{$header.find_user}</h3>
			<!-- selected category -->
	<div class="search_form_hide_show" style="padding:7px;">
		<div style="display:table;">
			<div style="margin-top:21px;" class="text_head float_left">{$header.find_user_login}</div>
			<div class="float_left" style="padding-{$default_left}:6px;">
				<input type="text" id="user_name" name="user_name" style="width: 100px;margin-top:14px;" onKeypress="if (event.keyCode==13 && this.length != '') ajaxRequest('{$form.file_name}?sel=check_user&login='+document.getElementById('user_name').value+'&', 'null', document.getElementById('result_div'), '<div style=\'text-align: center\'>{$lang.cards.admin.loading}...&nbsp;<img src=\'{$site_root}{$template_root}/images/ajax-loader.gif\'></div>', true);" >
				<input type="submit" value="{$lang.button.check}" onclick="ajaxRequest('{$form.file_name}?sel=check_user&login='+document.getElementById('user_name').value+'&', 'null', document.getElementById('result_div'), '<div style=\'text-align: center\'>{$lang.cards.admin.loading}...&nbsp;<img src=\'{$site_root}{$template_root}/images/ajax-loader.gif\'></div>', true);">
			</div>				
			<div style="display: none; cursor: pointer;margin-top:20px;padding-{$default_left}:6px;width:195px;" id="hide_link" class="float_left" onclick="ShowSearchForm('1'); return false;" >
				{$lang.users.hide_search_form}<a href="#" class="hide_search_form float_right" style="margin-top:-12px;">&nbsp;</a>
			</div>
			<div style="display: inline; cursor: pointer;margin-top:20px;padding-{$default_left}:6px;width:195px;" class="float_left" id="show_link" onclick="ShowSearchForm('2'); return false;" >
				{$lang.users.show_search_form}<a href="#" class="show_search_form float_right" style="margin-top:-12px;">&nbsp;</a>
			</div>
		</div>
	<!-- /selected category -->
        <form action="{$form.search_action}" method="post" name="search_form" id="search_form" style="margin-top: 8px; overflow:hidden;">
           <div class="index_quick_search" id="id_index_quick_search" style="display: none;margin-top:0px;">
			   <dl>
				   <dd valign="top">
					   <div>
					   <dl>
						   <dt style="width:18%; padding-top:0px; padding-{$default_right}:10px; padding-bottom:0px; padding-{$default_left}:0px;" class="text_head">{$lang.home_page.seeking_a_big}</dt>
								<dd style="padding-top:0px;padding-bottom:11px;">
							<select name="gender" id="gender" class="index_select" style="width: 150px;">
								<option value="0">{$lang.home_page.select_default}</option>
								{section name=s loop=$user_types_val}
								<option value="{$user_types_val[s].id}">{$user_types_val[s].name}</option>
								{/section}
							</select>
						   </dd>
						   <dt class="text_head" style="width:18%; padding-top:0px; padding-{$default_right}:5px; padding-bottom:0px; padding-{$default_left}:0px;" align="center">{$lang.cards.between_the_ages_of}</dt>
						   <dd style="padding-top:0px;padding-bottom:11px;">
							 <div>
							  <dl style="padding-bottom:0px;"><dt style="width:10%;">
								<select name="age_min" class="index_select" id="age_min">
									{section name=a loop=$age_min}
									<option value="{$age_min[a]}" >{$age_min[a]}</option>
									{/section}
								</select>
								   </dt>
								   <dt align="center" valign="middle" class="text_head" style="width:7%;">
									   {$lang.home_page.and}
								   </dt>
								   <dt style="width:10%;">
								<select name="age_max" class="index_select" id="age_max">
									{section name=a loop=$age_max}
									<option value="{$age_max[a]}" >{$age_max[a]}</option>
									{/section}
								</select>
								</dt></dl>
								</div>
						   </dd>
							<dt class="text_head" style="width:18%; padding-top:0px; padding-{$default_right}:8px; padding-bottom:0px; padding-{$default_left}:0px; text-align:middle;">{$lang.cards.status}</dt>
							<dd style="padding-top:0px;padding-bottom:11px;">
								<input type="checkbox"  name="online_only" value="1" id="online_only">&nbsp;{$lang.home_page.online_now}
							</dd>
					   </dl>
					   <dl>
						   <dt style="width:18%;padding-top:5px; padding-{$default_right}:0px; padding-bottom:3px; padding-{$default_left}:0px;" class="text_head">{$lang.home_page.country}</dt>
					   <dd style="padding-top:0px;padding-bottom:11px;">
						   <div id="country_div" style="margin-top; 0px">
							<select name="country"  onchange="javascript:SelectRegion('qsm', this.value, document.getElementById('region_div'), document.getElementById('city_div'));" class="index_select" style="width: 150px;" id="id_country">
							<option value="0">{$lang.home_page.select_default}</option>
							{section name=s loop=$countries}
							<option value="{$countries[s].id}" >{$countries[s].name}</option>
							{/section}
						</select>
						</div>
					   </dd></dl>
					   <dl>
						   <dt style="width:18%;padding-top:0px; padding-{$default_right}:5px; padding-bottom:0px; padding-{$default_left}:0px;" align="center" class="text_head">{$lang.home_page.region}</dt>
					   <dd style="padding-top:0px;padding-bottom:11px;">
						   <div id="region_div" style="margin-top; 0px">
						<select name="region"  class="index_select" onchange="javascript: SelectCity('qsm', this.value, document.getElementById('city_div'));" style="width: 150px;" id="region_id">
							<option value="0">{$lang.home_page.select_default}</option>
							{foreach item=item from=$regions}
							<option value="{$item.id}" >{$item.name}
							{/foreach}
						</select>
						   </div>
					   </dd></dl>
					   <dl> 
						   <dt style="width:18%;padding-top:0px; padding-{$default_right}:5px; padding-bottom:0px; padding-{$default_left}:0px;" align="center" class="text_head">{$lang.home_page.city}</dt>
					   <dd style="padding-top:0px;padding-bottom:11px;">
						   <div id="city_div" style="margin-top; 0px">
						<select name="city"  class="index_select" style="width: 150px;" id="city_id">
							<option value="0">{$lang.home_page.select_default}</option>
							{foreach item=item from=$cities}
							<option value="{$item.id}" >{$item.name}
							{/foreach}
						</select>
						   </div>
					   </dd></dl>
					   </div>
				   </dd>
			   </dl>
			   <dl>
				   <dd style="padding-{$default_right}: 5px;" align="{$default_right}">
					   <input type="button" value="{$lang.button.search}" onclick="javascript:SearchUserByParam();">
				   </dd>
			   </dl>
           </div>
	   </form>
</div>
        <div id="result_div" style="padding-top: 5px;" align="{$default_left}">
                {if $hot_list or $gifts_for_you or $gifts_from_you}
                    <div>
                    <!-- hot list -->
                    {if $hot_list}
                    <dl><dd>
                        <div class="content content_adult_2" style="padding:5px;">                       
                            <h3 class="p-b5">{$header.hot_list} </h3>                              
                            <dl valign=top style="overflow:hidden;">
                            {foreach item=item from=$hot_list}
                            <dt {if $item.icon_path}style="width:24%;padding:5px;" onmouseover=this.className="active_select" onmouseout=this.className="inactive_select" onclick="javascript: UserUpdate({$item.id});"{/if}>
								<div>
								<dl valign="middle">
									<dd style="width:80px;" class="text" align="center">{if $item.icon_path}<span class="imgcanvas_container"><img src="{$item.icon_path}" class="icon imgcanvas" alt=""></span>{/if}</dd>
								</dl>
								<dl>
									<dd style="width:100%" class="text" valign="top" align="center">
											<div>
												{if $item.login}<font class="text_head">{$item.login}</font>&nbsp;{/if}
											</div>
											<div>
												{if $item.age}{$item.age}&nbsp;{$lang.home_page.ans}{/if}
											</div>
									</dd>
								</dl>
								</div>
							</dt>
                            {/foreach}
                            </dl>
                            <dl>
                                <dd colspan={$user_per_line} align="{$default_right}">
                                    <a href="#" onclick="javascript:ajaxRequest('{$form.file_name}?sel=hot_list&', 'null', document.getElementById('result_div'), '<div style=\'text-align: center\'>{$lang.cards.admin.loading}...&nbsp;<img src=\'{$site_root}{$template_root}/images/ajax-loader.gif\'></div>', true);">{$lang.search.view_all}</a>
                                </dd>
                            </dl>
                        </div>
                     </dd></dl>
                    {/if}
                    <!-- /hot list -->

                    <!-- gifts for you -->
                    {if $gifts_for_you}
                    <dl><dd>
                        <div class="content content_adult_2" style="width:100%;margin-top: 5px; padding:5px;">
							<h3 class="p-b5">{$header.gifts_for_you}</h3>
                            <dl valign=top>
                            {foreach item=item from=$gifts_for_you}
                                <dt {if $item.icon_path}style="width:23%;padding:5px;" onmouseover=this.className="active_select" onmouseout=this.className="inactive_select" onclick="javascript: UserUpdate({$item.id});"{/if}>
									<div>
									<dl valign="middle">
										<dd style="width:80px" class="text" align="center">{if $item.icon_path}<span class="imgcanvas_container"><img src="{$item.icon_path}" class="icon imgcanvas" alt=""></span>{/if}</dd>
									</dl>
									<dl>
										<dd style="width:100%" class="text" valign="top" align="center">
												<div>
													{if $item.login}<font class="text_head">{$item.login}</font>&nbsp;{/if}
												</div>
												<div>
													{if $item.age}{$item.age}&nbsp;{$lang.home_page.ans}{/if}
												</div>
										</dd>
									</dl>
									</div>
                                </dt>
                            {/foreach}
                            </dl>
                        </div>
                     </dd></dl>
                    {/if}
                    <!-- /gifts for you -->

                    <!-- gifts from you -->
                    {if $gifts_from_you}
                    <dl><dd>
                        <div class="content content_adult_2" style="width:100%;margin-top: 5px; padding:5px;">
							<h3 class="p-b5">{$header.gifts_from_you}</h3>
							<dl valign=top>
							{foreach item=item from=$gifts_from_you}
								<dt {if $item.icon_path}style="width:23%;padding:5px;"  onmouseover=this.className="active_select" onmouseout=this.className="inactive_select" onclick="javascript: UserUpdate({$item.id});"{/if}>
									<div>
									<dl valign="middle">
										<dd style="width:80px" class="text" align="center">{if $item.icon_path}<span class="imgcanvas_container"><img src="{$item.icon_path}" class="icon imgcanvas" alt=""></span>{/if}</dd>
									</dl>
									<dl>
										<dd style="width:100%" class="text" valign="top" align="center">
												<div>
													{if $item.login}<font class="text_head">{$item.login}</font>&nbsp;{/if}
												</div>
												<div>
													{if $item.age}{$item.age}&nbsp;{$lang.home_page.ans}{/if}
												</div>
										</dd>
									</dl>
									</div>
								</dt>
							{/foreach}
							</dl>
                        </div>
                     </dd></dl>
                    {/if}
                    <!-- /gifts from you -->
                    </dd></dl>
                    </div>
                {/if}

       </div>


</div>
{literal}
<script>
function UserUpdate(id){
//	opener.focus();
//	opener.location.href='./{/literal}{$form.file_name}{literal}?sel=users_add&id_user='+id;
//	window.close();
    parent.location.href='{/literal}{$form.file_name}{literal}?sel=users_add&id_user='+id;
    //parent.GB_hide();
}

function ShowSearchForm(par) {
    if (par == '1') {
        document.getElementById('hide_link').style.display = 'none';
        document.getElementById('show_link').style.display = 'inline';
        document.getElementById('id_index_quick_search').style.display = 'none';
    } else {
        document.getElementById('hide_link').style.display = 'inline';
        document.getElementById('show_link').style.display = 'none';
        document.getElementById('id_index_quick_search').style.display = 'block';
        //Nifty("div#id_index_quick_search");
    }
}

function SearchUserByParam() {
   var strparam = '{/literal}{$form.file_name}{literal}?sel=search_user';
   if (document.getElementById('gender').value != 0)  strparam = strparam + '&gender='+document.getElementById('gender').value;
   var min = document.getElementById('age_min').value;
   var max = document.getElementById('age_max').value;
   if (min < max)  strparam = strparam + '&age_min='+min+'&age_max='+max;
   if (document.getElementById('online_only').checked)  strparam = strparam + '&online_only=1';
   var country = document.getElementById('id_country');
   if (country != null && country.value != 0)  strparam = strparam + '&id_country='+document.getElementById('id_country').value;
   var region = document.getElementById('id_region');
   if (region != null && region.value != 0)  strparam = strparam + '&id_region='+region.value;
   var city = document.getElementById('id_city');
   if (city != null && city.value != 0)  strparam = strparam + '&id_city='+city.value;
   ajaxRequest(strparam+'&', 'null', document.getElementById('result_div'), '<div style=\'text-align: center\'>{/literal}{$lang.cards.admin.loading}{literal}...&nbsp;<img src=\'{/literal}{$site_root}{$template_root}{literal}/images/ajax-loader.gif\'> </div>', true);
}

</script>
{/literal}
