<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit-like.aspx.cs" Inherits="JuSNS.Web.home.space.edit_like" %>
<!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>
<title><% Response.Write(JuSNS.Config.UiConfig.SiteName); %> | 个人爱好</title>
<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" />
</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"> 
                 <!--主题内容中-->    
                
                <input type="hidden" id="txtYear" runat="server" /><input type="hidden" id="txtDay" runat="server" />                    
                <div class="body_frame_otherinfo">
	                        <div class="title">
                                <div class="l"><img src="../../template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/acc.gif" align="absmiddle" /> <span class="shenlan bold font14 ocolor">爱好管理</span></div>
                                <div class="r"><a href="javascript:window.history.back();" title="返回上一页">返回上一页</a></div>
                                <div class="c"></div>
                            </div>
            		       
                            <div class="nav-menu">
                                <ul>
                                 <li><a href="edit.aspx">基本信息</a></li>
                                 <li><a href="edit-link.aspx">联系信息</a></li>
                                 <li class="current"><a href="edit-like.aspx">个人爱好</a></li>
                                 <li><a href="edit-edu.aspx">教育信息</a></li>
                                 <li><a href="edit-work.aspx">工作信息</a></li>
                                 <li><a href="userheadphoto.aspx">上传头像</a></li>
                                 <li><a href="template.aspx">装扮空间</a></li>
                                 <li><a href="../privacy">隐私设置</a></li>
                                 <li><a href="../base">帐号管理</a></li>
                                 </ul>
                            </div>        
                     </div>
                     <div class="body_sec_all">  
                     <% Response.Write(GetTiShiDivStr);%>   
                    <div class="content-reshow">
                        多项之间请用逗号分隔，如“喜欢的电影：功夫熊猫，泰坦尼克号”<br />你可以通过<a href="../privacy">隐私设置</a>控制谁可以看见以下内容。
                    </div> 
                    <div class="msg-error" id="Div_Error"  style="display:none;"></div>
                    <div class="msg-succ" id="Div_Succ"  style="display:none;"></div>
                    
                     <form id="form1" runat="server"> 
                    <div class="content">
                            <label class="f-label">兴趣爱好</label>
                             <textarea  id="Favourite" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>
                     <div class="content">
                            <label class="f-label">喜欢的音乐</label>
                             <textarea  id="FavMusics" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>  
                     <div class="content">
                            <label class="f-label">喜欢的电影</label>
		                    <textarea  id="FavMovies" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                     
                     <div class="content">
                            <label class="f-label">喜欢的动漫</label>
		                    <textarea  id="FavCartoons" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">喜欢的游戏</label>
		                    <textarea  id="FavGames" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">喜欢的运动</label>
		                    <textarea  id="FavSports" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                       
                      <div class="content">
                            <label class="f-label">喜欢的书</label>
		                    <textarea  id="FavBooks" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">喜欢的格言</label>
		                    <textarea  id="FavAdages" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">欣赏的名人</label>
		                    <textarea  id="AppreciateMen" cols="45"  runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">自我描述</label>
		                    <textarea  id="Presetation" cols="45" runat="server" onchange="Checked(this.value);" style="height: 50px;width:300px;" class="f-text"></textarea>
                     </div>                      
                      <div class="content">
                            <label class="f-label">&nbsp;</label>
		                    <input type="button" class="f-button" value="保存个人爱好..." onclick="Submit();" />
                     </div>
                     <div class="spline"></div> 
                     </form> 
                     </div>                                                                                                 
             </div>
           <!--底部-->
             <div class="divbottom">
              <%=this.GetHtmlFoot()%>
              </div>    
           </div>
      </div>
</div>
</body>
</html>

<script language="javascript" type="text/javascript">
//function $(o){return document.getElementById(o);}

//提交
function Submit()
{
    var Favourite=$("Favourite").value;
    var FavMusics=$("FavMusics").value;
    var FavMovies=$("FavMovies").value;
    var FavCartoons=$("FavCartoons").value;
    var FavGames=$("FavGames").value;
    var FavSports=$("FavSports").value;
    var FavBooks=$("FavBooks").value;
    var FavAdages=$("FavAdages").value;
    var AppreciateMen=$("AppreciateMen").value;
    var Presetation=$("Presetation").value;
    var  options={  
				   method:'get',  
				   parameters:"Favourite="+escape(Favourite)+"&FavMusics="+escape(FavMusics)+"&FavMovies="+escape(FavMovies)+"&FavCartoons="+escape(FavCartoons)+"&FavGames="+escape(FavGames)+"&FavSports="+escape(FavSports)+"&FavBooks="+escape(FavBooks)+"&FavAdages="+escape(FavAdages)+"&AppreciateMen="+escape(AppreciateMen)+"&Presetation="+escape(Presetation)+"&Type=Edit",  
				   onComplete:function(transport)
					{ 
					    var v=transport.responseText;
					    if (v.indexOf("??")>-1)
					    {
                           $("Div_Error").style.display="";
                           $("Div_Succ").style.display="none";
                           $("Div_Error").innerHTML="修改失败";
                        }
					    else
					    {
                           $("Div_Error").style.display="none";
                           $("Div_Succ").style.display="";
                           $("Favourite").focus();
                           $("Div_Succ").innerHTML=v;
                        }
					}  
				  }; 
       new Ajax.Request('edit-like.aspx',options);
}

function Checked(value)
{
    if(value.trim()!="")
    {
        var array=value.split('，');
        if(array.length>1)
        {
           $("Div_Error").style.display="";
           $("Div_Succ").style.display="none";
           $("Div_Error").innerHTML="输入无效，多项之间只能用英文的逗号（','）分开!";
            return;
        }
    }
    if(value.length>200)
    {
       $("Div_Error").style.display="";
       $("Div_Succ").style.display="none";
       $("Div_Error").innerHTML="最多 200 个汉字";
        return;
    }
}

</script>

