﻿// JScript 文件

        function UserCommentSubmit()
        {
            if($("#hduser").val() != "")
            {
                if($("#user_comment").val().length<100 )
                {
                    var datas= "userid="+$("#hduser").val()+"&user_comment="+$("#user_comment").val()+"&commenttitle="+$("#commenttitle").val();
                    $.ajax({
                    url:"addComment.aspx?d="+new Date(),
                    data:datas,
                    type:"post",
                    success:function(msg){
                       if(msg==1)
                       {
                            alert("您的提问已经提交！请等待管理员审核");
                            $("#user_comment").val("");
                           // window.location.href="Index.htm";
                       }
                        else
                        {
                            alert("提问提交失败！");
                        }
                     }
                     });     
                }
                else
                {
                    alert("请正确填写您的提问内容！文字100字以内!");
                }
            }
            else
            {
                alert("请先登录！");
              // window.location.href="Login.aspx";
            }
        }
        
        function UrlSubmit()
        {
            if($("#hduser").val() != "")
            {
            var pattern = /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\:+!]*([^<>])*$/;
            if(pattern.test($("#zturl").val()))
             {
                    var datas = "url="+$("#zturl").val()+"&userid="+$("#hduser").val();
                    $.ajax({
                        url:"AddUrl.aspx?d="+new Date(),
                        data:datas,
                        type:"post",
                        success:function(msg){
                            if(msg==1)
                            {
                                alert("您的转帖地址已经被保存");
                                $("#zturl").val("");
                            }
                            else
                            {
                                alert("您的转帖地址保存失败");
                            }
                        }
                    });
              }
              else
              {
                alert("请输入正确的转帖地址");
              }
            }
            else
            {
                alert("请先登录！");
            }
        }
