<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.home.search.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;" />
<title id="ptitle" runat="server">会员列表</title>
<meta name="keywords" content="交友,社交,博客,<% Response.Write(JuSNS.Config.UiConfig.SiteName); %> SNS,日志,心情,社会化网络" />
<meta name="description" content="<% Response.Write(JuSNS.Config.UiConfig.SiteName); %>是一个社交网络交友系统，通过她您可以结交更多的朋友！" />
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>
<script language="javascript" type="text/javascript" src="../../js/friend.js"></script>
<link href="../../template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css" id="skinpath" type="text/css" rel="stylesheet" />
</head>
<body>
 <!--头部-->
<%=this.GetHtmlShort()%> 
<div id="divhead">
    <%=this.GetHtmlHead()%>
</div>

<div id="divbody">
    <div id="body_first">
        <div class="body_menu"> 
        <%=this.GetHtmlLeft()%>
        </div>
    </div>
    <div id="body_sec">
            <div id="body_mid"> 
                <div class="body_frame"> 
                    <div class="body_sec_all"> 
                            
                           <div class="pstr">
                                <form id="Form1" runat="server" action="index.aspx" method="post">
                                        <input type="hidden" id="txtCity" runat="server" />
                                        <input type="hidden" id="txtBegin" runat="server" />
                                        <input type="hidden" id="txtEnd" runat="server" />
                                        <input type="hidden" id="txtSex" runat="server" />
                                <div class="pstr bold reshow">&bull; 高级搜索</div>
                                <div class="content">
                                      姓名或者电子邮件
                                      <input type="text" class="f-text w80" id="nameKeys" value="<%=Request.QueryString["namekey"] %>" name="nameKeys" />
                                      所在地区
                                     <select name="homeprovince" id="homeprovince" onchange="ChangeProv(this);">
                                            <option value="0" selected="selected">不限</option>
                                            <%# province%>
                                        </select>
                                       <select name="SlctCity" id="SlctCity">
                                       <option value="0" selected="selected">不限</option>
                                        </select>
                                        &nbsp; 年龄范围 
                                        <select name="Year1" id="selBegin" runat="server"><option value="0" selected="selected">不限</option></select> ~ <select name="Year2" id="selEnd" runat="server" ><option value="0" selected="selected">不限</option></select>
                                </div>
                                <div class="content">    
                                         性别 <input type="radio" name="rad" id="rad1" value="1"/>男  <input type="radio" name="rad" id="rad2" value="0" />女  <input type="radio" name="rad" id="rad3" value="2" checked="checked" />不限 &nbsp; &nbsp; <label  for="homeprovince">有头像</label>
                                        <input type="checkbox"  value="1" id="CheTX" runat="server"/>是
                                        <input type="button" class="f-button" id="networkFormSubmit" value="查找有缘人"  onclick="Void();"/>
                                </div>
                              </form>                           
                           </div> 
                         <div class="line1"></div>
                         <div class="content">
                              <!--搜索朋友结束-->
                             <div class="pstr reshow">  <%=title %></div> 
                             <asp:Repeater runat="server" ID="RptData">
                                    <HeaderTemplate>
		                             <div class="search_content">
		                                 <ul>
		                            </HeaderTemplate>
                                        <ItemTemplate>
		                               <li>
                                        <dl>
                                          <dt><a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID").ToString()+"")%>"><img src="<%# DataBinder.Eval(Container.DataItem, "Photo")%>" align="left" /></a></dt>
                                          <dd>
                                            <div><b><a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID").ToString()+"")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%></b></a>(<%# DataBinder.Eval(Container.DataItem, "Sex")%>)</div>
                                            <div><%# DataBinder.Eval(Container.DataItem, "Province")%><%# DataBinder.Eval(Container.DataItem, "City")%></div>
                                            <div><%# DataBinder.Eval(Container.DataItem, "brith")%></div>
                                            <%# AddFriend(DataBinder.Eval(Container.DataItem, "UserID"), DataBinder.Eval(Container.DataItem, "UserName"))%>
                                          
                                          </dd>
                                        </dl>
                                      </li>
                                    </ItemTemplate>   
                                    <FooterTemplate>
                                        </ul>
                                        </div>
                                    </FooterTemplate>
                                </asp:Repeater><div class="pagination" runat="server" id="DivPage">                        
                         </div>
                    </div>
                 </div>
     
           </div>     
                <!--底部-->
             <div class="divbottom">
              <%=this.GetHtmlFoot() %>
              </div>                    
          </div>
    </div>    
 </div>   
</body>
</html>
<script language="JavaScript" type="text/javascript">
function Void()
{
    var tx=$("CheTX").value;
    var sex=$("rad1").value;
    if(!$("CheTX").checked)
    {
       tx=0; 
    }
    if($("rad2").checked)
    {
       sex=0; 
    }
    else if($("rad3").checked)
    {
       sex=2; 
    }
    window.location.href="../Search/?namekey="+escape($("nameKeys").value)+"&Pr="+$("homeprovince").value+"&City="+$("SlctCity").value+"&Begin="+$("selBegin").value+"&End="+$("selEnd").value+"&Sex="+sex+"&TX="+tx;
    LoadInfo();
}

function LoadYear(s)
{
    for(var i=12;i<70;i++)
    {
        $("selBegin").options.add(new Option(i,i));
        $("selEnd").options.add(new Option(i,i));
    }
}LoadYear();

var arryprv = new Array(<%= cityarray%>);

function ChangeProv(obj) 
{
    var objcity = document.getElementById('SlctCity');
    var s = obj.options[obj.selectedIndex].value;
    objcity.options.length = 0;
    var optn = document.createElement('option');
    optn.value = '0';
    optn.innerHTML = '不限';
    objcity.appendChild(optn);
    if( s == '0')
    {
        return;
    }
    for(var i=0;i<arryprv.length;i++)
    {
        var arr = arryprv[i];
        if(arr[0] == s)
        {
            var opt = document.createElement('option');
            opt.value = arr[1];
            opt.innerHTML = arr[2];
            objcity.appendChild(opt);
        }
    }
}ChangeProv($("homeprovince"));

//初始化搜索选项
function LoadInfo()
{
    selected($('SlctCity'),$("txtCity").value);
    selected($('selBegin'),$("txtBegin").value);
    selected($('selEnd'),$("txtEnd").value);
    
    var s=$("txtSex").value;
    if(s==0)
    {
        $("rad2").checked=true;
    }
    else if(s==1)
    {
        $("rad1").checked=true;
    }
    else if(s==2)
    {
        $("rad3").checked=true;
    }
}LoadInfo();

function selected(obj,value)
{
    for(var i=0;i<obj.options.length;i++)
    {
        if(obj.options[i].value==value)
        {
            obj.selectedIndex=i;
        }
    }
}
                       


</script>