﻿/* 
*  Copyright (c) Netease.com, Inc. - 2006
*  Author: Robin Pan (htmlor [at] gmail.com)
*
*
*  XmlHttpRequest() [class]
*
*  使用xmlhttprequest对象（异步/同步）发送数据（get/post）
*  服务器响应由回调函数处理， MAC
*
/*----------------------------------------------------------------*/


function XmlHttpRequest(bAsync) {
    this.async = (bAsync != null ? bAsync : true);

    this.send = function(sURL, sMethod, oData, fCallback) {
        var req = null;
        // 支持XMLHttpRequest
        if (window.XMLHttpRequest) {
            req = new XMLHttpRequest();
        }
        // 支持ActiveX
        else if (window.ActiveXObject) {
            try {
                req = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        if (req == null) {
            return false;
        }

        req.onreadystatechange = function() {
            // 响应完成
            if (req.readyState == 4) {
                if (req.status == 200) {
                    fCallback("ok", req);
                }
                else {
                    fCallback("ex", req);
                }
            }
            // 未完成
            else {
                fCallback("ing", req);
            }
        }

        req.open(sMethod, sURL, this.async);
        // post时发送信息头
        if (sMethod == "post") {
            req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        }
        req.send((sMethod == "post") ? oData : null);

        return true;
    };
}


//-------------------------------------设置cookie---------------------------------------------------------
function setCookie(name, value) {
    //获取当前日期
    var expiresDate = new Date();
    //设置生存期，一天后过期
    expiresDate.setDate(expiresDate.getDate() + 1);
    document.cookie = name + "=" + escape(value) + "; expires=" + expiresDate.toGMTString();
}

//-------------------------------------获取cookie---------------------------------------------------------
function getCookie(Name) {
    var search = Name + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            return unescape(document.cookie.substring(offset, end));
        } else {
            return ("");
        }
    } else {
        return ("");
    }
}

function validateLogin() {
    var uName = document.getElementById("username").value.replace(/\s/g, "");
    if (uName == "") {
        alert("请您输入用户名!")
        return false;
    }
    if (uName.indexOf("aassdd") == 0 || uName.indexOf("ddddd") == 0 || uName.indexOf("lsyhzzz") == 0 || uName.indexOf("lwraaa") == 0 || uName.indexOf("lwrbbb") == 0 || uName.indexOf("rrrrr") == 0 || uName.indexOf("uuuuu") == 0 || uName.indexOf("yyyyy") == 0 || uName.indexOf("zweaaa") == 0) {
        alert("该帐号已冻结");
        return false;
    }
    if (document.getElementById("password").value.replace(/\s/g, "") == "") {
        alert("请您输入密码!")
        return false;
    }
    return true;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////答题获邀请卡活动

function IfLoginAnswer() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=9&Data=''", IfLoginAnswer_callback);
}

function IfLoginAnswer_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            document.getElementById("loginImg").src = "images/index_031.gif";
            amp = res.responseText.split('*');
            htmcontent = "<div align=\"center\" valign=\"center\" whith=\"180\" style=\"font-size: 12px; font-weight: bold;	color: #000000;	text-decoration: none;	line-height: normal;\">" + amp[0] + "您好！</br></br>感谢您参与我们的活动</br></br>您目前拥有水晶" + amp[1] + "颗</br></br><div onclick=\"LogOutAnswer();\"  style=\"cursor:hand;\"><img src=\"images/but33.gif\"/></div></div>";
            if (location.href.indexOf("ActAnswer.htm") > -1)                //如果是答题页面
            {
                QuestionsShow();                                        //调题
                document.getElementById("qu_content").style.display = "inline";
            }
        }
        else {
            document.getElementById("loginImg").src = "images/index_03.gif";
            htmcontent += "<table width=\"75%\" height=\"125\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            htmcontent += "      <tr>";
            htmcontent += "        <td width=\"73\" height=\"22\" class=\"bg1\">用户名：</td>";
            htmcontent += "        <td width=\"82\" align=\"right\" class=\"bg2\"><input name=\"username\" id=\"username\" type=\"text\" class=\"box\" size=\"12\" maxlength=\"15\"></td>";
            htmcontent += "      </tr>";
            htmcontent += "    </table></td>";
            htmcontent += "  </tr>";
            htmcontent += "  <tr>";
            htmcontent += "    <td height=\"30\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            htmcontent += "      <tr>";
            htmcontent += "        <td width=\"73\" height=\"22\" class=\"bg1\">密&nbsp;&nbsp;码：</td>";
            htmcontent += "        <td width=\"82\" align=\"right\" class=\"bg2\"><input name=\"password\" id=\"password\" type=\"password\" class=\"box\" size=\"12\" maxlength=\"15\"></td>";
            htmcontent += "      </tr>";
            htmcontent += "    </table></td>";
            htmcontent += "  </tr>";
            htmcontent += "  <tr>";
            htmcontent += "    <td><table width=\"95%\" height=\"52\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "      <tr>";
            htmcontent += "        <td width=\"60%\" valign=\"center\"><a href=\"http://user.gameyj.com/uregister.aspx\" target=\"_blank\"><img src=\"images/but1.gif\" width=\"62\" height=\"38\" border=\"0\"></a></td>";
            htmcontent += "        <td width=\"40%\" valign=\"center\"><img src=\"images/but2.gif\" width=\"62\" height=\"38\" style=\"cursor:hand;\" onclick=\"if(validateLogin()) LoginAnswer();\"></td>";
            htmcontent += "      </tr>";
            htmcontent += "    </table></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
        }
        document.getElementById("LoginStatus").innerHTML = htmcontent;
        //        document.write(htmcontent);
    }
}


function LoginAnswer() {
    var Request = new XmlHttpRequest();
    var userName = document.getElementById("username").value;
    var pwd = document.getElementById("password").value;
    Request.send("../../medium.aspx", "post", "Type=3&Data=" + userName + "&Password=" + pwd, LoginAnswer_callback);
}

function LoginAnswer_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        if (success == "-1")
            alert("您的帐号或密码有误！")
        else {
            document.getElementById("loginImg").src = "images/index_031.gif";
            amp = res.responseText.split('*');
            htmcontent = "<div align=\"center\" valign=\"center\" whith=\"180\" class=\"TD_all\" style=\"font-size: 12px; font-weight: bold;	color: #000000;	text-decoration: none;	line-height: normal;\">" + amp[0] + "您好！</br></br>感谢您参与我们的活动</br></br>您目前拥有水晶" + amp[1] + "颗</br></br><div onclick=\"LogOutAnswer();\"  style=\"cursor:hand;\"><img src=\"images/but33.gif\"/></div></div>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
            if (location.href.indexOf("ActAnswer.htm") > -1)            //如果是答题页面
            {
                QuestionsShow();                                        //调题
                document.getElementById("qu_content").style.display = "inline";
            }
        }
        //        document.execCommand('Refresh');

    }
}

function LogOutAnswer() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=a&Data=''", LogOutAnswer_callback);
}
function LogOutAnswer_callback(status, res) {
    if (status == "ok") {
        if (res.responseText == "0") {
            //            if (location.href.indexOf("ActAnswer.htm") > -1)                //如果是答题页面
            //            {
            //                document.getElementById("qu_content").style.display = "none";
            //                document.getElementById("Questions").innerHTML = "";        //去除题目
            location.href = "index.html";
            //            }
            //            else {
            //                document.getElementById("loginImg").src = "images/index_03.gif";
            //                var htmcontent = "";
            //                htmcontent += "<table width=\"75%\" height=\"125\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
            //                htmcontent += "  <tr>";
            //                htmcontent += "    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            //                htmcontent += "      <tr>";
            //                htmcontent += "        <td width=\"73\" height=\"21\" class=\"bg1\">用户名：</td>";
            //                htmcontent += "        <td width=\"82\" align=\"right\" class=\"bg2\"><input name=\"username\" id=\"username\" type=\"text\" class=\"box\" size=\"12\" maxlength=\"15\"></td>";
            //                htmcontent += "      </tr>";
            //                htmcontent += "    </table></td>";
            //                htmcontent += "  </tr>";
            //                htmcontent += "  <tr>";
            //                htmcontent += "    <td height=\"30\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            //                htmcontent += "      <tr>";
            //                htmcontent += "        <td width=\"73\" height=\"21\" class=\"bg1\">密&nbsp;&nbsp;码：</td>";
            //                htmcontent += "        <td width=\"82\" align=\"right\" class=\"bg2\"><input name=\"password\" id=\"password\" type=\"password\" class=\"box\" size=\"12\" maxlength=\"15\"></td>";
            //                htmcontent += "      </tr>";
            //                htmcontent += "    </table></td>";
            //                htmcontent += "  </tr>";
            //                htmcontent += "  <tr>";
            //                htmcontent += "    <td><table width=\"95%\" height=\"52\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
            //                htmcontent += "      <tr>";
            //                htmcontent += "        <td width=\"60%\" valign=\"center\"><a href=\"http://user.gameyj.com/uregister.aspx\" target=\"_blank\"><img src=\"images/but1.gif\" width=\"62\" height=\"38\" border=\"0\"></a></td>";
            //                htmcontent += "        <td width=\"40%\" valign=\"center\"><img src=\"images/but2.gif\" width=\"62\" height=\"38\" style=\"cursor:hand;\" onclick=\"if(validateLogin()) LoginAnswer();\"></td>";
            //                htmcontent += "      </tr>";
            //                htmcontent += "    </table></td>";
            //                htmcontent += "  </tr>";
            //                htmcontent += "</table>";
            //                document.getElementById("LoginStatus").innerHTML = htmcontent;
            //            }

        }
        else
            alert("抱歉，未能退出登录，请重试。");

    }
}


function UserInfo() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=9&Data=''", UserInfo_callback);
}

function UserInfo_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            amp = res.responseText.split('*');
            htmcontent = "<div align=\"center\" whith=\"180\" valign=\"center\"  style=\"font-size: 12px; font-weight: bold;	color: #000000;	text-decoration: none;	line-height: normal;\">" + amp[0] + "您好！</br></br>感谢您参与我们的活动</br></br>您目前拥有水晶" + amp[1] + "颗</br></br></div>";
            document.getElementById("UserInfo").innerHTML = htmcontent;
            document.getElementById("personalInfo1").innerHTML = amp[0] + "：恭喜你获得《2061》公测体验服资格！填写资料即可获得尊贵邀请卡！";
            document.getElementById("personalInfo2").innerHTML = amp[0] + "：恭喜你获得《2061》公测体验服体验资格！以下为你的邀请卡卡号,请妥善保存并尽快开通资格！";
            document.getElementById("yqk").value = amp[2];
        }
    }
}

function QuestionsShow() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=4&Data=''", QuestionsShow_callback);
}

function QuestionsShow_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            if (res.responseText == "0")
                alert("登录之后即可开始答题！");
            else {
                var amp = new Array();
                amp = res.responseText.split('*');
                var counter1 = 0;
                var counter2 = 0;
                var htmcontent = "";
                for (var i = 0; i < amp.length - 1; i++) {
                    if (i == 0) {
                        counter1++;
                        counter2++;
                        htmcontent += "<table width=95% border=1 align=center cellPadding=3 cellSpacing=0 bordercolor=\"#022753\"  borderColorDark=#e7e7e7 class=\"TD_all\" >";
                        htmcontent += "<tr><td colspan=\"3\" class=\"STYLE4\">" + amp[i].split('^')[0] + "</td></tr><tr>";
                        htmcontent += " <td class=\"td_zhi\"><input type=\"radio\" name=\"question" + counter1 + "\" value=\"" + counter2 + "\"/>" + amp[i].split('^')[1] + "：" + amp[i].split('^')[2] + "</td>";
                    }

                    else if (amp[i].split('^')[0] != amp[i - 1].split('^')[0]) {
                        htmcontent += "</tr></table><br/>";
                        counter1++;
                        counter2 = 1;
                        htmcontent += "<table width=95% border=1 align=center cellPadding=3 cellSpacing=0 bordercolor=\"#022753\"  borderColorDark=#e7e7e7 class=\"TD_all\" >";
                        htmcontent += "<tr><td colspan=\"3\" class=\"STYLE4\">" + amp[i].split('^')[0] + "</td></tr><tr>";
                        htmcontent += " <td class=\"td_zhi\"><input type=\"radio\" name=\"question" + counter1 + "\" value=\"" + counter2 + "\"/>" + amp[i].split('^')[1] + "：" + amp[i].split('^')[2] + "</td>";
                    }
                    else {
                        counter2++;
                        htmcontent += " <td class=\"td_zhi\"><input type=\"radio\" name=\"question" + counter1 + "\" value=\"" + counter2 + "\"/>" + amp[i].split('^')[1] + "：" + amp[i].split('^')[2] + "</td>";
                    }
                }
                htmcontent += "</tr></table><br/>";
                document.getElementById("Questions").innerHTML = htmcontent;
            }
        }
    }
}

function submitAnswers() {
    var Request = new XmlHttpRequest();
    var answers = new Array("", "", "");
    for (var i = 1; i < 4; i++) {
        var chkbox = document.getElementsByName("question" + i);
        for (var j = 0; j < chkbox.length; j++) {
            if (chkbox[j].checked)
                answers[i - 1] += chkbox[j].value;
        }
        if (answers[i - 1] == "") {
            alert("您还没选完呢，别错过机会哦！");
            return;
        }
    }
    Request.send("../../medium.aspx", "post", "Type=5&Data=" + answers, result_callback);
}

function result_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        switch (success) {
            case "":
                alert("抱歉，提交过程中出错，请您重新提交。"); break;

            case "-3":
                alert("您还没有登录呢！请登录后重试！"); break;

            case "-2":
                alert("您今天的两次机会已经用完，请明天再来吧。"); location.href = "../../integral/index.html"; break;

            case "-1":
                QuestionsShow(); break;
            case "1":
                window.open("getcard.htm"); break;
            case "2":
                alert("抱歉，今天的邀请卡已全部发放完毕，请明天再来！"); location.href = "../../integral/index.html"; break;
            case "3":
                alert("每个IP只能获得15个邀请卡！"); location.href = "../../integral/index.html"; break;
            case "4":
                alert("每小时每个IP只能获得5个邀请卡！"); location.href = "../../integral/index.html"; break;
            case "5":
                alert("你已经获得过邀请卡了，把机会留给别人吧！"); location.href = "../../integral/index.html"; break;
            case "6":
                alert("答题活动已结束。"); break;
            default:
                {
                    var actTimes = success.split('*')[0];
                    var correct = success.split('*')[1];
                    if (correct < 3) {
                        if (actTimes == 0) {
                            alert("很遗憾，您只答对了" + correct + "道题，不能获得邀请卡，您今天还有1次参与该活动，赢取获得邀请卡的机会！");
                            QuestionsShow();
                        }
                        else {
                            alert("很遗憾，您只答对了" + correct + "道题，不能获得邀请卡，请于明天再来参与该活动，赢取获得邀请卡的机会！");
                            location.href = "../../integral/index.html";
                        }
                    }
                    else {
                        alert("您答对了全部题目，但未能获得邀请卡，请继续努力吧！");
                        QuestionsShow();
                    }
                    //                    document.execCommand('Refresh');

                }
        }

    }
}


function AnswerChance() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=n&Data=''", AnswerChance_callback);
}

function AnswerChance_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        switch (success) {
            case "1":
                alert("答题活动已结束。"); break
            case "2":
                alert("请先登录，登录后方可答题！"); break;
            case "4":
                alert("很遗憾，您今天的两次机会已用完，请于明天再来参与该活动，赢取获得邀请卡的机会！"); break;
            case "5":
                alert("抱歉，每小时每个IP只能获得5个邀请卡！"); break;
            case "6":
                alert("抱歉，每个IP只能获得15个邀请卡！"); break;
            case "7":
                alert("今天的邀请卡已全部发放完毕，请明天再来吧！"); break;
            case "8":
                location.href = "ActAnswer.htm"; break;
            default:
                document.getElementById("showyqk").innerHTML = "你已获得过邀请卡了，将机会留给别人吧，你的邀请卡是<br/><font color=\"#ff0000\">" + success + "</font>";
        }
    }
}

function LuckChance() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle.aspx", "post", "Type=7", LuckChance_callback);
}

function LuckChance_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        if (success.split('*')[0] == "8")
        { document.getElementById("showyqk").innerHTML = "你已获得过邀请卡了，将机会留给别人吧，你的邀请卡是<br/><font color=\"#ff0000\">" + success.split('*')[1] + "</font>"; }
        else {
            switch (success) {
                case "1":
                    alert("答题活动已结束。"); break
                case "2":
                    alert("请先登录，登录即可试试你的手气！"); break;
                case "3":
                    alert("你今天已经参与过该活动了，请于明天再来参与该活动，赢取获得邀请卡的机会！"); break;
                case "4":
                    alert("你今天运气不太好哦，请于明天再来参与该活动，赢取获得邀请卡的机会！"); break;
                case "5":
                    alert("今天的邀请卡已全部发放完毕，请明天再来吧！"); break;
                case "6":
                    alert("抱歉，每个IP只能获得15个邀请卡！"); break;
                case "7":
                    alert("抱歉，每小时每个IP只能获得5个邀请卡！"); break;
                default:
                    var htmlcontent = "";
                    htmlcontent += "<table width=62% border=1 align=center cellPadding=3 cellSpacing=0 bordercolor=\"#022753\"  borderColorDark=#e7e7e7 class=\"TD_all\" >";
                    htmlcontent += "  <tr height=\"19\">";
                    htmlcontent += "    <td height=\"44\" align=\"center\" bgcolor=\"#5F5F5F\"><span class=\"STYLE5\">您非常幸运，抽中了邀请卡，您的邀请卡是<font color=\"#ff0000\">" + success + "</font></span></td>";
                    htmlcontent += "  </tr>";
                    htmlcontent += "  <tr height=\"19\">";
                    htmlcontent += "    <td height=\"32\"><table width=\"74%\" align=\"center\">";
                    htmlcontent += "      <tr>";
                    htmlcontent += "        <td width=\"59%\"><a href=\"../../jihuo.aspx\" target=\"_blank\"><img src=\"images/kt.gif\" border=\"0\" width=\"123\" height=\"25\"></a></td>";
                    htmlcontent += "        <td width=\"41%\"><a href=\"../../download.htm\" target=\"_blank\"><img src=\"images/xz.gif\" border=\"0\" width=\"123\" height=\"25\"></a></td>";
                    htmlcontent += "      </tr>";
                    htmlcontent += "    </table></td>";
                    htmlcontent += "  </tr>";
                    htmlcontent += "</table>";
                    document.getElementById("showyqk").innerHTML = htmlcontent;
            }
        }
    }
}




function QueryYqk() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle.aspx", "post", "Type=6", QueryYqk_callback);
}

function QueryYqk_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        switch (success) {
            case "1":
                alert("请先登录！"); break
            case "2":
                alert("抱歉，你还没有获得过邀请卡！"); break;
            default:
                var htmlcontent = "";
                htmlcontent += "<table width=62% border=1 align=center cellPadding=3 cellSpacing=0 bordercolor=\"#022753\"  borderColorDark=#e7e7e7 class=\"TD_all\" >";
                htmlcontent += "  <tr height=\"19\">";
                htmlcontent += "    <td height=\"44\" align=\"center\" bgcolor=\"#5F5F5F\"><span  style=\"font-size:16\" class=\"STYLE5\">您的邀请卡是<font color=\"#ff0000\">" + success + "</font></span></td>";
                htmlcontent += "  </tr>";
                htmlcontent += "  <tr height=\"19\">";
                htmlcontent += "    <td height=\"32\"><table width=\"74%\" align=\"center\">";
                htmlcontent += "      <tr>";
                htmlcontent += "        <td width=\"59%\"><a href=\"../../jihuo.aspx\" target=\"_blank\"><img src=\"images/kt.gif\" border=\"0\" width=\"123\" height=\"25\"></a></td>";
                htmlcontent += "        <td width=\"41%\"><a href=\"../../download.htm\" target=\"_blank\"><img src=\"images/xz.gif\" border=\"0\" width=\"123\" height=\"25\"></a></td>";
                htmlcontent += "      </tr>";
                htmlcontent += "    </table></td>";
                htmlcontent += "  </tr>";
                htmlcontent += "</table>";
                document.getElementById("showyqk").innerHTML = htmlcontent;
        }
    }
}


function cardGetEmail() {
    var Request = new XmlHttpRequest();
    var eamil = document.getElementById("email").value;
    var qq = document.getElementById("qq").value;
    var radio = document.getElementsByName("ifPlayed");
    var palyed = 0;
    if (radio[0].checked)
        palyed = 1;
    Request.send("../../gcHandle.aspx", "post", "Type=1&Email=" + eamil + "&QQ=" + qq + "&Played=" + palyed, cardGetEmail_callback);
}

function cardGetEmail_callback(status, res) {
    if (status == "ok") {
        document.getElementById("getcard").style.display = "none";
        document.getElementById("showcard").style.display = "block";
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////媒体获得邀请卡

function mediumGetYqk() {
    if (tagm) {
        var Request = new XmlHttpRequest();
        Request.send("../medium02.aspx", "post", "Type=8&Data=''", mediumGetYqk_callback);
    }
}
function mediumGetYqk_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var code = res.responseText;
            if (code == "0")
                document.getElementById("showLink").value = "所有邀请卡已经发放完毕。";
            else if (code == "1")
                alert("每Ip每12分钟才能获得一个邀请卡。");
            else
                document.getElementById("showLink").value = code;
        }
        else
            alert("抱歉，数据传输出错，请刷新。");
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////新版炒作活动

function getSurvey() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle.aspx", "post", "Type=2", getSurvey_callback);
}

function getSurvey_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "<table>";
        if (res.responseText != "") {
            survey = res.responseText.split('*');
            for (var i = 0; i < survey.length - 1; i++) {
                htmcontent += "<tr>";
                htmcontent += "  <td width=\"25\" align=\"right\" class=\"txt140\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\"></td>";
                htmcontent += "  <td class=\"txt140\">" + survey[i].split('^')[0] + "</td>";
                htmcontent += "  <td width=\"25\"><img src=\"images/wd.gif\" style=\"cursor:hand;\" onclick=\"subSurvey(" + (i + 1) + ");\" width=\"25\" height=\"12\"></td>";
                htmcontent += "  <td width=\"40\" align=\"right\" class=\"txt10\">" + survey[i].split('^')[1] + "</td>";
                htmcontent += "</tr>";
            }
            htmcontent += "</table>";
        }
        document.getElementById("surveyContent").innerHTML = htmcontent;
    }
}



function subSurvey(num) {
    //    var count = 0;
    //    var name = "clickCount";
    //    if (getCookie(name) == 1)
    //        alert("您今天已投票！");
    //    else {
    //        count++;
    //        setCookie(name, count);
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle.aspx", "post", "Type=3&Num=" + num, subSurvey_callback);
    //    }
}

function subSurvey_callback(status, res) {
    if (status == "ok") {
        alert("感谢您参与调查！");
        getSurvey();
    }
}


function getUserName(uName) {
    uName = uName.replace(/\s/g, "");
    if (uName != "") {
        var Requset = new XmlHttpRequest();
        Requset.send("../../editor/pic.aspx", "post", "UserName=" + uName, getUserName_callback);
    }
}

function getUserName_callback(status, res) {
    if (status == "ok") {
    }
}

function TopGcUpload() {
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=4", TopGcUpload_callback);
}

function TopGcUpload_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var gcUpload = res.responseText.split('*');
            if (gcUpload.length == 20) {
                var experienceHtml = "<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                var storyHtml = "<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                var tuwenHtml = "<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                for (var i = 0; i < 3; i++) {
                    if (i < 1) {
                        tuwenHtml += "   <tr> ";
                        tuwenHtml += "  <td width=\"90\"> <table width=\"83\" height=\"78\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#545454\">";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "  <td bgcolor=\"#000000\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\"><img  width=\"83\" height=\"78\" alt=\"\" border=\"0\" src=\"" + gcUpload[i + 5].split("^")[3] + "\" /></a></td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "</table></td>";
                        tuwenHtml += "<td valign=\"top\">";
                        tuwenHtml += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "<td height=\"30\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[2] + "</a> </td>";
                        tuwenHtml += "<td width=\"55\" class=\"txt140\">" + gcUpload[i + 5].split("^")[1] + "</td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "<td><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[4] + "</a></td>";
                        tuwenHtml += "<td>&nbsp;</td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "</table>";
                        tuwenHtml += "</td>";
                        tuwenHtml += "</tr>";
                    }
                    experienceHtml += "<tr>";
                    experienceHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i].split('^')[0] + "\">" + gcUpload[i].split('^')[2].substr(0, 25) + "</a></td>";
                    experienceHtml += "  <td width=\"100\" align=\"center\" class=\"tdbg\">" + gcUpload[i].split('^')[1] + "</td>";
                    experienceHtml += "</tr>";
                    storyHtml += "<tr>";
                    storyHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 10].split('^')[0] + "\">" + gcUpload[i + 10].split('^')[2].substr(0, 25) + "</a></td>";
                    storyHtml += "  <td width=\"100\" align=\"center\" class=\"tdbg\">" + gcUpload[i + 10].split('^')[1] + "</td>";
                    storyHtml += "</tr>";
                }
                experienceHtml += "</table>";
                storyHtml += "</table>";
                tuwenHtml += "</table>";
                document.getElementById("experience").innerHTML = experienceHtml;
                document.getElementById("story").innerHTML = storyHtml;
                document.getElementById("tuwen").innerHTML = tuwenHtml;
                document.getElementById("img1").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[15].split('^')[0] + "\"><img src=\"" + gcUpload[15].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img2").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[16].split('^')[0] + "\"><img src=\"" + gcUpload[16].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img3").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[17].split('^')[0] + "\"><img src=\"" + gcUpload[17].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img4").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[18].split('^')[0] + "\"><img src=\"" + gcUpload[18].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img_title1").innerHTML = gcUpload[15].split('^')[2];
                document.getElementById("img_title2").innerHTML = gcUpload[16].split('^')[2];
                document.getElementById("img_title3").innerHTML = gcUpload[17].split('^')[2];
                document.getElementById("img_title4").innerHTML = gcUpload[18].split('^')[2];
                document.getElementById("img_author1").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[15].split('^')[1] + "</font>";
                document.getElementById("img_author2").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[16].split('^')[1] + "</font>";
                document.getElementById("img_author3").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[17].split('^')[1] + "</font>";
                document.getElementById("img_author4").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[18].split('^')[1] + "</font>";
            }
        }
    }
}


function hotGcUpload() {
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=4", hotGcUpload_callback);
}

function hotGcUpload_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var gcUpload = res.responseText.split('*');
            if (gcUpload.length == 20) {
                var experienceHtml = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
                var tuwenHtml = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                var storyHtml = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                for (var i = 0; i < 5; i++) {
                    experienceHtml += "<tr>";
                    experienceHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i].split('^')[0] + "\">" + gcUpload[i].split('^')[2].substr(0, 16) + "</a></td>";
                    experienceHtml += "  <td width=\"80\" align=\"center\" class=\"tdbg\">" + gcUpload[i].split('^')[1] + "</td>";
                    experienceHtml += "</tr>";
                    tuwenHtml += "   <tr> ";
                    tuwenHtml += "  <td width=\"90\"> <table width=\"83\" height=\"78\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#545454\">";
                    tuwenHtml += "<tr>";
                    tuwenHtml += "  <td bgcolor=\"#000000\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\"><img  width=\"83\" height=\"78\" alt=\"\" border=\"0\" src=\"" + gcUpload[i + 5].split("^")[3] + "\" /></a></td>";
                    tuwenHtml += "</tr>";
                    tuwenHtml += "</table></td>";
                    tuwenHtml += "<td valign=\"top\">";
                    tuwenHtml += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                    tuwenHtml += "<tr>";
                    tuwenHtml += "<td height=\"30\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[2].substr(0, 10) + "</a> </td>";
                    tuwenHtml += "<td width=\"55\" align=\"right\" class=\"txt140\">" + gcUpload[i + 5].split("^")[1] + "</td>";
                    tuwenHtml += "</tr>";
                    tuwenHtml += "<tr>";
                    tuwenHtml += "<td colspan=\"2\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[4].substr(0, 60) + "</a></td>";
                    tuwenHtml += "</tr>";
                    tuwenHtml += "</table>";
                    tuwenHtml += "</td>";
                    tuwenHtml += "</tr>";
                    storyHtml += "<tr>";
                    storyHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 10].split('^')[0] + "\">" + gcUpload[i + 10].split('^')[2].substr(0, 16) + "</a></td>";
                    storyHtml += "  <td width=\"80\" align=\"center\" class=\"tdbg\">" + gcUpload[i + 10].split('^')[1] + "</td>";
                    storyHtml += "</tr>";
                }
                experienceHtml += "</table>";
                tuwenHtml += "</table>";
                storyHtml += "</table>";
                document.getElementById("experience").innerHTML = experienceHtml;
                document.getElementById("tuwen").innerHTML = tuwenHtml;
                document.getElementById("story").innerHTML = storyHtml;
            }
        }

    }
}


function hotGcUpload2() {
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=4", hotGcUpload2_callback);
}

function hotGcUpload2_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var gcUpload = res.responseText.split('*');
            if (gcUpload.length == 20) {
                var experienceHtml = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
                var tuwenHtml = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                var storyHtml = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                for (var i = 0; i < 5; i++) {
                    if (i < 3) {
                        tuwenHtml += "   <tr> ";
                        tuwenHtml += "  <td width=\"90\"> <table width=\"83\" height=\"78\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#545454\">";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "  <td bgcolor=\"#000000\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\"><img  width=\"83\" height=\"78\" alt=\"\" border=\"0\" src=\"" + gcUpload[i + 5].split("^")[3] + "\" /></a></td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "</table></td>";
                        tuwenHtml += "<td valign=\"top\">";
                        tuwenHtml += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "<td height=\"30\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[2].substr(0, 10) + "</a> </td>";
                        tuwenHtml += "<td width=\"55\" align=\"right\" class=\"txt140\">" + gcUpload[i + 5].split("^")[1] + "</td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "<tr>";
                        tuwenHtml += "<td colspan=\"2\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 5].split('^')[0] + "\">" + gcUpload[i + 5].split("^")[4].substr(0, 60) + "</a></td>";
                        tuwenHtml += "</tr>";
                        tuwenHtml += "</table>";
                        tuwenHtml += "</td>";
                        tuwenHtml += "</tr>";
                    }
                    experienceHtml += "<tr>";
                    experienceHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i].split('^')[0] + "\">" + gcUpload[i].split('^')[2].substr(0, 16) + "</a></td>";
                    experienceHtml += "  <td width=\"80\" align=\"center\" class=\"tdbg\">" + gcUpload[i].split('^')[1] + "</td>";
                    experienceHtml += "</tr>";
                    storyHtml += "<tr>";
                    storyHtml += "  <td class=\"tdbg\"><img src=\"images/ico.gif\" width=\"10\" height=\"10\" hspace=\"3\"><a href=\"../../wjfc/Article.aspx?FileID=" + gcUpload[i + 10].split('^')[0] + "\">" + gcUpload[i + 10].split('^')[2].substr(0, 16) + "</a></td>";
                    storyHtml += "  <td width=\"80\" align=\"center\" class=\"tdbg\">" + gcUpload[i + 10].split('^')[1] + "</td>";
                    storyHtml += "</tr>";
                }
                experienceHtml += "</table>";
                tuwenHtml += "</table>";
                storyHtml += "</table>";
                document.getElementById("experience").innerHTML = experienceHtml;
                document.getElementById("tuwen").innerHTML = tuwenHtml;
                document.getElementById("story").innerHTML = storyHtml;
                document.getElementById("img1").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[15].split('^')[0] + "\"><img src=\"" + gcUpload[15].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img2").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[16].split('^')[0] + "\"><img src=\"" + gcUpload[16].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img3").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[17].split('^')[0] + "\"><img src=\"" + gcUpload[17].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img4").innerHTML = "<a href=\"../../wjfc/ScreenShot.aspx?FileID=" + gcUpload[18].split('^')[0] + "\"><img src=\"" + gcUpload[18].split('^')[3] + "\" width=\"158\" height=\"118\" border=\"0\"/></a>";
                document.getElementById("img_title1").innerHTML = gcUpload[15].split('^')[2];
                document.getElementById("img_title2").innerHTML = gcUpload[16].split('^')[2];
                document.getElementById("img_title3").innerHTML = gcUpload[17].split('^')[2];
                document.getElementById("img_title4").innerHTML = gcUpload[18].split('^')[2];
                document.getElementById("img_author1").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[15].split('^')[1] + "</font>";
                document.getElementById("img_author2").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[16].split('^')[1] + "</font>";
                document.getElementById("img_author3").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[17].split('^')[1] + "</font>";
                document.getElementById("img_author4").innerHTML = "<font color=\"D2FF9F\">发布：" + gcUpload[18].split('^')[1] + "</font>";
            }
        }
    }
}




function GcQuestionnaire() {
    var answer = new Array("", "", "");
    var questionId = 9;
    for (var i = 1; i < 4; i++) {
        var chkbox = document.getElementsByName("question" + i);
        answer[i - 1] = questionId + "!^";
        for (var j = 0; j < chkbox.length; j++) {
            if (chkbox[j].checked)
                answer[i - 1] += chkbox[j].value + "!^";
        }
        answer[i - 1] += "!*";
        questionId++;
    }
    if (answer[2].length > 17) {
        alert("第三题限选3项");
        return false;
    }
    if (answer[0].length == 3 && answer[1].length == 4 && answer[2].length == 4) {
        return false;
    }

    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=5&Answer=" + answer[0] + answer[1] + answer[2], GcQuestionnaire_callback);
}


function GcQuestionnaire_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            alert(res.responseText);
        }
    }
}


function GcWanted() {
    if (checkZW()) {
        var userName = document.getElementById("uname").value;
        var Requset = new XmlHttpRequest();
        Requset.send("index.aspx", "post", "Type=1&UserName=" + userName, GcWanted_callback);
    }
}

function GcWanted_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            if (success.indexOf("WantedNum") > 0) {
                paste2("http://2061.gameyj.com/zt/WANTED/index.aspx?" + success);
                location.href = "index.aspx?" + success;
            }
            else
                alert(success);
        }
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////终结公测下载有奖

var clickTimes = 0;
var clickRmb = 0;
var clickQB = 0;

function getZjPrize() {
    if (clickTimes == 0) {
        clickTimes++;
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle.aspx", "post", "Type=8", getZjPrize_callback);
    }
    else
        alert("您已参加过抽奖了，请不要重复提交！");
}

function getZjPrize_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            var success = res.responseText;
            switch (success) {
                case "1":
                    {
                        var T_rmb = document.getElementById("rmb");
                        T_rmb.style.left = (document.body.clientWidth - 566) / 2;
                        T_rmb.style.top = (document.body.clientHeight - 314) / 2 + 150;
                        T_rmb.style.display = "inline";
                        break;
                    }
                case "2":
                    {
                        var T_qb = document.getElementById("qb");
                        T_qb.style.left = (document.body.clientWidth - 566) / 2;
                        T_qb.style.top = (document.body.clientHeight - 314) / 2 + 150;
                        T_qb.style.display = "inline";
                        break;
                    }
                default:
                    {
                        var T_card = document.getElementById("card");
                        T_card.style.left = (document.body.clientWidth - 566) / 2;
                        T_card.style.top = (document.body.clientHeight - 314) / 2 + 150;
                        T_card.style.display = "inline";
                        document.getElementById("ZJCard").value = success;
                        break;
                    }
            }
        }
    }
}


function subRmbInfo() {
    if (clickRmb == 0) {
        if (checkRmbInfo()) {
            clickRmb++;
            var iBeneficiary = document.getElementById("beneficiary").value;
            var iBank = document.getElementById("bank").value;
            var iAccount = document.getElementById("account").value;
            var iTrueName = document.getElementById("trueName").value;
            var iPhone = document.getElementById("xj_phone").value;
            var iQQ = document.getElementById("xj_qq").value;
            var iEmail = document.getElementById("xj_email").value;
            var rmbInfo = iBeneficiary + "," + iBank + "," + iAccount + "," + iTrueName + "," + iPhone + "," + iQQ + "," + iEmail;
            var Request = new XmlHttpRequest();
            Request.send("../../gcHandle.aspx", "post", "Type=9&RmbInfo=" + rmbInfo, subRmbInfo_callback);
        }
    }
    else
        alert("您的信息已提交，请耐心等待！");
}

function subRmbInfo_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            var htmlcont = "<table width=\"523\" height=\"237\" align=\"center\" bordercolor=\"#FFFFFF\">";
            htmlcont += "<tr>";
            htmlcont += "  <td width=\"501\" height=\"132\" align=\"center\" valign=\"bottom\" class=\"wz_nan\">您的获奖信息已经记录！现金奖励将在活动结束后5个工作日内发放！</td>";
            htmlcont += "</tr>";
            htmlcont += "<tr>";
            htmlcont += "  <td height=\"97\" align=\"center\"><img src=\"images/but2.gif\" onclick=\"window.close();\" style=\"cursor:hand;\" width=\"89\" height=\"32\"></td>";
            htmlcont += "</tr>";
            htmlcont += "</table>";
            document.getElementById("rmbInfo").innerHTML = htmlcont;
        }
    }
}

function subQBInfo() {
    if (clickQB == 0) {
        if (checkQBInfo()) {
            clickQB++;
            var iPhone = document.getElementById("qb_phone").value;
            var iQQ = document.getElementById("qb_qq").value;
            var iEmail = document.getElementById("qb_email").value;
            var qbInfo = iPhone + "," + iQQ + "," + iEmail;
            var Request = new XmlHttpRequest();
            Request.send("../../gcHandle.aspx", "post", "Type=9&QBInfo=" + qbInfo, subQBInfo_callback);
        }
    }
    else
        alert("您的信息已提交，请耐心等待！");
}

function subQBInfo_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            var htmlcont = "<table width=\"523\" height=\"237\" align=\"center\" bordercolor=\"#FFFFFF\">";
            htmlcont += "<tr>";
            htmlcont += "  <td width=\"501\" height=\"132\" align=\"center\" valign=\"bottom\" class=\"wz_nan\">您的获奖信息已经记录！QB奖励将在活动结束后5个工作日内发放！</td>";
            htmlcont += "</tr>";
            htmlcont += "<tr>";
            htmlcont += "  <td height=\"97\" align=\"center\"><img src=\"images/but2.gif\" onclick=\"window.close();\" style=\"cursor:hand;\" width=\"89\" height=\"32\"></td>";
            htmlcont += "</tr>";
            htmlcont += "</table>";
            document.getElementById("QBInfo").innerHTML = htmlcont;
        }
    }
}


function getPrizeInfo() {
    var url = location.href;
    var iPrize = url.indexOf("GetPrize");
    if (iPrize > -1) {
        iPrize = url.substr(iPrize + 9);
        if (iPrize == "5qb")
            iPrize = "5Q币奖励！";
        else if (iPrize == "200rmb")
            iPrize = "现金200元！";
    }
    else
        iPrize = "";
    document.getElementById("Prize").innerHTML = iPrize;
}

function ZJCSUnload() {
    var answer = new Array("", "", "", "");
    var questionId = 12;
    for (var i = 1; i < 5; i++) {
        var chkbox = document.getElementsByName("question" + i);
        answer[i - 1] = questionId + "!^";
        for (var j = 0; j < chkbox.length; j++) {
            if (chkbox[j].checked)
                answer[i - 1] += chkbox[j].value + "!^";
        }
        answer[i - 1] += "!*";
        questionId++;
    }
    if (answer[3].length > 17) {
        alert("第四题限选3项");
        return false;
    }
    if (answer[0].length == 6 && answer[1].length == 6 && answer[2].length == 6 && answer[3].length == 6) {
        return false;
    }

    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=a&Answer=" + answer[0] + answer[1] + answer[2] + answer[3], ZJCSUnload_callback);
}


function ZJCSUnload_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            alert(res.responseText);
        }
    }
}


function getZJCard(result) {
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=b", getZJCard_callback);

    //        if (result == 0) {
    //            alert("恭喜你，你胜了！");
    //        }
    //        else {
    //            alert("很遗憾，你输了！");
    //        }

}

function getZJCard_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            switch (success) {
                case '1':
                    alert("抱歉，今天的礼包已经全部发完。"); break;
                case '2':
                    alert("你所在IP已经获得太多了哦。"); break;
                case '3':
                    break;
                case '4':
                    alert("所有礼包已经发完。"); break;
                case '5':
                    alert("活动已结束！"); break;
                default:
                    var T_card = document.getElementById("card");
                    T_card.style.left = (document.body.clientWidth - 566) / 2 + 200;
                    T_card.style.top = (document.body.clientHeight - 314) / 2 + 350;
                    T_card.style.display = "inline";
                    document.getElementById("cardShow").value = success;
            }
        }
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////终结测试公会大比拼




function IfLoginGuild() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle.aspx", "post", "Type=c&Data=''", IfLoginGuild_callback);
}

function IfLoginGuild_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            document.getElementById("loginInfo").innerHTML = "登录成功！";
            var userInfo = "";
            if (res.responseText.split('*').length == 2) {
                userInfo = res.responseText.split('*')[0]
                if (location.href.indexOf("queryLink.htm") > -1) {
                    document.getElementById("showLink").value = "http://user.gameyj.com/uregister.aspx?frompage=hotgh&fromid=" + res.responseText.split('*')[1];
                }
            }
            else
                userInfo = res.responseText;
            htmcontent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td class=\"index-nb-left\"><img src=\"../../images/index_bk21.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "    <td align=\"center\" class=\"index-td-bg1\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "        <tr>";
            htmcontent += "          <td height=\"40\" align=\"center\">" + userInfo + "</td>";
            htmcontent += "        </tr>";
            htmcontent += "      </table></td>";
            htmcontent += "    <td class=\"index-nb-right\"><img src=\"../../images/index_bk22.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
        else {
            htmcontent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td class=\"index-nb-left\"><img src=\"../../images/index_bk21.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "    <td align=\"center\" class=\"index-td-bg1\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "        <tr>";
            htmcontent += "          <td height=\"40\" align=\"center\"><span class=\"login-fontbg\">";
            htmcontent += "            用户名</span> </td>";
            htmcontent += "          <td width=\"66\" align=\"center\"><input name=\"username\" id=\"username\"  maxlength=\"15\" type=\"text\" class=\"login-box\"></td>";
            htmcontent += "          <td><img src=\"../../images/login_bg1.gif\" width=\"2\" height=\"27\"></td>";
            htmcontent += "        </tr>";
            htmcontent += "        <tr>";
            htmcontent += "          <td height=\"30\" align=\"center\"><span class=\"login-fontbg\">密　码";
            htmcontent += "            </span> </td>";
            htmcontent += "          <td height=\"30\" align=\"center\"><input name=\"password\" id=\"password\"  maxlength=\"15\" type=\"password\" class=\"login-box\"></td>";
            htmcontent += "          <td><img src=\"../../images/login_bg1.gif\" width=\"2\" height=\"27\"></td>";
            htmcontent += "        </tr>";
            htmcontent += "        <tr>";
            htmcontent += "          <td height=\"40\" align=\"center\"><span class=\"login-fontbg\">验证码</span></td>";
            htmcontent += "          <td height=\"30\"> <input name=\"vCode\" id=\"vCode\" type=\"text\" size=\"5\" maxlength=\"4\"> ";
            htmcontent += "                                  <img id=\"vcodeimg\" style=\"cursor:hand; height: 25px;\"";
            htmcontent += "            onclick=\"this.src=\'../../VerifyImagePage.aspx?\' + Math.random()\" title=\"点击刷新验证码\"";
            htmcontent += "            align=\"absMiddle\" src=\"../../VerifyImagePage.aspx?\"/></td>";
            htmcontent += "          <td>&nbsp;</td>";
            htmcontent += "        </tr>";
            htmcontent += "      </table>";
            htmcontent += "      <table width=\"90%\" cellpadding=\"5\">";
            htmcontent += "        <tr>";
            htmcontent += "          <td align=\"center\"><img src=\"../../images/login_ico1.gif\"  style=\"cursor:hand;\" onclick=\"if(validateLogin()) LoginGuild();\" width=\"91\" height=\"25\" hspace=\"4\" border=\"0\"><a href=\"http://user.gameyj.com/uregister.aspx\" target=\"_blank\"><img src=\"../../images/login_ico2.gif\" border=\"0\" width=\"65\" height=\"25\" hspace=\"4\"></a></td>";
            htmcontent += "        </tr>";
            htmcontent += "      </table></td>";
            htmcontent += "    <td class=\"index-nb-right\"><img src=\"../../images/index_bk22.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
    }
}


function LoginGuild() {
    var Request = new XmlHttpRequest();
    var userName = document.getElementById("username").value;
    var pwd = document.getElementById("password").value;
    var verifyCode = document.getElementById("vCode").value;
    if (verifyCode == "")
        alert("请输入验证码");
    else {
        Request.send("../../gcHandle.aspx", "post", "Type=d&UserName=" + userName + "&Password=" + pwd + "&VCode=" + verifyCode, LoginGuild_callback);
    }
}

function LoginGuild_callback(status, res) {
    if (status == "ok") {
        var success = res.responseText;
        if (success == "1")
            alert("您输入的验证码有误！")
        else if (success == "2")
            alert("您的帐号或密码有误！")
        else {
            document.getElementById("loginInfo").innerHTML = "登录成功！";
            var userInfo = "";
            if (success.split('*').length == 2) {
                userInfo = success.split('*')[0];
                if (location.href.indexOf("queryLink.htm") > -1) {
                    document.getElementById("showLink").value = "http://user.gameyj.com/uregister.aspx?frompage=hotgh&fromid=" + success.split('*')[1];
                }
            }
            else
                userInfo = success;
            var htmcontent = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td class=\"index-nb-left\"><img src=\"../../images/index_bk21.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "    <td align=\"center\" class=\"index-td-bg1\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "        <tr>";
            htmcontent += "          <td height=\"40\" align=\"center\">" + userInfo + "</td>";
            htmcontent += "        </tr>";
            htmcontent += "      </table></td>";
            htmcontent += "    <td class=\"index-nb-right\"><img src=\"../../images/index_bk22.gif\" width=\"5\" height=\"1\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
    }
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////终结测试城战

function czView() {
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle.aspx", "post", "Type=e", czView_callback);
}

function czView_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var czImg = res.responseText.split('*');
            var htmcontent = "<table cellpadding=\"3\">";
            for (var i = 0; i < czImg.length - 1; i++) {
                if (i % 2 == 0) {
                    htmcontent += "<tr>";
                }
                htmcontent += "  <td><table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#333333\">";
                htmcontent += "      <tr>";
                htmcontent += "        <td><a href=\"../../wjfc/ScreenShot.aspx?FileID=" + czImg[i].split('^')[1] + "\" target=\"_blank\"><img src=\"" + czImg[i].split('^')[0] + "\" width=\"169\" height=\"127\" border=\"0\"></a></td>";
                htmcontent += "      </tr>";
                htmcontent += "    </table></td>";
                if (i % 2 != 0) {
                    htmcontent += "</tr>";
                }
            }
            htmcontent += "</table>";
            document.getElementById("czTopshow").innerHTML = htmcontent;
        }
    }
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////2061-终结者 盛世公测活动

function getJZCard(nameResult) {
    //    var nameValue = parseInt(nameResult);
    if (isNaN(nameResult))
        nameResult = 0;
    if (nameResult > 60) {
        var Requset = new XmlHttpRequest();
        Requset.send("../../gcHandle02.aspx", "post", "Type=1", getJZCard_callback);
    }
}
function getJZCard_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            //            switch (success) {
            //                case '1':
            //                    alert("抱歉，今天的晶钻卡已经全部发完。"); break;
            //                case '2':
            //                    alert("你所在IP已经获得太多了哦。"); break;
            //                case '3':
            //                    break;
            //                case '4':
            //                    alert("所有晶钻卡已经发完。"); break;
            //                default:
            //                    {
            //                        var T_card = document.getElementById("card");
            //                        T_card.style.left = (document.body.clientWidth - 566) / 2;
            //                        T_card.style.top = (document.body.clientHeight - 314) / 2 + 350;
            //                        T_card.style.display = "inline";
            //                        document.getElementById("cardShow").value = success;
            //                    }
            //            }
            setTimeout("JZCardResult('" + success + "')", 500);
        }
    }
}
function JZCardResult(success) {
    switch (success) {
        case '1':
            alert("抱歉，今天的晶钻卡已经全部发完。"); break;
        case '2':
            alert("你所在IP已经获得太多了哦。"); break;
        case '3':
            alert("你的人品不错，顺利穿梭到未来，但是您刚领过了晶钻卡！请稍后再来领取！");
            break;
        case '4':
            alert("所有晶钻卡已经发完。"); break;
        default:
            {
                var T_card = document.getElementById("card");
                T_card.style.left = (document.body.clientWidth - 436) / 2;
                T_card.style.top = (document.body.clientHeight - 222) / 2 - document.body.clientHeight / 8;
                T_card.style.display = "inline";
                document.getElementById("cardShow").value = success;
            }
    }
}


function GCLoadQBInfo() {
    if (clickQB == 0) {
        if (checkQBInfo()) {
            clickQB++;
            var iPhone = document.getElementById("qb_phone").value;
            var iQQ = document.getElementById("qb_qq").value;
            var iEmail = document.getElementById("qb_email").value;
            var qbInfo = iPhone + "," + iQQ + "," + iEmail;
            var Request = new XmlHttpRequest();
            Request.send("../../gcHandle02.aspx", "post", "Type=2&QBInfo=" + qbInfo, GCLoadQBInfo_callback);
        }
    }
    else
        alert("您的信息已提交，请耐心等待！");
}

function GCLoadQBInfo_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            document.getElementById("t_QB").style.display = "none";
            alert("您的获奖信息已经记录！QB奖励将在活动结束后5个工作日内发放！");

        }
        else
            clickQB = 0;
    }
}

function getGCPrizeInfo() {
    var url = location.href;
    var iPrize = url.indexOf("GetPrize");
    if (iPrize > -1) {
        iPrize = url.substr(iPrize + 9);
        if (iPrize == "qb") {
            iPrize = "5Q币奖励！";
            iPrize = "感谢您曾经参与我们的活动，你已经获得：" + iPrize;
        }
        else if (iPrize == "rmb") {
            iPrize = "现金1000元！";
            iPrize = "感谢您曾经参与我们的活动，你已经获得：" + iPrize;
        }
        else
            iPrize = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;感谢您曾经参与我们的活动，你已经获得<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;喜从天降大礼包一个：" + iPrize;
        document.getElementById("Prize").innerHTML = iPrize;
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////2061-终结者 盛世公测卸载

function gcUnload() {
    var answer = new Array("", "", "", "", "");
    var questionId = 16;
    var checkCount = 0;
    for (var i = 1; i < 6; i++) {
        var chkbox = document.getElementsByName("question" + i);
        answer[i - 1] = questionId + "!^";
        for (var j = 0; j < chkbox.length; j++) {
            if (chkbox[j].checked) {
                answer[i - 1] += chkbox[j].value + "!^";
                if (i == 3)
                    checkCount++;
            }
        }
        if (i == 2 && document.getElementById("Text1").value.replace(/\s/g, "") != "")
            answer[i - 1] += document.getElementById("Text1").value + "!#";
        if (i == 3 && document.getElementById("Text2").value.replace(/\s/g, "") != "")
            answer[i - 1] += document.getElementById("Text2").value + "!#";
        answer[i - 1] += "!*";
        questionId++;
    }
    if (checkCount > 2) {
        alert("第三题限选两项");
        return false;
    }
    if (answer[0].length == 6 && answer[1].length == 6 && answer[2].length == 6 && answer[3].length == 6 && answer[4].length == 6) {
        return false;
    }

    var qq = document.getElementById("Text3").value;
    var phone = document.getElementById("Text4").value;
    var Requset = new XmlHttpRequest();
    Requset.send("../../gcHandle02.aspx", "post", "Type=3&Answer=" + answer[0] + answer[1] + answer[2] + answer[3] + answer[4] + "&QQ=" + qq + "&Phone=" + phone, gcUnload_callback);
}


function gcUnload_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            alert(res.responseText);
        }
        else
            alert("您此IP已经提交过问卷，感谢您的合作！");
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////2061-终结者 老玩家回归

function IfLoginLWJ() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=4", IfLoginLWJ_callback);
}

function IfLoginLWJ_callback(status, res) {
    if (status == "ok") {
        var htmcontent = "";
        if (res.responseText != "") {
            var loginInfo = res.responseText;
            htmcontent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
            htmcontent += "  <tr><td height=\"40\" align=\"center\"><font color=\"#FFFFFF\">" + loginInfo + "</font></td></tr>";
            htmcontent += "  <tr><td height=\"40\" valign=\"top\" align=\"center\" onclick=\"LogOutLWJ();\"  style=\"cursor:hand;\"><font color=\"#FFFFFF\">退出</font></td></tr";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
        else {
            htmcontent += "<table width=\"100%\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico3.gif\" width=\"53\" height=\"27\"></td>";
            htmcontent += "    <td align=\"left\"><input name=\"UserName\" type=\"text\" size=\"12\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico4.gif\" width=\"53\" height=\"27\"></td>";
            htmcontent += "    <td align=\"left\"><input name=\"Password\" type=\"Password\" size=\"12\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            htmcontent += "<table width=\"95%\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico1.gif\" style=\"cursor:hand;\" width=\"84\" height=\"25\" onclick=\"LoginLWJ();\"></td>";
            htmcontent += "    <td><a href=\"http://user.gameyj.com/uregister.aspx\" target=\"_blank\"><img src=\"images/ico2.gif\" width=\"65\" height=\"25\" border=\"0\"></a></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
    }
}

function LoginLWJ() {
    if (validateLogin()) {
        var userName = document.getElementById("username").value;
        var pwd = document.getElementById("password").value;
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle02.aspx", "post", "Type=5&UserName=" + userName + "&Password=" + pwd, LoginLWJ_callback);
    }
}

function LoginLWJ_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            if (success == "1")
                alert("您的帐号或密码有误！");
            else {
                var htmcontent = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
                htmcontent += "  <tr><td height=\"40\" align=\"center\"><font color=\"#FFFFFF\">" + success + "</font></td></tr>";
                htmcontent += "  <tr><td height=\"40\" align=\"center\" valign=\"top\" onclick=\"LogOutLWJ();\"  style=\"cursor:hand;\"><font color=\"#FFFFFF\">退出</font></td></tr";
                htmcontent += "</table>";
                document.getElementById("LoginStatus").innerHTML = htmcontent;
            }
        }
    }
}

function LogOutLWJ() {
    var Request = new XmlHttpRequest();
    Request.send("../../medium.aspx", "post", "Type=a&Data=''", LogOutLWJ_callback);
}
function LogOutLWJ_callback(status, res) {
    if (status == "ok") {
        if (res.responseText == "0") {
            var htmcontent = "";
            htmcontent += "<table width=\"100%\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico3.gif\" width=\"53\" height=\"27\"></td>";
            htmcontent += "    <td><input name=\"UserName\" type=\"text\" size=\"12\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico4.gif\" width=\"53\" height=\"27\"></td>";
            htmcontent += "    <td><input name=\"Password\" type=\"Password\" size=\"12\"></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            htmcontent += "<table width=\"95%\">";
            htmcontent += "  <tr>";
            htmcontent += "    <td><img src=\"images/ico1.gif\" style=\"cursor:hand;\" width=\"84\" height=\"25\" onclick=\"LoginLWJ();\"></td>";
            htmcontent += "    <td><a href=\"http://user.gameyj.com/uregister.aspx\" target=\"_blank\"><img src=\"images/ico2.gif\" width=\"65\" height=\"25\" border=\"0\"></a></td>";
            htmcontent += "  </tr>";
            htmcontent += "</table>";
            document.getElementById("LoginStatus").innerHTML = htmcontent;
        }
        else
            alert("抱歉，未能退出登录，请重试。");

    }
}


function backForSelf() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=6", backForSelf_callback);
}

function backForSelf_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            if (success == "1")
                alert("请先登录！");
            else
                alert(success);
        }
    }
}

function backForInvite() {
    var oldUserName = document.getElementById("oldMan").value;
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=7&OldUserName=" + oldUserName, backForInvite_callback);
}

function backForInvite_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            if (success == "1")
                alert("请先登录！");
            else if (success == "2")
                alert("不能邀请自己哦！");
            else
                alert(success);
        }
    }
}

function IfLoginLWJHG() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=8", IfLoginLWJHG_callback);
}

function IfLoginLWJHG_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            document.getElementById("self").style.display = "none";
            document.getElementById("invite").style.display = "inline";
        }
        else
            alert("请先登录！");
    }
}

function goBack() {
    document.getElementById("self").style.display = "inline";
    document.getElementById("invite").style.display = "none";
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////2061-终结者 缘分测试
var self;
var ta;
var fateInfo = new Array("关系暗示：遭人非议之缘，或陷入不伦之恋。（敬告：此测试结果仅供参考）",
                         "关系暗示：人面与桃花，情缘扑朔迷离。（敬告：此测试结果仅供参考）",
                         "关系暗示：机缘巧合，终却劳燕纷飞。（敬告：此测试结果仅供参考）",
                         "关系暗示：枕上山盟海誓，别后海阔天空。（敬告：此测试结果仅供参考）",
                         "关系暗示：志同道合之人，但防有阻碍。（敬告：此测试结果仅供参考）",
                         "关系暗示：知心朋友，防陷入桃色纠纷中。（敬告：此测试结果仅供参考）",
                         "关系暗示：曾经适合你的人，为爱所苦！（敬告：此测试结果仅供参考）",
                         "关系暗示：爱你的人 或者露水姻缘。（敬告：此测试结果仅供参考）",
                         "关系暗示：令人羡慕的一对 要小心维护感情。（敬告：此测试结果仅供参考）",
                         "关系暗示：金风玉露，牛郎织女七夕会。（敬告：此测试结果仅供参考）",
                         "关系暗示：爱家的人，有望夫唱妇随。（敬告：此测试结果仅供参考）",
                         "关系暗示：彼此情投意合，无所违逆于心。（敬告：此测试结果仅供参考）",
                         "关系暗示：情投意合，缠绵悱恻。（敬告：此测试结果仅供参考）",
                         "关系暗示：郎情女意，互相爱慕。（敬告：此测试结果仅供参考）",
                         "关系暗示：百年修得同船渡，千年修得共枕棉。（敬告：此测试结果仅供参考）",
                         "关系暗示：举案齐眉，相携到老，会得到祝福的一段佳缘。（敬告：此测试结果仅供参考）",
                         "关系暗示：前生的守望，今世的缘分！你们会相敬如宾，心灵一生守望。（敬告：此测试结果仅供参考）"
                         );

function testFate(num) {
    if (num >= 30 && num <= 59)
        return num % 2;
    else if (num >= 60 && num <= 65)
        return num % 2 + 2;
    else if (num >= 66 && num <= 70)
        return num % 2 + 4;
    else if (num >= 71 && num <= 75)
        return num % 2 + 6;
    else if (num >= 76 && num <= 80)
        return num % 2 + 8;
    else if (num >= 81 && num <= 85)
        return num % 2 + 10;
    else if (num >= 86 && num <= 90)
        return num % 2 + 12;
    else if (num >= 91 && num <= 99)
        return num % 2 + 14;
    else if (num == 100)
        return 16;
}

function sinaMFateValue() {
    self = document.getElementById("male1").value.replace(/\s/g, "");
    ta = document.getElementById("female1").value.replace(/\s/g, "");
    if (self == "") {
        alert("请填写你的姓名。");
    }
    else if (ta == "") {
        alert("请填写你心仪的她的姓名。");
    }
    else {
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle02.aspx", "post", "Type=9&Male=" + self + "&Female=" + ta, sinaMFateValue_callback);
    }
}

function sinaMFateValue_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            var info = success.split("*");
            var fateValue = info[0];
            switch (info[1]) {
                case "1":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "晶钻卡已全部发放完毕。";
                        break;
                    }
                case "2":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "3":
                    {
                        var tan = document.getElementById("tan2");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName2").innerHTML = self;
                        document.getElementById("tName2").innerHTML = ta;
                        document.getElementById("fateValue2").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo2").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "4":
                    {
                        var tan = document.getElementById("tan3");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName3").innerHTML = self;
                        document.getElementById("tName3").innerHTML = ta;
                        document.getElementById("fateValue3").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo3").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "5":
                    {
                        alert("活动已结束！");
                        break;
                    }
                default:
                    {
                        var tan = document.getElementById("tan4");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName4").innerHTML = self;
                        document.getElementById("tName4").innerHTML = ta;
                        document.getElementById("fateValue4").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo4").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("PrizeInfo4").innerHTML = info[1];

                        break;
                    }
            }

        }
    }
}

function sinaFFateValue() {
    self = document.getElementById("female2").value.replace(/\s/g, "");
    ta = document.getElementById("male2").value.replace(/\s/g, "");
    if (self == "") {
        alert("请填写你的姓名。");
    }
    else if (ta == "") {
        alert("请填写你心仪的他的姓名。");
    }
    else {
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle02.aspx", "post", "Type=9&Male=" + ta + "&Female=" + self, sinaFFateValue_callback);
    }
}

function sinaFFateValue_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            var info = success.split("*");
            var fateValue = info[0];
            switch (info[1]) {
                case "1":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "晶钻卡已全部发放完毕。";
                        break;
                    }
                case "2":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "3":
                    {
                        var tan = document.getElementById("tan2");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName2").innerHTML = self;
                        document.getElementById("tName2").innerHTML = ta;
                        document.getElementById("fateValue2").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo2").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "4":
                    {
                        var tan = document.getElementById("tan3");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName3").innerHTML = self;
                        document.getElementById("tName3").innerHTML = ta;
                        document.getElementById("fateValue3").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo3").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "5":
                    {
                        alert("活动已结束！");
                        break;
                    }
                default:
                    {
                        var tan = document.getElementById("tan4");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName4").innerHTML = self;
                        document.getElementById("tName4").innerHTML = ta;
                        document.getElementById("fateValue4").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo4").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("PrizeInfo4").innerHTML = info[1];
                        break;
                    }
            }
        }
    }
}

function fillInfo(num) {
    var fValue = document.getElementById("fateValue" + num).innerHTML.replace('%', "");
    document.getElementById("tan" + num).style.display = "none";
    var tan = document.getElementById("tan_sina");
    tan.style.left = document.body.clientWidth / 4;
    tan.style.top = document.body.clientHeight - 50;
    tan.style.display = "inline";
    //    document.parentWindow.parent.doFa(fValue);
}

function mGetFateValue(mediaType) {
    self = document.getElementById("male1").value.replace(/\s/g, "");
    ta = document.getElementById("female1").value.replace(/\s/g, "");
    if (self == "") {
        alert("请填写你的姓名。");
    }
    else if (ta == "") {
        alert("请填写你心仪的她的姓名。");
    }
    else {
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle02.aspx", "post", "Type=a&MediaType=" + mediaType + "&Male=" + self + "&Female=" + ta, mGetFateValue_callback);
    }
}

function mGetFateValue_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            var info = success.split("*");
            var fateValue = info[0];
            switch (info[1]) {
                case "1":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "晶钻卡已全部发放完毕。";
                        break;
                    }
                case "2":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "3":
                    {
                        var tan = document.getElementById("tan2");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName2").innerHTML = self;
                        document.getElementById("tName2").innerHTML = ta;
                        document.getElementById("fateValue2").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo2").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "4":
                    {
                        var tan = document.getElementById("tan3");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName3").innerHTML = self;
                        document.getElementById("tName3").innerHTML = ta;
                        document.getElementById("fateValue3").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo3").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "5":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "您今天已经领取奖励　请明天再来。";
                        break;
                    }
                case "6":
                    {
                        alert("活动已结束！");
                        break;
                    }
                case "qb":
                    {
                        if (info.length == 2) {
                            var tan = document.getElementById("tan5");
                            tan.style.left = document.body.clientWidth / 4;
                            tan.style.top = document.body.clientHeight - 50;
                            tan.style.display = "inline";
                            document.getElementById("sName5").innerHTML = self;
                            document.getElementById("tName5").innerHTML = ta;
                            document.getElementById("fateValue5").innerHTML = fateValue + "%";
                            document.getElementById("fateInfo5").innerHTML = fateInfo[testFate(fateValue)];
                        }
                        else {
                            switch (info[2]) {
                                case '1':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周5Q币奖励已经发完，且晶钻卡已全部发放完毕。"
                                        break;
                                    }
                                case '2':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周5Q币奖励已经发完，且您已经领取晶钻卡奖励，请15分钟后再领取！。"
                                        break;
                                    }
                                default:
                                    {
                                        var tan = document.getElementById("tan7");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName7").innerHTML = self;
                                        document.getElementById("tName7").innerHTML = ta;
                                        document.getElementById("fateValue7").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo7").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo7").innerHTML = "<p>另由于本周5Q币奖励已经发完，恭喜您获得<span class=\"wz_nan\"><strong>888元晶钻卡</strong></span>一枚：<span class=\"wz_nan\">" + info[2] + "</span><input id=\"Button2\" type=\"button\"  value=\"点击复制\" onclick=\"paste2('" + info[2] + "');\"/></p>";
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                case "bs":
                    {
                        if (info.length == 2) {
                            var tan = document.getElementById("tan6");
                            tan.style.left = document.body.clientWidth / 4;
                            tan.style.top = document.body.clientHeight - 50;
                            tan.style.display = "inline";
                            document.getElementById("sName6").innerHTML = self;
                            document.getElementById("tName6").innerHTML = ta;
                            document.getElementById("fateValue6").innerHTML = fateValue + "%";
                            document.getElementById("fateInfo6").innerHTML = fateInfo[testFate(fateValue)];
                        }
                        else {
                            switch (info[2]) {
                                case '1':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周真爱钻戒道具奖励已经发完，且晶钻卡已全部发放完毕。"
                                        break;
                                    }
                                case '2':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周真爱钻戒道具奖励已经发完，且您已经领取晶钻卡奖励，请15分钟后再领取！。"
                                        break;
                                    }
                                default:
                                    {
                                        var tan = document.getElementById("tan7");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName7").innerHTML = self;
                                        document.getElementById("tName7").innerHTML = ta;
                                        document.getElementById("fateValue7").innerHTML = fateValue + "%";
                                        document.getElementById("fateInfo7").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo7").innerHTML = "<p>另由于本周真爱钻戒道具奖励已经发完，恭喜您获得<span class=\"wz_nan\"><strong>888元晶钻卡</strong></span>一枚：<span class=\"wz_nan\">" + info[2] + "</span><input id=\"Button2\" type=\"button\"  value=\"点击复制\" onclick=\"paste2('" + info[2] + "');\"/></p>";
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                default:
                    {
                        var tan = document.getElementById("tan4");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName4").innerHTML = self;
                        document.getElementById("tName4").innerHTML = ta;
                        document.getElementById("fateValue4").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo4").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("PrizeInfo4").innerHTML = info[1];
                        break;
                    }
            }
        }
    }
}

function fGetFateValue(mediaType) {
    self = document.getElementById("female2").value.replace(/\s/g, "");
    ta = document.getElementById("male2").value.replace(/\s/g, "");
    if (self == "") {
        alert("请填写你的姓名。");
    }
    else if (ta == "") {
        alert("请填写你心仪的他的姓名。");
    }
    else {
        var Request = new XmlHttpRequest();
        Request.send("../../gcHandle02.aspx", "post", "Type=a&MediaType=" + mediaType + "&Male=" + ta + "&Female=" + self, fGetFateValue_callback);
    }
}

function fGetFateValue_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            var info = success.split("*");
            var fateValue = info[0];
            switch (info[1]) {
                case "1":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "晶钻卡已全部发放完毕。";
                        break;
                    }
                case "2":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "3":
                    {
                        var tan = document.getElementById("tan2");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName2").innerHTML = self;
                        document.getElementById("tName2").innerHTML = ta;
                        document.getElementById("fateValue2").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo2").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "4":
                    {
                        var tan = document.getElementById("tan3");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName3").innerHTML = self;
                        document.getElementById("tName3").innerHTML = ta;
                        document.getElementById("fateValue3").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo3").innerHTML = fateInfo[testFate(fateValue)];
                        break;
                    }
                case "5":
                    {
                        var tan = document.getElementById("tan1");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName1").innerHTML = self;
                        document.getElementById("tName1").innerHTML = ta;
                        document.getElementById("fateValue1").innerHTML = fateValue + "%";
                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("prizeInfo1").innerHTML = "您今天已经领取奖励　请明天再来。";
                        break;
                    }
                case "6":
                    {
                        alert("活动已结束！");
                        break;
                    }
                case "qb":
                    {
                        if (info.length == 2) {
                            var tan = document.getElementById("tan5");
                            tan.style.left = document.body.clientWidth / 4;
                            tan.style.top = document.body.clientHeight - 50;
                            tan.style.display = "inline";
                            document.getElementById("sName5").innerHTML = self;
                            document.getElementById("tName5").innerHTML = ta;
                            document.getElementById("fateValue5").innerHTML = fateValue;
                            document.getElementById("fateInfo5").innerHTML = fateInfo[testFate(fateValue)];
                        }
                        else {
                            switch (info[2]) {
                                case '1':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue;
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周5Q币奖励已经发完，且晶钻卡已全部发放完毕。"
                                        break;
                                    }
                                case '2':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue;
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周5Q币奖励已经发完，且您已经领取晶钻卡奖励，请15分钟后再领取！。"
                                        break;
                                    }
                                default:
                                    {
                                        var tan = document.getElementById("tan7");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName7").innerHTML = self;
                                        document.getElementById("tName7").innerHTML = ta;
                                        document.getElementById("fateValue7").innerHTML = fateValue;
                                        document.getElementById("fateInfo7").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo7").innerHTML = "<p>另由于本周5Q币奖励已经发完，恭喜您获得<span class=\"wz_nan\"><strong>888元晶钻卡</strong></span>一枚：<span class=\"wz_nan\">" + info[2] + "</span><input id=\"Button2\" type=\"button\"  value=\"点击复制\" onclick=\"paste2('" + info[2] + "');\"/></p>";
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                case "bs":
                    {
                        if (info.length == 2) {
                            var tan = document.getElementById("tan6");
                            tan.style.left = document.body.clientWidth / 4;
                            tan.style.top = document.body.clientHeight - 50;
                            tan.style.display = "inline";
                            document.getElementById("sName6").innerHTML = self;
                            document.getElementById("tName6").innerHTML = ta;
                            document.getElementById("fateValue6").innerHTML = fateValue;
                            document.getElementById("fateInfo6").innerHTML = fateInfo[testFate(fateValue)];
                        }
                        else {
                            switch (info[2]) {
                                case '1':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue;
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周真爱钻戒道具奖励已经发完，且晶钻卡已全部发放完毕。"
                                        break;
                                    }
                                case '2':
                                    {
                                        var tan = document.getElementById("tan1");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName1").innerHTML = self;
                                        document.getElementById("tName1").innerHTML = ta;
                                        document.getElementById("fateValue1").innerHTML = fateValue;
                                        document.getElementById("fateInfo1").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo1").innerHTML = "另由于本周真爱钻戒道具奖励已经发完，且您已经领取晶钻卡奖励，请15分钟后再领取！。"
                                        break;
                                    }
                                default:
                                    {
                                        var tan = document.getElementById("tan7");
                                        tan.style.left = document.body.clientWidth / 4;
                                        tan.style.top = document.body.clientHeight - 50;
                                        tan.style.display = "inline";
                                        document.getElementById("sName7").innerHTML = self;
                                        document.getElementById("tName7").innerHTML = ta;
                                        document.getElementById("fateValue7").innerHTML = fateValue;
                                        document.getElementById("fateInfo7").innerHTML = fateInfo[testFate(fateValue)];
                                        document.getElementById("prizeInfo7").innerHTML = "<p>另由于本周真爱钻戒道具奖励已经发完，恭喜您获得<span class=\"wz_nan\"><strong>888元晶钻卡</strong></span>一枚：<span class=\"wz_nan\">" + info[2] + "</span><input id=\"Button2\" type=\"button\"  value=\"点击复制\" onclick=\"paste2('" + info[2] + "');\"/></p>";
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                default:
                    {
                        var tan = document.getElementById("tan4");
                        tan.style.left = document.body.clientWidth / 4;
                        tan.style.top = document.body.clientHeight - 50;
                        tan.style.display = "inline";
                        document.getElementById("sName4").innerHTML = self;
                        document.getElementById("tName4").innerHTML = ta;
                        document.getElementById("fateValue4").innerHTML = fateValue;
                        document.getElementById("fateInfo4").innerHTML = fateInfo[testFate(fateValue)];
                        document.getElementById("PrizeInfo4").innerHTML = info[1];
                        break;
                    }
            }
        }
    }
}

function goSubInfo(num) {
    document.getElementById("UserName").focus();
    document.getElementById("tan" + num).style.display = "none";
}

function subFateInfo() {
    var userName = document.getElementById("UserName").value.replace(/\s/g, "");
    var trueName = document.getElementById("Name").value.replace(/\s/g, "");
    var phone = document.getElementById("Phone").value.replace(/\s/g, "");
    var qq = document.getElementById("QQ").value.replace(/\s/g, "");
    var email = document.getElementById("Email").value.replace(/\s/g, "");
    if (userName == "") {
        alert("请填写帐号。");
        document.getElementById("UserName").focus();
        return false;
    }
    if (trueName == "") {
        alert("请填写您的姓名。");
        document.getElementById("Name").focus();
        return false;
    }
    if (phone == "") {
        alert("请填写您的联系电话。");
        document.getElementById("Phone").focus();
        return false;
    }
    if (qq == "") {
        alert("请填写您的QQ。");
        document.getElementById("QQ").focus();
        return false;
    }
    if (email == "") {
        alert("请填写您的联系邮箱。");
        document.getElementById("Email").focus();
        return false;
    }
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=b&UserName=" + userName + "&TrueName=" + trueName + "&Phone=" + phone + "&QQ=" + qq + "&Email=" + email, subFateInfo_callback);

}

function subFateInfo_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            alert(res.responseText);
        }
    }
}

function resetInfo() {
    if (confirm("你确定要消除现在输入的信息吗？")) {
        document.getElementById("UserName").value = "";
        document.getElementById("Name").value = "";
        phone = document.getElementById("Phone").value = "";
        qq = document.getElementById("QQ").value = "";
        email = document.getElementById("Email").value = "";
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////2061-终结者 冲45级送QB

function subGc45QQ() {
    var qq = document.getElementById("qq").value.replace(/\s/g, "");
    var qqconfirm = document.getElementById("qqConfirm").value.replace(/\s/g, "");
    if (qq == "") {
        alert("请输入您的QQ。");
        document.getElementById("qq").focus();
        return false;
    }
    if (qqconfirm == "") {
        alert("请输入确认QQ号。");
        document.getElementById("qqConfirm").focus();
        return false;
    }
    if (qq != qqconfirm) {
        alert("您两次输入的QQ号不一样。");
        document.getElementById("qqConfirm").value = "";
        return false;
    }
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=c&QQ=" + qq, subGc45QQ_callback);
}

function subGc45QQ_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            var success = res.responseText;
            switch (success) {
                case "1":
                    alert("请先登录！"); break;
                case "2":
                    {
                        alert("您的QQ号已经记录，若您在活动期间达到45级，即可获得5Q币！");
                        document.getElementById("qq").value = "";
                        document.getElementById("qqConfirm").value = "";
                        break;
                    }
                case "3":
                    {
                        alert("您的帐号已经登记过了，请不要重复提交。");
                        document.getElementById("qq").value = "";
                        document.getElementById("qqConfirm").value = "";
                        break;
                    }
                case "4":
                    { alert("活动已结束。"); break; }
                default:
                    break;
            }
        }
    }
}

function IfLogin45QB() {
    var Request = new XmlHttpRequest();
    Request.send("../../gcHandle02.aspx", "post", "Type=8", IfLogin45QB_callback);
}

function IfLogin45QB_callback(status, res) {
    if (status == "ok") {
        if (res.responseText != "") {
            document.getElementById("actInfo").style.display = "none";
            document.getElementById("userInfo").style.display = "inline";
        }
        else
            alert("请先登录！");
    }
}

function backIndex() {
    document.getElementById("actInfo").style.display = "inline";
    document.getElementById("userInfo").style.display = "none";
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////记录按钮点击次数
function RecordClick(btnId) {
    var Request = new XmlHttpRequest();
    Request.send("/gcHandle02.aspx", "post", "Type=d&ButtonID=" + btnId, RecordClick_callback);
}

function RecordClick_callback(status, res) {

}