<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="add.aspx.cs" Inherits="JuSNS.Web.home.ask.add" %>
<!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>
<link href="../../template/<% =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_frame_otherinfo">
                        <div class="title">
                            <div class="l"><img src="../../template/<%=JuSNS.Config.UiConfig.SkinStyle %>/images/site/ask.gif" align="absmiddle" /> <span class="bold shenlan font14 ocolor" runat="server" id="askTitle">问题</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 id="li_none" runat="server"><a href="../ask">朋友的问题</a></li>
                             <li  id="li_my" runat="server"><a href="../ask/?r=my">我的问题</a></li>
                             <li  id="li_all" runat="server"><a href="../ask/?r=all">所有问题</a></li>
                             <li  id="li_isclose" runat="server"><a href="../ask/?r=isclose">已经解决的问题</a></li>
                             <li  id="li_unclose" runat="server"><a href="../ask/?r=unclose">待解决的问题</a></li>
                             <li  id="li_ji" runat="server"><a href="../ask/?r=ji">紧急问题</a></li>
                             <li  id="li1"  class="current"><a href="../ask/?r=ji">提问</a></li>
                             </ul>
                        </div>        
                 </div>
                <div class="body_sec_all">
               <div runat="server" id="DivMsg" class="msg-succ" visible="false"></div>
               <div runat="server" id="DivMsg1" class="msg-error" visible="false"></div>
                    <form id="form1" runat="server"> 
                    <div class="line1"></div>
                    <div class="content">
                          <label class="f-label">标题</label><asp:TextBox runat="server" ID="TxtTitle" MaxLength="100" Width="60%" CssClass="f-text"></asp:TextBox>
                    </div>
                    <div class="content">
                          <label class="f-label">内容</label>
                          
                          
                          <asp:TextBox runat="server" ID="TxtContent" TextMode="MultiLine" MaxLength="2000" Width="60%" Height="120" CssClass="f-text"></asp:TextBox> <a href="javascript:void(0);"  id="face" onclick="showface(this.id,'TxtContent',0);"><img src="../../template/images/face/c.gif" title="选择表情"  align="absmiddle" /></a> <span class="reshow">2000个字符以内</span>
                    </div>
                    <div class="content">
                          <label class="f-label">关键字</label><asp:TextBox runat="server" ID="TxtTag" MaxLength="100" Width="60%" CssClass="f-text"></asp:TextBox> <span class="reshow">让别人更容易搜索到您的问题</span>
                    </div>
                    <div class="content">
                          <label class="f-label">图片</label><asp:FileUpload ID="TxtPic" runat="server"  CssClass="f-text"  Width="60%" />
                    </div>
                    <div class="content">
                          <label class="f-label">选择分类</label>
                        <asp:DropDownList ID="TxtClassID" runat="server"  onchange="ChangeProv(this.value);">
                        <asp:ListItem Value="0">选择分类</asp:ListItem>
                        </asp:DropDownList>
                        <span id="childClassIDDiv" style="display:none"></span>
                    </div>
                    <div class="content">
                          <label class="f-label">悬赏积分</label>
                          <asp:DropDownList runat="server" ID="TxtJiFen">
                          </asp:DropDownList> &nbsp; 目前你有<span class="reshow"><%=myJiFen %></span>个积分
                    </div> 
                    
                    <div class="content">
                          <label class="f-label">设为紧急</label>
                         <asp:CheckBox ID="TxtJinji" Text="是" runat="server" /> <span class="reshow">问题可以获得更多曝光机会，更快获得答案，消耗<%=isjiFen %>积分。</span>
                    </div> 
                    
                    
                    <div class="content pstr">
                        <label class="f-label">&nbsp;</label>
                        <asp:Button ID="Button1" runat="server" CssClass="f-button" Text="提交问题" OnClientClick="return SendSave();" OnClick="Button1_Click" />
                    </div>                   
                 </form> 
                 <div class="spline"></div>
            </div> 
            </div>
           <!--底部-->
         <div class="divbottom">
          <%=this.GetHtmlFoot()%>
          </div>
      </div> 
   </div>
</div>       
      
</body>
</html>

<script language="javascript" type="text/javascript">
<!--
function SendSave()
{
    var rj="";
    if(document.getElementById("TxtTitle").value=="")
   {
        rj="请填写标题！\n";
   } 
    if(document.getElementById("TxtContent").value=="")
   {
        rj+="请填写内容！\n";
   } 
    if(document.getElementById("TxtClassID").value=="0")
   {
        rj+="请选择分类！";
   } 
   if(rj!="")
   {
     alert(rj);return false;
   }
    var myjifen=<%= myJiFen%>;
    var isjiFen= <%=isjiFen %>;
    var xyaojifen=document.getElementById("TxtJiFen").value;
    var rs=xyaojifen; 
    if(document.getElementById("TxtJinji").checked)
    {
        rs=(xyaojifen*1)+(isjiFen*1);
    }   
   if(myjifen<rs)
   {
    alert("你的积分不够！");return false;
   }
}
function ChangeProv(pid) 
{
        if(pid==0)
        {
           document.getElementById("childClassIDDiv").style.display="none";
        } 
        else
        {
            var  options={  
		           method:'get',  
		           parameters:"a=child&pid="+pid,
		           onComplete:function(transport)
			        {  
				        var returnvalue=transport.responseText;
				        if (returnvalue.indexOf("??")>-1)
				        {
                                alert("错误");return;
                         }
				        else
				        {
                               document.getElementById("childClassIDDiv").style.display="";
				               document.getElementById("childClassIDDiv").innerHTML=returnvalue
				        }
			        }  
	           }; 
            new  Ajax.Request('add.aspx?no-cache='+Math.random(),options);    
       }
}

//-->
</script>