<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
    <title>中国海天集团手机网</title>
    <link rel="stylesheet" type="text/css" href="style/m.min.css">
    <META content="text/html; charset=utf-8" http-equiv="Content-Type">
    <script src="jQuery/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="jQuery/checkmobile.js" type="text/javascript"></script>
    <script type="text/javascript">
//     function exits(){
//      var phone = $("#mobile").val();
//          $.ajax({
//             type: "post",
//                        url: "ashx/Addquestion.ashx?mode=exitsphone&phone="+ phone,
//                        success: function (msg) {
//                            if (msg > 0) { $(".subSuccess").html("<p style='color:Red'>您的手机号尚未注册<a href='reg.aspx'>马上注册</a></p>") }
//            });

//         }

//        $(document).ready(function () {
//            $("#mobile").blur(function () {
//                $.ajax({
//                    type: "post",
//                    url: "ashx/Addquestion.ashx?mode=exitsphone&phone=" + $("#mobile").val(),
//                    success: function (msg) {
//                        $("#is-reg-mobile").val(msg);
//                        if ($("#is-reg-mobile").val() == 0) {
//                            $(".subSuccess").html("<a href='reg.aspx'>点击注册</a>");
//                        }
//                        else {
//                            $(".subSuccess").html("");
//                        }
//                    }
//                });
//            });
//        });
        function addquestion() {
            var bol = checkTel();
            var question = $("#question").val();
            if (question == "") {
                $("#question").focus();
                return false;
            }
            else {
                if (bol == true) {
//                    if ($("#is-reg-mobile").val() == 0) {
//                        $(".subSuccess").html("<a href='reg.aspx'>点击注册</a>");
//                    }
                    $.ajax({
                        type: "post",
                        url: "ashx/Addquestion.ashx?mode=add&phone=" + $("#mobile").val() + "&question=" + $("#question").val(),
                        success: function (msg) {
                            if (msg > 0) { $(".subSuccess").html("<p style='color:Red'>提交成功</p>") }
                        }
                    });
                }
            }
  
   }

   $(function () {
       ajaxhot();
       ajaxnew();
       $("#hotmore").click(function () { ajaxhotall(); });
       $("#newmore").click(function () { ajaxnewall(); });
       function ajaxhot() {
           $.ajax({
               type: "post",
               url: "ashx/Addquestion.ashx?mode=bindHot",
               success: function (msg) {
                   $(".bindhot").html(msg);
               }
           });
       }
       function ajaxhotall() {
           $.ajax({
               type: "post",
               url: "ashx/Addquestion.ashx?mode=bindHot2",
               success: function (msg) {
                   $(".bindhot").html(msg);
               }
           });
       }
       function ajaxnew() {
           $.ajax({
               type: "post",
               url: "ashx/Addquestion.ashx?mode=bindNew",
               success: function (msg) {
                   $(".bindnew").html(msg);
               }
           });
       }
       function ajaxnewall() {
           $.ajax({
               type: "post",
               url: "ashx/Addquestion.ashx?mode=bindNew2",
               success: function (msg) {
                   $(".bindnew").html(msg);

               }
           });
       }
       setInterval(ajaxhot, 5000);
       setInterval(ajaxnew, 5000);
      
   });
    </script>
    
</head>
<body>

    <form id="form1" runat="server">
  <DIV id="header">
<TABLE>
  <TBODY>
  <TR>
    <TD><A href="http://edu.haitian.com.cn/"><IMG alt="海天集团" src="images/m-logo.gif"></A></TD></TR></TBODY></TABLE></DIV>
<P class="title">欢迎来到海天手机网！</P>
<DIV class="content">
<FORM method="post" action="/m/login">
<DIV>手机号：<BR><INPUT id="mobile" name="mobile" type="text" maxlength="11" onkeyup="value=value.replace(/[^\d]/g,'')"><span style="display: none; color:Red;" id="msg_tel_err"> </span><input type="hidden" id="is-reg-mobile" value="abc" />
</DIV>
<DIV>你的问题(50个字符)：<BR><textarea  id="question" cols="20" name="question" rows="2" maxlength="50" ></textarea></DIV>
<DIV><INPUT class="button" value="提交" type="button" onclick="addquestion();"></DIV><div class="subSuccess"></div></FORM></DIV>
<P class="title title-bar">热门问题&nbsp; &nbsp;&nbsp;&nbsp;<a href="#" id="hotmore"><<更多</a></P>
<MARQUEE style="WIDTH: 250px; HEIGHT: 100px" scrollAmount=1 direction=up>
<div class="bindhot">
</div>
</MARQUEE>

<BR>
<P class="title title-bar">最新问题&nbsp; &nbsp;&nbsp;&nbsp;<a href="#" id="newmore"><<更多</a></P>
<MARQUEE style="WIDTH: 250px; HEIGHT: 100px" scrollAmount=1 direction=up>
<div class="bindnew">
</div>
</MARQUEE>
<BR>
<P class="title title-bar">在海天，你可以：</P>
<P>享受一流的IT技术服务<BR>体验权威的IT培训课程！<BR>成为全球优秀厂商的合作伙伴<BR>实现IT信息化建设的全面提升
！</P>
<DIV id="ft">海天集团 © 2011 </DIV>
    </form>
</body>
</html>
