﻿/*
*  Copyright (c) 2009 iPow(www.iPow.cn)
*/
function ResumeError() {
    return true;
}
window.onerror = ResumeError;
var loginType = "", aActivityID = "", aTools = null; function iARainbow() {
    this.developer = "";
    this.skin = { images: "/iRainbow/images/", logo: "/iRainbow/images/" };
    this.tools = [];
    this.win = { width: 750, height: 420 };
    this.flow = 1;
    this.cardInfo = {};
    this.SightID = ""
} iARainbow.prototype = { init: function () {
    this.bindEvent();
    this.checkLogin()
}, skins: function () {
    var A = this, B = "<div id=\"iRainbow_Tools\"><img src=\"" + A.skin.logo + "\" width=\"128\" height=\"30\" /><ul id=\"iRainbowTools\">";
    jQuery.each(A.tools, function (A, C) {
        B += "<li><a href=\"" + C.url + "\" title=\"" + C.title + "\" target=\"_blank\">" + C.title + "</a></li>"
    });
    B += "</ul><em>\u767b\u5f55</em></div>";
    jQuery("body").prepend(B)
}, bindEvent: function () {
    var B = this, D = insertFlash(B.skin.images + "winTop.swf", "iRainbowTF"), A = insertFlash(B.skin.images + "winLeft.swf", "iRainbowLF"), C = insertFlash(B.skin.images +
 "winBottom.swf", "iRainbowBF"); if (jQuery("#iRainbow_Win").html() == null) {
        var E = "<div id=\"iRainbow_Win\">\t\t\t\t<div id=\"iRainbow_RoundTop\"><span>" + D +
  "</span><ul><li class=\"current\"><a href=\"javascript:;\" id=\"iRainbowTitle\"></a></li></ul><em id=\"iRainbowClose\"></em></div>\t\t\t\t<div id=\"iRainbow_Mid\"><div id=\"iRainbow_Left\">" +
  A + "</div><div id=\"iRainbow_Bg\"><div id=\"iRainbow_Content\">\t\t\t\t</div></div><div id=\"iRainbow_Right\">" + A + "</div></div>\t\t\t\t<div id=\"iRainbow_RoundBot\">" + C + "</div>\t\t\t</div>";
        jQuery("body").append(E); jQuery("#iRainbowClose").click(function () { jQuery("#iRainbow_Win").animate({ "top": "-500px" }, 500, "easeInOutExpo", function () { }) })
    } jQuery("#iRainbowLogin a").click(function () {
        var A = jQuery(this).attr("rel"), D = B.getPosition(), C = parseInt(D.scrTop), G = parseInt(D.offWidth - B.win.width) / 2,
     F = parseInt(D.offHeight - B.win.height) / 2 + C, E = "";
        jQuery("#iRainbow_Win").css({ "left": G + "px" }).animate({ "top": F + "px" }, 500, "easeInElastic", function () {
            switch (A) {
                case "reg": jQuery("#iRainbowTitle").text("\u7528\u6237\u6ce8\u518c");
                    E = "<div id=\"iRainbowLoginL\"><h4 id=\"iRainMsg\">\u9a6c\u4e0a\u6ce8\u518c \u60ca\u559c\u591a\u591a</h4>\t\t\t\t\t  <span><label>\u7528 \u6237 \u540d\uff1a</label><input id=\"txtLUserName\" class=\"iRainbowTex\" type=\"text\" maxlength=\"15\"/><em>*\u7528\u6237\u540d\u53ea\u80fd\u7531\u4e2d\u6587\u3001\u82f1\u6587\u548c\u6570\u5b57\u6784\u6210</em></span>\t\t\t\t\t  <span><label>\u5bc6\u3000\u3000\u7801\uff1a</label><input id=\"txtLPassword\" class=\"iRainbowTex\" type=\"password\" maxlength=\"16\"/><em>*\u5bc6\u7801\u53ef\u4ee5\u75316-16\u4e2a\u4efb\u610f\u5b57\u7b26\u7ec4\u6210</em></span>\t\t\t\t\t  <span><label>\u786e\u8ba4\u5bc6\u7801\uff1a</label><input id=\"txtLPassword2\" class=\"iRainbowTex\" type=\"password\" maxlength=\"16\"/><em>*\u786e\u8ba4\u5bc6\u7801\uff0c\u6709\u52a9\u4e8e\u68c0\u6d4b\u60a8\u8f93\u5165\u7684\u5bc6\u7801\u662f\u5426\u6709\u8bef</em></span>\t\t\t\t\t  <span><label>\u7535\u5b50\u90ae\u7bb1\uff1a</label><input id=\"txtLEmail\" class=\"iRainbowTex\" type=\"text\" maxlength=\"50\"/><em>*\u8bf7\u786e\u4fdd\u90ae\u7bb1\u6709\u6548\uff0c\u4fbf\u4e8e\u6211\u4eec\u8054\u7cfb\u60a8</em></span>\t\t\t\t\t  <span><h3>\u4e3a\u65b9\u4fbf\u5151\u5956\u65f6\u8054\u7cfb\u60a8\uff0c\u8bf7\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\uff01</h3></span>\t\t\t\t\t  <span><label>\u771f\u5b9e\u59d3\u540d\uff1a</label><input id=\"txtLTrueName\" class=\"iRainbowTex\" type=\"text\" maxlength=\"30\"/><em>*\u8bf7\u8ba4\u771f\u586b\u5199\u60a8\u7684\u771f\u5b9e\u59d3\u540d\uff0c\u4fbf\u4e8e\u6211\u4eec\u8054\u7cfb\u60a8</em></span>\t\t\t\t\t  <span><label>\u624b\u673a\u53f7\u7801\uff1a</label><input id=\"txtLMobile\" class=\"iRainbowTex\" type=\"text\" maxlength=\"15\" onkeypress=\"return event.keyCode>=48&&event.keyCode<=57||event.keyCode==46\"/><em>*\u8bf7\u786e\u4fdd\u60a8\u7684\u624b\u673a\u53f7\u7801\u6709\u6548</em></span><span><label>&nbsp;</label><button tabindex=\"100\" value=\"true\" id=\"regsubmit\" type=\"submit\"></button></span></div>";
                    E += "<div id=\"iRainbowLoginR\"><h4>\u5df2\u6709\u8d26\u53f7\uff1f<a href=\"javascript:;\" id=\"nowLogin\">\u73b0\u5728\u767b\u5f55</a></h4></div>";
                    jQuery("#iRainbow_Content").html(E);
                    jQuery("#regsubmit").unbind().click(function () {
                        B.reg()
                    }); jQuery("#nowLogin").unbind().click(function () {
                        jQuery("#iRainbow_Tools a:eq(1)").trigger("click")
                    });
                    jQuery("#txtLUserName").unbind().blur(function () {
                        B.checkInfo("user", $(this).val())
                    });
                    jQuery("#txtLEmail").unbind().blur(function () {
                        B.checkInfo("email", $(this).val())
                    });
                    break; case "login": jQuery("#iRainbowTitle").text("\u7528\u6237\u767b\u5f55");
                    E = "<div id=\"iRainbowLoginL\"><h4  id=\"iRainMsg\">\u767b\u5f55</h4>\t\t\t\t\t  <span><label>\u7528\u6237\u540d\uff1a</label><input id=\"txtLUserName\" class=\"iRainbowTex\" style=\"width:200px;\" type=\"text\" maxlength=\"15\"/><em></em></span>\t\t\t\t\t  <span><label>\u5bc6  \u7801\uff1a</label><input id=\"txtLPassword\" class=\"iRainbowTex\" style=\"width:200px;\"  type=\"password\" maxlength=\"16\"/><em></em></span>\t\t\t\t\t  <span><label>&nbsp;</label><button tabindex=\"100\" value=\"true\" id=\"loginsubmit\" type=\"submit\" style=\"_margin-top:0px;_margin-left:0px;\"></button></span></div>"; E += "<div id=\"iRainbowLoginR\"><h4>\u6ca1\u6709\u8d26\u53f7\uff1f<a href=\"javascript:;\" id=\"nowReg\">\u73b0\u5728\u6ce8\u518c</a></h4></div>";
                    jQuery("#iRainbow_Content").html(E);
                    jQuery("#loginsubmit").unbind().click(function () {
                        B.login()
                    }); jQuery("#nowReg").unbind().click(function () {
                        jQuery("#iRainbow_Tools a:eq(0)").trigger("click")
                    });
                    break; default: break
            }
        })
    })
}, reg: function () {
    var F = this, D = $.trim($("#txtLUserName").val()), C = $.trim($("#txtLPassword").val()), A = $.trim($("#txtLPassword2").val()), H = "\u4fdd\u5bc6", E = $.trim($("#txtLEmail").val()),
    G = $.trim($("#txtLTrueName").val()), B = $.trim($("#txtLMobile").val()); if (D == "") {
        alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\uff1a\uff09"); $("#txtLUserName").focus();
        return false
    } if (C == "") {
        alert("\u8bf7\u8f93\u5165\u60a8\u7684\u5bc6\u7801\uff1a\uff09");
        $("#txtLPassword").focus();
        return false
    } if (A == "") {
        alert("\u8bf7\u8f93\u5165\u60a8\u7684\u786e\u8ba4\u5bc6\u7801\uff1a\uff09");
        $("#txtLPassword1").focus();
        return false
    } else if (C != A) {
        alert("\u5bc6\u7801\u548c\u786e\u8ba4\u5bc6\u7801\u4e0d\u4e00\u81f4\uff1a\uff09");
        $("#txtLPassword").focus();
        return false
    } if (E == "") {
        alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\uff1a\uff09");
        $("#txtLEmail").focus(); return false
    } else if (!isEmail(E)) {
        alert("\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef\uff01");
        $("#txtLEmail").select(); return false
    } else this.checkInfo("email", E); if (B == "") {
        alert("\u8bf7\u8f93\u5165\u60a8\u7684\u624b\u673a\u53f7\u7801\uff1a\uff09");
        $("#txtLMobile").select(); return false
    } else if (!isMobile(B)) {
        $("#txtLMobile").select();
        return false
    }
    $("#regsubmit").attr("disabled", "disabled");
    //----$.post("/bbs/ajaxUser.aspx?temp" + Math.random(), {
    //    $.post("/bbs/ajaxUser.aspx?temp" + Math.random(), {
    //        Type: "reg", UserName: D, Password: C, Email: E, Sex: H, TrueName: G, Mobile: B
    //    }, function (A) {
    //        if (A == "Ok")
    //            jQuery("#iRainbow_Win").animate({ "top": "-500px" },
    //        500,
    //        "easeInOutExpo",
    //    		    function () {
    //    		        document.cookie = "bjUserName=" + D; $("#txtLUserName").val("");
    //    		        $("#txtLPassword").val("");
    //    		        $("#txtLPassword2").val("");
    //    		        $("#iRainbowSex input:eq(2)").attr("checked", "checked");
    //    		        $("#regsubmit").attr("disabled", "");
    //    		        $("#iRainbowLogin").html("<p>\u6b22\u8fce\u60a8\uff01<strong>" + D + "</strong>,</p><input type=\"button\" id=\"iRLogout\" value=\"\u9000 \u51fa\"/>");
    //    		        $("#iRLogout").click(function () {
    //    		            F.Logout();
    //    		        });
    //    		        if (loginType == "saveC")
    //    		            CheckUser();
    //    		    })
    //    })
},
    login: function () {
        var C = this,
        B = $.trim($("#txtLUserName").val()),
        A = $.trim($("#txtLPassword").val());
        if (B == "") {
            alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\uff1a\uff09");
            $("#txtLUserName").focus();
            return false
        } if (A == "") {
            alert("\u8bf7\u8f93\u5165\u60a8\u7684\u5bc6\u7801\uff1a\uff09");
            $("#txtLPassword").focus();
            return false
        }
        //        $.get("/bbs/ajaxUser.aspx?temp" + Math.random(), {
        //            Type: "userlogin", UserName: B, Password: A
        //        }, function (A) {
        //            if (A == "Ok") {
        //                document.cookie = "bjUserName=" + B;
        //                $("#iRainbowLogin").html("<p>\u6b22\u8fce\u60a8\uff01<strong>" + B + "</strong>,</p><input type=\"button\" id=\"iRLogout\" value=\"\u9000 \u51fa\"/>");
        //                $("#iRLogout").click(function () { C.Logout() });
        //                jQuery("#iRainbow_Win").animate({ "top": "-500px" }, 500, "easeInOutExpo",
        //    					function () {
        //    					    $("#txtLUserName").val("");
        //    					    $("#txtLPassword").val("");
        //    					    $("#regsubmit").attr("disabled", "")
        //    					});
        //                if (loginType == "saveC") CheckUser()
        //            } else {
        //                $("#iRainMsg").text("\u7528\u6237\u540d\u6216\u8005\u5bc6\u7801\u9519\u8bef\uff1a\uff09");
        //                deleteCookie("bjUserName");
        //                $("#txtLUserName").select();
        //                return false
        //            }
        //        })
    },
    checkInfo: function (B, A) {
        if (B == "user" && A != "") {
            //            $.get("/bbs/ajaxUser.aspx?temp" + Math.random(), {
            //                Type: "checkUser",
            //                UserName: A
            //            },
            //                  function (A) {
            //                      if (A == "HaveUser" && B == "user") {
            //                          $("#iRainMsg").text("\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728\uff1a\uff09");
            //                          $("#txtLUserName").select();
            //                          return false
            //                      } else
            //                          $("#iRainMsg").text("\u9a6c\u4e0a\u6ce8\u518c \u60ca\u559c\u591a\u591a")
            //                  });
        }
        else if (B == "email" && A != "") {
            //            $.get("/bbs/ajaxUser.aspx?temp" + Math.random(), {
            //                Type: "checkEmail",
            //                Email: A
            //            },
            //         function (A) {
            //             if (A == "HaveEmail" && B == "email") {
            //                 $("#iRainMsg").text("\u90ae\u7bb1\u5df2\u7ecf\u6ce8\u518c\uff1a\uff09");
            //                 $("#txtLEmail").select();
            //                 return false;
            //             }
            //             else
            //                 $("#iRainMsg").text("\u9a6c\u4e0a\u6ce8\u518c \u60ca\u559c\u591a\u591a");
            //         })
        }
    },
    checkLogin: function () {
        var A = this;
        //        $.get("/bbs/ajaxUser.aspx?temp" + Math.random(), {
        //            Type: "checklogin"
        //        }, function (B) {
        //            if (B != "NoLogin" && B.length > 3) {
        //                B = B.split("|");
        //                if (B.length > 0) {
        //                    document.cookie = "bjUserName=" + B[1];
        //                    $("#iRainbowLogin").html("<p>\u6b22\u8fce\u60a8\uff01<strong>" + B[1]
        //                + "</strong>,</p><input type=\"button\" id=\"iRLogout\" value=\"\u9000 \u51fa\"/>");
        //                    $("#iRLogout").click(function () {
        //                        A.Logout();
        //                    })
        //                }
        //            } else {
        //                deleteCookie("bjUserName");
        //            }
        //        });
    }, Logout: function () {
        var A = this;
        //        $.get("/bbs/ajaxUser.aspx?temp" + Math.random(), { Type: "logout" }, function (B) {
        //            if (B == "Ok") {
        //                deleteCookie("bjUserName");
        //                $("#iRainbowLogin").html("<a id=\"btnReg\" href=\"javascript:;\"  rel=\"reg\">\u6ce8\u518c</a><em>|</em>        <a id=\"btnLogin\" href=\"javascript:;\" rel=\"login\">\u767b\u5f55</a>");
        //                A.bindEvent()
        //            }
        //        });
    },
    //----
    steps: function (I, B) {
        var C = this, H = jQuery("#iRainbow_Menu ul li"), E = jQuery("#iRainbow_Tip2 h2"), G = jQuery("#iRainbowIn"), A = jQuery("#iRainbowCtl"), F = jQuery("#iRainBtnN");
        E.text(B);
        var D = "";
        H.removeClass("current1").parent().find("li:eq(" + parseInt(I - 1) + ")").addClass("current1");
        switch (I) {
            case 1: D = "<div id=\"iRainbowDdrT\"><span>\u8bf7\u9009\u62e9\u5e74\u5361\u7c7b\u578b</span><ul><li><a href=\"javascript:;\">\u5355\u4eba\u884c</a></li><li><a href=\"javascript:;\">\u5151\u6362\u5361</a></li></ul></div>";
                G.html(D);
                jQuery("#iRainbowDdrT").dropdown();
                F.unbind().click(function () {
                    C.cardInfo.type = jQuery("#iRainbowDdrT span").text();
                    jQuery("#iRainbow_Content").slideUp("fast", function () {
                        C.flow = 2; C.steps(C.flow, "\u5e74\u5361\u987b\u77e5")
                    })
                });
                break; case 2: D = "<p>\u5e74\u5361\u987b\u77e5</p>";
                G.html(D);
                jQuery("#iRainbow_Content").slideDown("fast", function () {
                    F.unbind().click(function () {
                        jQuery("#iRainbow_Content").slideUp("fast", function () {
                            C.flow = 3;
                            C.steps(C.flow, "\u5e74\u5361\u4fe1\u606f\u767b\u8bb0")
                        })
                    })
                }); break; case 3: D = "<div id=\"iRainbow_Crop\"><img src=\"" +
   C.skin.images + "flowers.jpg\"></div>";
                G.html(D);
                jQuery("#iRainbow_Content").slideDown("fast", function () {
                    F.unbind().click(function () { })
                });
                break;
            default:
                break;
        }
    }, getTravels: function () {
        _html = "<div id=\"iRainbow_Article\"><div id=\"iRainbow_Tip2\"><h2>\u6e38\u8bb0\u653b\u7565</h2></div><div id=\"iRainbow_List\">";
        for (var A = 0; A < 3; A++) {
            _html +=
     "<a href=\"#\" class=\"iRList\">";
            _html += "\t<img src=\"http://img1.ipow.cn/remote/2009-4/i20094291242186484.jpg\" width=\"81px\" height=\"75px\">";
            _html +=
      "\t<div><span><h4>\u300a\u5317\u4eac\u6b22\u4e50\u8c37\u4e00\u65e5\u6e38\u300b</h4><em>\u6d4f\u89c8\u6b21\u6570\uff1a2039</em></span><p>\u6df1\u5733\u5e02\u5df2\u542f\u52a8\u7f16\u5236\u6c11\u7528\u5efa\u7b51\u80fd\u8017\u5b9a\u989d\u6807\u51c6\uff0c\u4e3a\u5b9e\u884c\u8d85\u5b9a\u989d\u52a0\u4ef7\u673a\u5236\u5960\u5b9a\u57fa\u7840\u3002\u8fd9\u610f\u5473\u7740\uff0c\u4eca\u540e\u5c45\u6c11\u4f4f\u5b85\u7528\u7535\u91cf\u8d85\u8fc7\u4e00\u5b9a\u6807\u51c6\uff0c\u5c06\u88ab\u5f81\u6536\u7528\u7535\u9644\u52a0\u8d39\u3002</p></div>"; _html += "</a>"
        }
        _html += "</div>";
        _html += "<div id=\"iRainbow_Page\"><a href=\"#\" class=\"iRNext\"></a><a href=\"#\">5</a><a href=\"#\">4</a><a href=\"#\">3</a><a href=\"#\">2</a><span>1</span><a href=\"#\" class=\"iRPrev\"></a></div>"; _html += "</div>"; jQuery("#iRainbow_Content").html(_html)
    }, getPosition: function () {
        var C = [];
        C.offWidth = document.documentElement.clientWidth;
        C.offHeight = document.documentElement.clientHeight;
        var B, A, D;
        if (typeof window.pageYOffset != "undefined") {
            B = window.pageYOffset; A = 0
        } else if (typeof document.compatMode != "undefined" && document.compatMode != "BackCompat") {
            B = document.documentElement.scrollTop; A = document.documentElement.scrollLeft
        } else if (typeof document.body != "undefined") {
            B = document.body.scrollTop; A = document.body.scrollLeft
        } if (C.offWidth > 1003) D = parseFloat(C.offWidth - 1003) / 2;
        else D = 0;
        C.scrTop = B;
        C.scrLeft = A;
        C.offsetLeft = D; return C
    }, GoWant: function () {
        jQuery.getScript("http://sys.ipow.cn/IpowAPI/Client/Activity.ashx?Type=want&ActID=" +
     aActivityID + "&CallBack=aTools.GetWants&temp" + Math.random(), function () {
     })
    }, GetWants: function (B) {
        if (B.Type == "OK") {
            if ($.browser.mozilla) thisMovie("iPowEyes1").GetWants(B.Wants);
            else thisMovie("iPowEyes").GetWants(B.Wants)
        } else {
            try {
                jQuery.getScript("http://sys.ipow.cn/IpowAPI/Client/Activity.ashx?Type=getwant&ActID="
         + aActivityID + "&CallBack=aTools.GetWants&temp" + Math.random())
            } catch (A) {
            }
        }
    }, GetActData: function (B) {
        if (B.Type == "OK") {
            if ($.browser.mozilla) {
                thisMovie("iPowEyes1").GetWants(B.Wants);
                thisMovie("iPowEyes1").GetVisits(B.Visits)
            } else {
                thisMovie("iPowEyes").GetWants(B.Wants);
                thisMovie("iPowEyes").GetVisits(B.Visits)
            }
        }
        else {
            try {
                jQuery.getScript("http://sys.ipow.cn/IpowAPI/Client/Activity.ashx?Type=getwant&ActID=" + aActivityID + "&CallBack=aTools.GetActData&temp" + Math.random())
            } catch (A) { }
        }
    }, GoVisit: function () {
        try {
            jQuery.getScript("http://sys.ipow.cn/IpowAPI/Client/Activity.ashx?Type=visit&ActID=" + aActivityID + "&CallBack=aTools.GetVisits&temp" + Math.random())
        } catch (A) { }
    }, GetVisits: function (A) {
        if (A.Type == "OK") if ($.browser.mozilla) thisMovie("iPowEyes1").GetVisits(A.Visits);
        else thisMovie("iPowEyes").GetVisits(A.Visits)
    }
};
jQuery.extend(jQuery.easing, { easeInOutExpo: function (E, B, C, D, A) {
    if (B == 0) return C; if (B == A) return C + D; if ((B /= A / 2) < 1) return D / 2 * Math.pow(2, 10 * (B - 1)) + C;
    return D / 2 * (-Math.pow(2, -10 * --B) + 2) + C
}, easeInElastic: function (H, B, D, E, A) {
    var C = 1.70158, G = 0, F = E; if (B == 0) return D; if ((B /= A) == 1) return D + E; if (!G) G = A * 0.3;
    if (F < Math.abs(E)) { F = E; C = G / 4 } else C = G / (2 * Math.PI) * Math.asin(E / F); return -(F * Math.pow(2, 10 * (B -= 1)) * Math.sin((B * A - C) * (2 * Math.PI) / G)) + D
}
});
function insertFlash(B, A) {
    var C = "";
    C += "<object classid=\"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000\" id=\"" +
  A + "\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" border=\"0\" width=\"100%\" height=\"100%\">";
    C += "<param name=\"movie\" value=\"" +
  B + "\">"; C += "<param name=\"quality\" value=\"high\"> ";
    C += "<param name=\"wmode\" value=\"transparent\">";
    C += "<param name=\"menu\" value=\"false\">";
    C += "<embed src=\"" + B
   + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" name=\"" + A +
    "\" width=\"100%\" height=\"100%\" quality=\"High\" wmode=\"transparent\" style=\"overflow:hidden\">";
    C += "</embed>"; C += "</object>";
    return C
} $.fn.dropdown = function () {
    return this.each(function () {
        var B = this, A = $(B).find("span"); A.click(function () { $(B).find("ul").slideToggle("fast") }); $(B).find("ul li a").click(function () {
            var C = $(this);
            $(B).find("ul").slideToggle("fast", function () { A.text(C.text()) })
        })
    })
};
jQuery.fn.GameComm = function (A) {
    A = jQuery.extend({ pagesize: 5, cardid: 2, cardname: "" }, A);
    return this.each(function () {
        var F = this; $("#btnSubmitComm").unbind().click(function () { E() });
        $("#btnResetComm").unbind().click(function () {
            $("#txtCommContent").val("");
            $("#txtUserName").val("")
        }); var C = function (C) {
            B(C, A.cardid)
        }, B = function (B, E) {
            var C = "";
            $.getJSON("/webmanage/game/gamecomm.aspx?temp" + Math.random(), { Type: "GetList", PageSize: A.pagesize, PageIndex: B, CardID: E }, function (A) {
                if (A.Type == "OK") {
                    D(B, A.TotalPage);
                    $.each(A.List, function (A, B) {
                        C += "<li>                    \t<img src=\"/activity/halloween/gahtm/images/tx.gif\" width=\"58\" height=\"63\" />                        <span><h4>" + B.UserName
 + "</h4><em>" + B.AddTime + "</em></span>                        <p>" + B.Content + "</p>                    </li>"
                    }); $(F).html(C)
                }
            })
        }, D = function (A, D) {
            var B = UiPage(A, D);
            $("#CommPageInfo").html(B); $("#CommPageInfo a").unbind(); $("#CommPageInfo a").click(function () {
                var B = $(this).text(), D = A; switch (B) {
                    case "\u4e0a\u4e00\u9875": D = parseInt(D - 1); C(D);
                        break; case "\u4e0b\u4e00\u9875": D = parseInt(D + 1); C(D); break; default: C(parseInt($(this).text())); break
                }
            })
        }, E = function () {
            var D = $("#txtUserName").val(); D = D.replace(/　/g, "");
            var B = $("#txtCommContent").val(); B = B.replace(/　/g, ""); var E = $("#rPSex input:checked").val(); if (D == "") {
                alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\uff1a\uff09");
                $("#txtUserName").focus(); return false
            } if (B == "") { alert("\u8bf7\u8f93\u5165\u60a8\u7684\u8bc4\u8bba\u5185\u5bb9\uff1a\uff09"); $("#txtCommContent").focus(); return false } else if (B.length < 5) {
                alert("\u8bc4\u8bba\u5185\u5bb9\u81f3\u5c11\u4e94\u4e2a\u5b57\uff1a\uff09"); $("#txtCommContent").focus(); return false
            } $("#AddCommCon").slideUp("slow", function () {
                var F = this;
                $.getJSON("/webmanage/game/gamecomm.aspx?temp" + Math.random(), { Type: "AddComm", CardID: A.cardid, Content: B, UserName: D, Sex: E }, function (A) {
                    $("#txtCommContent").val("");
                    $("#txtUserName").val(""); $(F).show(); C(1)
                })
            })
        }; C(1)
    })
};
function initDate(value) {
    var commDate = eval(value); commDate = commDate.toLocaleDateString() + " " + commDate.toLocaleTimeString();
    return commDate
}
function UiPage(A, C) {
    var B = "";
    if (A < 1) A = 1;
    if (A > C) A = C;
    if (A <= 1);
    else B = "<a href=\"javascript:;\" class=\"prev\" id=\"turnPrev\">\u4e0a\u4e00\u9875</a>" + B;
    var D;
    if (A <= 10 && C <= 10) {
        for (D = 1; D <= C; D++)
            if (D == A) B = "    <b>" +
      D + "</b>" + B;
            else B = "<a href=\"javascript:;\" id=\"bookpage" + D + "\">" + D + "</a>" + B
        }
        else if (C >= 10 && A <= 5) {
            for (D = 1;
    D <= 10; D++) if (D == A) B = "    <b>" + D + "</b>" + B;
            else B = "<a href=\"javascript:;\" id=\"bookpage" + D + "\">" + D + " </a>" + B
        }
        else if ((A + 5) <= C) {
            for (D = (A - 4); D <= (A + 5);
     D++) if (D == A) B = "    <b>" + D + "</b>" + B;
            else B = "<a href=\"javascript:;\" id=\"bookpage" + D
       + "\">" + D + " </a>" + B
        }
        else for (D = (A - 4); D <= C; D++) if (D == A) B = "    <b>" +
     D + "</b>" + B; else B = "<a href=\"javascript:;\" id=\"bookpage" + D + "\">" + D + " </a>" + B;
        if (A >= C);
        else B = "<a href=\"javascript:;\" class=\"next\" id=\"turnNext\">\u4e0b\u4e00\u9875</a>" + B; return B
    } function isEmail(A) {
        var B = /^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/; if (!B.exec(A)) return false; return true
    } function isMobile(B) {
        if (B.length == 0) {
            alert("\u8bf7\u8f93\u5165\u624b\u673a\u53f7\u7801\uff01"); return false
        } if (B.length != 11) {
            alert("\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801\uff01"); return false
        } var A = /^(((13[0-9]{1})|159|153|158|150|189)+\d{8})$/; if (!A.test(B)) { alert("\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801\uff01"); return false } return true
    } function get_cookie(C) {
        var E = "", A = document.cookie; if (A != "") {
            var B = A.split("; "); for (var F = 0; F < B.length; F++) {
                var D = B[F].split("="); if (C == D[0]) {
                    E = D[1]; break
                }
            }
        } if (E != "undefined") return E; else return ""
    } function deleteCookie(A) {
        var B = new Date(); B.setTime(B.getTime() - 10000); document.cookie = A +
       "=No; expire=" + B.toGMTString()
    } function thisMovie(A) { if (navigator.appName.indexOf("Microsoft") != -1) return window[A]; else return document[A] } function SaveCard() {
        thisMovie("GameFlash").SaveC()
    } function CheckUser() {
        var A = get_cookie("bjUserName"); if (A == "No") {
            loginType = "saveC";
            jQuery("#iRainbow_Tools a:eq(1)").trigger("click"); return false
        } else { SaveCard(); return false }
    } jQuery.fn.quickMenu = function (A) {
        A = jQuery.extend({ index: 0 }, A); return this.each(function () {
            var A = $(this); A.click(function () { A.find("span").fadeIn("500") });
            A.mouseleave(function () { A.find("span").fadeOut("500") })
        })
    }; function actTools() {
        aActivityID = jQuery("#aActivityID").val(); $("#iRainQuick").quickMenu({}); aTools.GoVisit();
        aTools.GetWants({ Type: "Get" }); var A = setInterval(function () { aTools.GetActData({ Type: "Get" }) }, 10000)
    }
    jQuery(document).ready(function () {
        aTools = new iARainbow();
        aTools.init();
        actTools();
    });


