<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="postshare.aspx.cs" Inherits="JuSNS.Web.user.share.PostShareComment" %>
<%@ Import Namespace="System.Collections" %>
<%@ 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>
<title id="ptitle" runat="server">发布分享</title>
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>
<script type="text/javascript" src="../../js/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="../../js/build/dom/dom-min.js"></script>
<script type="text/javascript" src="../../js/build/event/event-min.js"></script>
<script type="text/javascript" src="../../js/build/autocomplete/autocomplete-min.js"></script>
<link href="../../template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css"   id="skinpath" type="text/css" rel="stylesheet" />
</head>
<body  id="yahoo-com" class="yui-skin-sam" onload="shareto('1');">
  <!--头部-->
  <%=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_frame_otherinfo">
                        <div class="title">
                            <div class="l">
                                <img src="../../template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/share_1.gif"
                                    align="absmiddle" />
                                <span class="bold shenlan font14 ocolor">发表分享</span></div>
                            <div class="r">
                                <a href="../share?r=0" title="返回上一页">返回好友的分享</a></div>
                            <div class="c">
                            </div>
                        </div>
                        <div class="nav-menu">
                            <ul>
                                <li class="cbg"></li>
                                    <li  id="stype2" class="current"><a href="javascript:;" onclick="shareto('1')">分享到个人空间</a></li>
                                    <li  id="stype1"><a href="javascript:;" onclick="shareto('0')">分享给好友</a></li>
                                <li class="cbg"></li>
                            </ul>
                        </div>
                    </div>
              
                <div class="body_sec_all">
                      <form action="postshare.aspx" method="get" name="form1" id="form1">
                            <div runat="server" id="GetMessage"></div>
                            <div class="content"  id="showUser" style="display:none;">
                                <label class="f-label">分享给：</label>
                                 <div id="statesautocomplete" class="inline">
                                        <span id="span_Receiver" runat="server"></span>
                                        <input id="FriendIDGroup" type="text" style="width:350px;" class="f-text" runat="server"  />
                                        <input id="Hid_UserID" name="Hid_UserID"  type="hidden" runat="server" />
                                        
                                        <div id="statescontainer">
                                             
                                        </div>
                                </div>
                            </div>
                           <div class="content">
                               <label class="f-label">主题：</label>
                               <input name="Title" id="Title"  class="f-text" style="width:350px;" value="<%=Request.QueryString["t"] %>" type="text" />
                           </div> 
                           <div class="content">
                                <label class="f-label">内容：</label>
                                <textarea rows="10" name="tcontent"  class="f-text" id="tcontent" style="width:350px;"><%=Request.QueryString["desc"]%></textarea>
                           </div>
                           
                           <div class="content">
                                <label class="f-label">地址：</label>
                                <input id="shareurl"  class="f-text" name="shareurl" value="<%=Request.QueryString["url"]%>" type="text"  style="width:350px;" />
                                
                           </div>
                           
                           <div class="content pstr">
                                <label class="f-label">&nbsp;</label>
                                <input value="add" id="postaction" name="postaction" type="hidden" />
                                <input value="0" id="postType" name="postType" type="hidden" />
                                <input type="button" class="f-button" onclick="javascript:cPost(this);" value="确定开始分享..." /> 
                                <input type="button" class="f-button" value="取消" onclick="history.go(-1)"/>
                           </div>
                            
                        </form>
                        <div class="spline"></div>
                </div>
               </div>
                <!--底部-->
                <div class="divbottom">
                    <%=this.GetHtmlFoot()%>
                </div>        
           </div>
    </div>
</div>     
 </body>
</html>
<script type="text/javascript">
function cPost(obj)
{
    var Title=document.getElementById("Title");
    var tcontent=document.getElementById("tcontent");
    var shareurl=document.getElementById("shareurl");
    if(Title.value=="")
   {
        alert("请填写标题！");
        Title.focus();
        return false;
   } 
    if(tcontent.value=="")
   {
        alert("请填写内容描述！");
        tcontent.focus();
        return false;
   } 
    if(shareurl.value.length<10)
   {
        alert("请正确填写分享地址！");
        shareurl.focus();
        return false;
   } 
    document.form1.submit(); 
}
function shareto(o)
{
    var showUser=document.getElementById("showUser");
    var  stype1=document.getElementById("stype1");
    var  stype2=document.getElementById("stype2");
    if(o=='0')
    {
        showUser.style.display="block";
        stype1.className="current";
        stype2.className="";
        document.getElementById("postType").value="0";
    }  
    else
    {
        showUser.style.display="none";
        stype1.className="";
        stype2.className="current";
        document.getElementById("postType").value="1";
    }
}
</script>

<script type="text/javascript">
<%
    JuSNS.Home.Friend friend = new JuSNS.Home.Friend();
    Dictionary<int, string> dct = friend.GetFriends(UserID,"");
    string s_List = "";
    foreach (KeyValuePair<int, string> kvp in dct)
    {
        s_List += "\"" + kvp.Value + "<span style='display:none;'>" + kvp.Key.ToString() + "</span>\",";
    }
    s_List = s_List.TrimEnd(',');
%>
YAHOO.example.statesArray = [<% Response.Write(s_List); %>];

YAHOO.example.ACJSArray = new function() {
    this.oACDS = new YAHOO.widget.DS_JSArray(YAHOO.example.statesArray);

    this.oAutoComp = new YAHOO.widget.AutoComplete('FriendIDGroup','statescontainer', this.oACDS);
    this.oAutoComp.prehighlightClassName = "yui-ac-prehighlight";
    this.oAutoComp.typeAhead = true;
    this.oAutoComp.useShadow = true;
    this.oAutoComp.minQueryLength = 0;
};
</script>
