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

<!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 id="ptitle" runat="server">MSN,GTalk设置</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">MSN/GTalk设置</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="index.aspx">帐号管理</a></li>
                                 <li style="display:none;"><a href="advs.aspx">高级管理</a></li>
                                <li><a href="network.aspx">网络设置</a></li>
                                <li class="current"><a href="msn.aspx">MSN,GTalk</a></li>
                                <li><a href="mobile.aspx">手机</a></li>
                                <li><a href="email.aspx">邮件通知</a></li>
                                 <li><a href="../space/edit.aspx">空间设置</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="body_sec_all">
                        <div class="content-reshow">
                            绑定手机后，你可以通过彩信上传照片，通过短信发布心情日记。<br />
                            (只需支付普通彩信、短信资费，<strong><%# JuSNS.Config.UiConfig.SiteName%>不收取任何费用</strong>)。
                        </div>
                        <div class="msg-succ" id="div1" style="display: none;">
                            设置MSN,GTalk成功。</div>
                        <div class="spline">
                        </div>
                        <!--修改MSN设置-->
                        <div class="content" id="lm" sect:link="修改">
                            <h3>
                                <img src="/template/images/msn.gif" align="absmiddle" />
                                MSN设置</h3>
                            <div id="divMSN1" style="display: none;">
                                <div class="pstr">
                                    把 <span class="reshow">simplt@163.com</span> 添加到你的 MSN 联系人列表，即可成功绑定 MSN。</div>
                            </div>
                            <div id="divMSN2" style="display: none;">
                                <p>
                                    绑定只需 2 个步骤，请先输入你的 MSN 账号地址。</p>
                            </div>
                            <div>
                                <form method="post" action="" class="nf">
                                    <p>
                                        <label class="f-label">
                                            MSN 账号</label>
                                        <input type="text" class="f-text" id="txtMSN" disabled="disabled" name="txtMSN" size="30"
                                            runat="server" />
                                        <label id="lbMSN" style="display: none;">
                                            <a href="javascript:;" onclick="javascript:DelInfo('txtMSN','MSN',0);" id="msn-reset">
                                                删除并重设</a></label>
                                    </p>
                                </form>
                                <div class="spline">
                                </div>
                                <form method="post" action="">
                                    <label class="f-label">
                                        &nbsp;</label>
                                    <input type="button" class="f-button" value="保存设置" onclick="DelInfo('txtMSN','MSN',1);" />
                                </form>
                            </div>
                        </div>
                        <div class="line1">
                        </div>
                        <!--修改GTalk设置-->
                        <div id="gt" class="content" sect:link="修改">
                            <h3>
                                <img src="/template/images/gtalk.gif" align="absmiddle" />
                                GTalk 设置</h3>
                            <div id="divGtalk1" style="display: none;">
                                <div class="pstr">
                                    把 <span class="reshow">simplt@163.com</span> 添加到你的 GTalk 联系人列表，即可成功绑定 GTalk。</div>
                            </div>
                            <div id="divGtalk2" style="display: none;">
                                <p>
                                    绑定只需 2 个步骤，请先输入你的 MSN 账号地址。</p>
                            </div>
                            <div class="sect-content">
                                <form method="post" action="#" class="nf">
                                    <p>
                                        <label class="f-label">
                                            GTalk 账号</label>
                                        <input type="text" class="f-text" id="txtGtalk" disabled="disabled" name="txtGtalk"
                                            size="30" runat="server" />
                                        <label id="lbGtalk" style="display: none;">
                                            <a href="javascript:;" onclick="javascript:DelInfo('txtGtalk','Gtalk',0);" id="gtalk-reset">
                                                删除并重设</a></label>
                                    </p>
                                </form>
                                <div class="spline">
                                </div>
                                <form method="post" action="" class="nf">
                                    <label class="f-label">
                                        &nbsp;</label>
                                    <input type="button" class="f-button" value="保存设置" onclick="DelInfo('txtGtalk','Gtalk',1);" />
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="spline">
                    </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 Load()
{
   var MSN=$("txtMSN").value;
   var Gtalk=$("txtGtalk").value;
   
   if(MSN.replace(/(^\s*)|(\s*$)/g, "")!="")
   {
        $("divMSN1").style.display="";
        $("divMSN2").style.display="none";
        $("lbMSN").style.display=""; 
   } 
   else
   {
     $("txtMSN").disabled=false;
     $("divMSN1").style.display="none";
     $("divMSN2").style.display="";
     $("lbMSN").style.display="none"; 
   }
   
   if(Gtalk.replace(/(^\s*)|(\s*$)/g, "")!="")
   {
       $("divGtalk1").style.display="";
       $("divGtalk2").style.display="none";
       $("lbGtalk").style.display="";   
   }
   else
   {
        $("txtGtalk").disabled=false;
        $("divGtalk1").style.display="none";
        $("divGtalk2").style.display="";
        $("lbGtalk").style.display="none";   
   }
}Load();

//删除MSN/GTalk
function DelInfo(Value,flag,I)
{
    var value=$(Value).value;
    if(I==0)
    {
        if(!window.confirm("你确定要删除吗？"))
        {
            return;
        }
        value=""; 
    }
   
   var  options={  
			       method:'post',  
			       parameters:"Value="+value+"&Type="+flag,  
			       onComplete:function(transport)
				    { 
				        var v=transport.responseText; 
				        if (v.indexOf("??")>-1)
				        {
				            alert("设置失败！");
				        }
				        else
				        {
				            if(flag=="MSN" && I==0)
				            {
				                $("txtMSN").value="";
				            }
				            else if(flag=="Gtalk" && I==0)
				            {
				               $("txtGtalk").value=""; 
				            }
				            else
				            {
				                if(v==1)
				                {
				                    alert("设置成功！");
				                }
				                else if(v==2)
				                {
				                    alert("此MSN帐号已经存在！");return;
				                }
				                else if(v==3)
				                {
				                    alert("此Gtalk帐号已经存在！");return;
				                    
				                }
				            }
				            Load();
				        }
				    }  
			      }; 
      new Ajax.Request('msn.aspx',options);
     
}
</script>

