<%@ Page Language="C#" AutoEventWireup="true" Codebehind="InviteReg.aspx.cs" Inherits="JuSNS.Web.InviteReg" %>

<%@ Import Namespace="System.Collections.Generic" %>
<!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>
<link href="template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css"
    id="skinpath" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript">
<!--
var arryprv = new Array(<%= cityarray%>);
function ChangeProv(obj) 
{
    var objcity = document.getElementById('SlctCity');
    var s = obj.options[obj.selectedIndex].value;
    objcity.options.length = 0;
    if( s == '0')
    {
        objcity.style.display = 'none';
        document.getElementById('err_addr').style.display = '';
        return;
    }
    else
    {
        document.getElementById('err_addr').style.display = 'none';
    }
    objcity.style.display = '';
    var optn = document.createElement('option');
    optn.value = '0';
    optn.innerHTML = ' ';
    objcity.appendChild(optn);
    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);
        }
    }
}
//检查email
function checkemail()
{
    var obj = document.getElementById('TxtEmail');
    var s = obj.value.trim();
    
    if(s == '' || !s.IsEmail())
    {
        document.getElementById('err_mail').style.display = '';
        document.getElementById('hnt_mail').style.display = 'none';
        return false;
    }
    else
    {
        document.getElementById('err_mail').style.display = 'none';
        document.getElementById('hnt_mail').style.display = '';
        return true;
    }    
}
//检查姓名
function checkname()
{
    var obj = document.getElementById('TxtName');
    var s = obj.value.trim();
    obj.value = s.replace(/\|/g,'');
    if(s == '')
    {
        document.getElementById('hnt_name').style.color = 'red';
        return false;
    }
    else
    {
        document.getElementById('hnt_name').style.color = '#666';
        return true;
    }    
}
function checkpwd()
{
    var obj = document.getElementById('TxtPassword');
    var s = obj.value.trim();
    if(s.length < 4)
    {
        document.getElementById('hnt_pwd').style.color = 'red';
        return false;
    }
    else
    {
        document.getElementById('hnt_pwd').style.color = '#666';
        return true;
    }
}
function checkvrf()
{
    var s1 = document.getElementById('TxtPassword').value;
    var s2 = document.getElementById('TxtVerifyPass').value;
    if(s1 != s2)
    {
        document.getElementById('err_vrf').style.display = '';
        return false;
    }
    else
    {
        document.getElementById('err_vrf').style.display = 'none';
        return true;
    }
}
function checkconfer(obj)
{
    var btn = document.getElementById('btnok');
    if(obj.checked)
       btn.disabled = false;
    else
       btn.disabled = true;
}
function checkform()
{
    if(!(checkemail() && checkname() && checkpwd() && checkvrf()))
    {
        return false;
    }
    var sexobj = document.getElementById('Slctgender');
    var sx = sexobj.options[sexobj.selectedIndex].value;
    if(sx=='')
    {
        document.getElementById('error_sex').style.display = '';
        sexobj.focus();
        return false;
    }  
    else
    {
        document.getElementById('error_sex').style.display = 'none';
    }
    
    var obj = document.getElementById('SlctProvince');
    var s = obj.options[obj.selectedIndex].value;
    if(s == '0')
    {
        document.getElementById('err_addr').style.display = '';
        document.getElementById('hnt_addr').style.display = 'none';
        obj.focus();
        return false;
    }
    else
    {
        document.getElementById('err_addr').style.display = 'none';
        document.getElementById('hnt_addr').style.display = '';
    }
    return true;
}
//-->
</script>

</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="nl" style="width: 300px;">
                            <div class="spline"></div>
                            <div class="pstr">
                                <img src="<%# GetHeadImage(info.UserID,3)%>" alt="<%# info.UserName%>" />
                            </div>
                            <div class="cpstr bold font14">
                                <%# info.UserName%> <span class="normal font12">(<%# info.Network%>)</span>
                            </div>
                           <div class="spline"></div> 
                           <div class="line1"></div> 
                            <div class="content pstr">
                                <div class="content-reshow">
                                    成为<%# info.UserName%>的<%# JuSNS.Config.UiConfig.SiteName %>好友，可以看到他的：
                                </div>
                                <table class="content" cellpadding="5" cellspacing="2">
                                    <tr>
                                        <td class="s50">
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle%>/images/site/ico/im.gif" align="absmiddle" /> <%# info.FriendCount%>
                                            个好友
                                        </td>
                                        <td>
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle %>/images/site/ico/index-photo.gif" align="absmiddle" /> <%# info.FriendCount%>
                                            张照片
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle %>/images/site/ico/blog.gif" align="absmiddle" />&nbsp; <%# info.BlogCount%>
                                            篇日志
                                        </td>
                                        <td>
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle %>/images/site/ico/group.gif" align="absmiddle" />&nbsp; <%# info.GroupCount%>
                                            个群组 &nbsp;  &nbsp;  &nbsp;  &nbsp; 
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle %>/images/site/ico/share.gif" align="absmiddle" /> <%# info.ShareCount%>
                                            个分享
                                        </td>
                                        <td>
                                            <img src="template/<% =JuSNS.Config.UiConfig.SkinStyle%>/images/site/ico/movie.gif" align="absmiddle" /> <%# info.MovieCount%>
                                            部电影
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                <div class="line1"></div>
                                <div class="content-reshow bold">
                                    <%# info.UserName%>好友：
                                </div>
                                <div id="pf-friend" class="regcss pstr center img">
                                    <div>
                                        <ul>
                                            <%foreach (KeyValuePair<string, string> kvp in frnd)
                                              {%>
                                            <li>
                                                <img src="<%=JuSNS.Common.Public.GetSmallHeadPic(kvp.Value,1)%>" alt="<%=kvp.Key%>" style="width:48px;height:48px;" /><div class="pstr"><%=kvp.Key%></div>
                                           </li>
                                            <%} %>
                                        </ul>
                                    </div>
                                </div>                                
                            </div>
                        </div>
                        <div class="nr w420 margins10">
                            <div class="borderout center">
                                <div class="border cleft bbackeee" style="padding-left:18px;">
                                    <div class="pstr font16 bold reshow">
                                        Hi， 我是<%# info.UserName%>：</div>
                                    <div class="content-reshow">
                                        <%# info.Postscript%>
                                    </div>
                                    <div>
                                       <div class="spline"></div> 
                                       <div class="spline"></div> 
                                        <div class="cpstr">
                                            &bull; 立即注册，成为<%# info.UserName%>的<%# JuSNS.Config.UiConfig.SiteName %>好友！
                                        </div>
                                       <div class="cpstr reshow">
                                       &bull; 完全免费，任何人都可以加入。
                                       </div> 
                                       <div class="spline"></div> 
                                       <div class="spline"></div> 
                                        <form method="post" action="InviteReg.aspx" name="netsnsreg" id="netsnsreg">
                                            <div class="content">
                                                <label class="f-label" for="email_reg">
                                                    电邮<%=isRegMobile %></label>
                                                <input type="text" id="TxtEmail" runat="server" name="TxtEmail" onblur="return checkemail();" class="f-text"  value="<%# info.Invitee%>" />
                                                <input type="hidden" id="TxtEmails" runat="server" name="TxtEmails" onblur="return checkemail();" value="<%# info.Invitee%>" />
                                                <span id="hnt_mail" class="cpstr">用来登录<%# JuSNS.Config.UiConfig.SiteName %></span>
                                                <span class="reshow cpstr" id="err_mail" style="display: none;">请输入有效的电子邮件</span>
                                            </div>
                                            <div class="content">
                                                <label class="f-label" for="realname">
                                                    姓名</label>
                                                <input type="text" id="TxtName" name="TxtName" onblur="checkname();" class="f-text" value="" maxlength="12" />
                                                <span id="hnt_name" class="cpstr">请输入真实姓名</span>
                                            </div>
                                            <div class="content">
                                                <label class="f-label" for="province">
                                                    我在</label><select name="SlctProvince" id="SlctProvince" onchange="ChangeProv(this);">
                                                        <option value="0" selected="selected"></option>
                                                        <%# province%>
                                                    </select>
                                                <select name="SlctCity" id="SlctCity" style="display: none;">
                                                </select>
                                                <span class="reshow cpstr" id="err_addr" style="display: none;">请选择所在地</span>
                                                <span id="hnt_addr" class="cpstr">请选择所在地</span>
                                                <input type="hidden" name="city" id="city" value="0" />
                                            </div>
                                            <div class="content">
                                                <label class="f-label" for="password_reg">
                                                    密码</label>
                                                <input type="password" name="TxtPassword" onblur="checkpwd();" id="TxtPassword" class="f-text"
                                                    maxlength="32" />
                                                <span id="hnt_pwd" class="cpstr">最少 4 个字符</span>
                                            </div>
                                            <div class="content">
                                                <label class="f-label" for="verifypass">
                                                    重复密码</label>
                                                <input type="password" name="TxtVerifyPass" onblur="checkvrf();" id="TxtVerifyPass"
                                                    class="f-text" maxlength="32" />
                                                <span class="reshow cpstr" id="err_vrf" style="display: none;">密码必须一致</span>
                                            </div>
                                           <div class="content" style="display:block;">
                                             <label class="f-label" for="gender">
                                                    性别</label>
                                                    <select name="Slctgender" id="Slctgender">
	                                                <option selected="selected" value="">选择性别...</option>
	                                                <option value="1">男</option>
	                                                <option value="0">女</option>
                                                    </select>
                                                   <span class="reshow cpstr" id="error_sex" style="display: none;">
                                                            <span class="reshow">请选择性别</span>
                                                   </span> 
                                                    
                                           </div> 
                                            
                                            <div class="content pstr">
                                                <label class="f-label">&nbsp;</label>
                                                <input type="submit" id="btnok" onclick="return checkform();" class="f-button" value="确认注册..." name="reg" />
                                                <input type="hidden" name="Register" id="Hidden1" value="Submit" />
                                            </div>
                                            <div class="content">
                                                <label class="f-label" for="agreement">
                                                    接受协议
                                                </label>
                                                <input type="checkbox" id="agreement" onclick="checkconfer(this);" onchange="checkconfer(this);"
                                                    checked="checked" value="on" name="agreement" /><a href="/help/?a=terms" target="_blank">《使用协议》</a>
                                            </div>
                                            
                                            <div class="spline line1"></div> 
                                            <div class="content">
                                                <label class="f-label">
                                                    &nbsp;</label>
                                                <a href="/?r=login">我已经注册过，我要登录我的帐号</a>
                                            </div>
                                            <input type="hidden" name="r" value="<%# code%>" />
                                            <input type="hidden" name="mode" value="<%# invitemode%>" />
                                        </form>
                                       <div class="spline"></div> 
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="spline">
                    </div>
                </div>
                <!--底部-->
                <div class="divbottom">
                    <%=this.GetHtmlFoot() %>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
