Class(function(extend, using, self) {
    extend("pages/page");
    using("lib/jquery.min.js");
    using("plugin/switchtab");

    var zoneid,
        uid,
        groupid;

    self.sub_room_info_ref = null;
    self.filename = "";
    self.on_change = 0;
    self.root_room = 0;
    self.initPage = function () {
        this.log_trace(child_roominfoset, "SubRoomSettings initPage  start");
        $(function () {
            $(".set-btn-box li").SwitchTab({             // $('.newsBar a') 点击元素
                showObj: '.set-content',        // 需显示的内容（必填项）
                mouseEvent: 'click',    // 鼠标事件设定，默认：click
                currentClass: 'active',     //当前tab class
                showEffect: "show"      // 默认show（无效果），fade（渐隐渐现）,slide（窗帘效果）
            });
        });

        /* 加载子房间iframe 开始 */
        zoneid = this.sub_room_info_ref.get_room_info().zoneid;
        uid = this.sub_room_info_ref.get_user_id();
        var weburl = this.sub_room_info_ref.get_webaddress();
        var init_notice_url = weburl + "/plat/html/group_member.html?zoneid=" + zoneid;
        //alert(init_notice_url)
        /*初始化iframe*/
        $(".c-group-notice").html('<iframe frameborder="0" scrolling="no" style="width:421px;height:308px;display:block;"></iframe>');
        $(".c-group-notice iframe").attr({src: init_notice_url});
        /*通过cookie获取管理员和黑名单*/
        var cookie = this.sub_room_info_ref.on_cookie_mgrsetting();
        var srand = parseInt(Math.random()*10000);
        groupid = this.sub_room_info_ref.get_room_info().groupid;
        var key = "";
        var noticeurl = weburl + "/plat/login?ReturnUrl=" + encodeURIComponent(weburl + "/plat/html/group_member.html?zoneid=" + zoneid + "&groupid=" + groupid + "&key=" + key + "&srand=" + srand) + "&uid=" + uid + "&cookie=" + cookie;
        child_roominfoset.log_trace("URL:" + noticeurl);
        $(".c-group-notice iframe").attr({src: noticeurl});


        /*  cookie获取管理员和黑名单结束  */
        this.sub_room_info_ref.autologin_mgrreq("");//向接口传空值,下面配置管理员和黑名单URL

        this.sub_room_info_ref.autologin_darklistreq(noticeurl);
        /* 加载子房间iframe 结束 */
        this.log_trace(child_roominfoset, "roomSet initPage  end");
        this.bindRoomChildrenInfo();

        this.log_trace(child_roominfoset, "SubRoomSettings initPage  end");
    }
    // 绑定房间设置信息
    self.bindRoomChildrenInfo = function () {
        var group_info = this.sub_room_info_ref.get_child_room_info();
        if(group_info.rootgroup == true) {
            this.root_room = 1;
            $('#room_name').append('<div class="overflow-parent"><div class="overflow-content sub-room-name"></div></div>');
            $(".sub-room-name").text(group_info.groupname);
        } else {
            $('#room_name').append('<input type="text" class="w272h25 sub-room-name"  maxlength="40"/>');
            $(".sub-room-name").val(group_info.groupname);
        }
        $(".c-default-mictime").val(group_info.default_mictime);
        /* 房间最多人数*/
        if (group_info.use_max_player) {
            $(".c-max-player").prop('checked', true);
        } else {
            this.setDisableColor(".c-max-player-val");
        }
        $(".c-max-player-val").val(group_info.max_player);
        /* 房间只对会员开放*/
        if (group_info.open_to_member) {
            $(".c-open-to-member").prop('checked', true);
        }
        /* 设置房间密码*/
        if (group_info.b_set_password) {
            $(".c-set-passwd").prop('checked', true);
        } else {
            this.setDisableColor(".c-set-passwd-val");
        }
        //$(".c-set-passwd-val").val(group_info.set_password_content); ??密码内容没定义
        /* 是否限制聊天速度*/
        if (group_info.b_limit_textsend) {
            $(".c-limit-textsend").prop('checked', true);
        } else {
            this.setDisableColor("input[rol='c-input-limit-textsend-max-val']");
        }
        $("input[rol='c-input-limit-textsend-max-val']").val(group_info.limit_textsend_time);

        /* 是否禁止发送链接*/
        if (group_info.b_block_guest_userlink) {
            $(".c-block-guest-userlink").prop('checked', true);
        } else {
            this.setDisableColor(".c-userlink-identity");
        }

        /*是否禁止发送链接身份*/
        if(group_info.b_block_userlink_identity) {
            $("select[name='c-userlink-identity'] option:eq(1)").attr("selected", true);
        } else {
            $("select[name='c-userlink-identity'] option:eq(0)").attr("selected", true);
        }


        /* 是否禁止游客聊天*/
        if (group_info.b_block_guest_chat) { //  b_block_guest_userlink 换成 b_block_guest_chat
            $(".c-limit-guestchat").prop('checked', true);
        } else {
            this.setDisableColor(".c-guestchat-identity");
        }
        /*group_info.b_block_userlink_identity 是否禁止游客与会员文字聊天*/
        var b_block_chat_identify = group_info.b_block_chat_identify; //b_block_userlink_identity字段需要改b_block_chat_identify
        if(b_block_chat_identify & 1) {
            $("select[name='c-guestchat-identity'] option:eq(1)").attr("selected", true);
        } else {
            $("select[name='c-guestchat-identity'] option:eq(0)").attr("selected", true);
        }



        /* 游戏是否只使用小字，黑色字体*/
        if (group_info.b_guest_onlyuse_specialfont) {
            $(".c-use-specialfont").prop('checked', true);
        }
        /* 是否游客进入房间多少时间后发言*/
        if (group_info.b_setguest_chattime_afterenter) {
            $(".c-setguest-chat").prop('checked', true);
        } else {
            this.setDisableColor(".c-setguest-chat-val");
        }
        $(".c-setguest-chat-val").val(group_info.time_guestchat_afterenter);
        /* 是否限制游客聊天长度*/
        if (group_info.b_limit_guestchat_len) {
            $(".c-limit-chat-len").prop('checked', true); ;
        } else {
            this.setDisableColor("input[rol='c-limit-chat-len-max']");
        }
        $("input[rol='c-limit-chat-len-max']").val(group_info.limit_guestchat_len);
    }
    // 设置应用的状态
    self.settingApply = function (apply_status) {
        if (apply_status) { $(".btn-box button:eq(2)").removeAttr("disabled").removeClass("disabled"); this.on_change = 1; } else { $(".btn-box button:eq(2)").attr("disabled", "disabled").addClass("disabled"); this.on_change = 0; }
    }
    self.setDisableColor = function(target) {
        $(target).attr('disabled', 'disabled');
        $(target).css("color","#C0C0C0");
    }
    self.removeDisableColor = function(target) {
        $(target).removeAttr("disabled");
        $(target).css("color","");
    }

    self.initEvent = function(){
        var that = this;
        $(document).delegate(".c-default-mictime,input[rol='c-input-max-val'],input[rol='c-input-limit-textsend-max-val'],input[rol='c-input-setguest-chat-max'],input[rol='c-limit-chat-len-max']", "keydown", function (event) {
            var keyCode = event.which;
            /**
             *   8:  BackSpace  46: Delete  37: Left Arrow  39: Right Arrow  16: Shift  36: Home  35: End
             */

            if (keyCode == 8 || keyCode == 9 || keyCode == 46 || keyCode == 37 || keyCode == 39 || keyCode == 16) {
                return true;
            }
            if ((keyCode >= 48 && keyCode <=57) || (keyCode >= 96 && keyCode <= 105) )
                return true;
            else
                return false;
        }).focus(function() {
            this.style.imeMode='disabled';
        }).delegate(".c-default-mictime,input[rol='c-input-max-val'],input[rol='c-input-limit-textsend-max-val'],input[rol='c-input-setguest-chat-max'],input[rol='c-limit-chat-len-max']", "input", function () {
            var reg = /^[0-9]*$/;
            var str = this.value;
            var flag = reg.test(str);
            if (flag == false) {
                var ww = str.replace(/\D+/g, "");
                this.value = ww;
                return false;
            }
        });
        /* 绑定所有input onchange 事件*/
        $("input").each(function(key , value){
            if($(this).is("input[type='checkbox']")){
                $(this).delegate(this, "click", function () {
                    that.settingApply(1);
                });
            }else{
                $(this).delegate(this, "keyup", function () {
                    that.settingApply(1);
                });
            }
        });

        /* 最大人数*/
        $(document).delegate(".c-max-player", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor(".c-max-player-val");
            } else {
                that.setDisableColor(".c-max-player-val");
            }
        });

        /* 设置密码*/
        $(document).delegate(".c-set-passwd", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor(".c-set-passwd-val");
            } else {
                that.setDisableColor(".c-set-passwd-val");
            }
        });

        /* 禁止游客与会员发链接*/
        $(document).delegate(".c-block-guest-userlink", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor(".c-userlink-identity");
            } else {
                that.setDisableColor(".c-userlink-identity");
            }
        });


        /* 禁止游客与会员文字聊天*/
        $(document).delegate(".c-limit-guestchat", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor(".c-guestchat-identity");
            } else {
                that.setDisableColor(".c-guestchat-identity");
            }
        });


        /* 限制游客或者游客及会员发送链接*/
        $(document).delegate("select[name='c-userlink-identity']", "change", function () {
            that.settingApply(1);
        });


        /* 限制游客或者游客及会员发送文字*/
        $(document).delegate("select[name='c-guestchat-identity']", "change", function () {
            that.settingApply(1);
        });

        /* 限制游客或者游客及会员发送链接*/
        $(document).delegate(".sub-room-name", "input", function () {
            that.settingApply(1);
        });

        /* 限制文字聊天速度*/
        $(document).delegate(".c-limit-textsend", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor("input[rol='c-input-limit-textsend-max-val']");
            } else {
                that.setDisableColor("input[rol='c-input-limit-textsend-max-val']");
            }
        });



        /* 游客是(否)进房间发言时间限制*/
        $(document).delegate(".c-setguest-chat", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor(".c-setguest-chat-val");
            } else {
                that.setDisableColor(".c-setguest-chat-val");
            }
        });
        /* 限制游客文字消息*/
        $(document).delegate(".c-limit-chat-len", "click", function () {
            if($(this).is(':checked')) {
                that.removeDisableColor("input[rol='c-limit-chat-len-max']");
            } else {
                that.setDisableColor("input[rol='c-limit-chat-len-max']");
            }
        });

        /* 取消按钮*/
        $(document).delegate(".btn-box button:eq(1)", "click", function () {
            that.sub_room_info_ref.btn_close_click();
        });

        /* 确定按钮*/
        $(document).delegate(".btn-box button:eq(0)", "click", function () {
            that.sub_room_info_ref.btn_ok_click(that.on_change);
        });

        /* 应用按钮*/
        $(document).delegate(".btn-box button:eq(2)", "click", function () {
            if(that.on_change) {
                that.sub_room_info_ref.btn_apply_click();
                that.settingApply(false);
            }
        });
        /*
         * 点击label，相邻兄弟节点checked改变状态
         */
        $(document).delegate("label", "click", function () {
            that.settingApply(true);
            var flag = $(this).prev().is(":checked");
            if(flag == true) {
                if($(this).hasClass("c-guestchat-select")) {
                    that.setDisableColor(".c-guestchat-identity");
                }
                if($(this).hasClass("c-limit-label-val")) {
                    that.setDisableColor(".c-limit-textsend-val");
                }

                if($(this).hasClass("c-label-setguest-chat-val")) {
                    that.setDisableColor(".c-setguest-chat-val");
                }

                if($(this).hasClass("c-label-limit-chat-len-val")) {
                    that.setDisableColor(".c-limit-chat-len-val");
                }

                if($(this).hasClass("c-userlink-select")) {
                    that.setDisableColor(".c-userlink-identity");
                }

                if($(this).hasClass("c-max-people-limit")) {
                    that.setDisableColor(".c-max-player-val");
                }

                if($(this).hasClass("c-set-pass-label")) {
                    that.setDisableColor(".c-set-passwd-val");
                }

                $(this).prev().prop('checked', false);
            } else {
                if($(this).hasClass("c-guestchat-select")) {
                    that.removeDisableColor(".c-guestchat-identity");
                }
                if($(this).hasClass("c-limit-label-val")) {
                    that.removeDisableColor(".c-limit-textsend-val");
                }
                if($(this).hasClass("c-userlink-select")) {
                    that.removeDisableColor(".c-userlink-identity");
                }
                if($(this).hasClass("c-label-setguest-chat-val")) {
                    that.removeDisableColor(".c-setguest-chat-val");
                }

                if($(this).hasClass("c-label-limit-chat-len-val")) {
                    that.removeDisableColor(".c-limit-chat-len-val");
                }

                if($(this).hasClass("c-max-people-limit")) {
                    that.removeDisableColor(".c-max-player-val");
                }

                if($(this).hasClass("c-set-pass-label")) {
                    that.removeDisableColor(".c-set-passwd-val");
                }

                $(this).prev().prop('checked', true);
            }

        });

        /*
         input number only
         */
        $('.input-number-only').on('input', function(){
            this.value = this.value.replace(/\D/g, '');
        });
    }

    self.func(function(curData){
        var that = this;

        that.addCall("send_group_info", function() {
            var groupname = '';
            if(that.root_room == 1) {
                groupname = that.encodeHTML($(".sub-room-name").text());
                //groupname = $(".sub-room-name").text().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
            }  else{
                groupname = that.encodeHTML($(".sub-room-name").val());
                //groupname = $(".sub-room-name").val().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
            }
            var default_mictime = that.toInt($(".c-default-mictime").val());
            var b_block_guest_chat = 0;  //b_block_guest_userlink 换成 b_block_guest_chat
            if ($("input[class='c-limit-guestchat']").is(":checked")) {
                b_block_guest_chat = 1;
            }


            var b_guest_onlyuse_specialfont = 0;
            if ($("input[class='c-use-specialfont']").is(":checked")) {
                b_guest_onlyuse_specialfont = 1;
            }

            var b_limit_textsend = 0;
            if ($("input[class='c-limit-textsend']").is(":checked")) {
                b_limit_textsend = 1;
            }

            var limit_textsend_time = that.toInt($("input[rol='c-input-limit-textsend-max-val']").val());

            var b_limit_guestchat_len = 0;
            if ($("input[class='c-limit-chat-len']").is(":checked")) {
                b_limit_guestchat_len = 1;
            }

            var limit_guestchat_len = that.toInt($("input[rol='c-limit-chat-len-max']").val());

            var open_to_member = 0;
            if ($(".c-open-to-member").is(":checked")) {
                open_to_member = 1;
            }

            var use_max_player = 0;
            if ($(".c-max-player").is(":checked")) {
                use_max_player = 1;
            }

            var max_player = that.toInt($(".c-max-player-val").val());

            var b_setguest_chattime_afterenter = 0;
            if ($("input[class='c-setguest-chat']").is(":checked")) {
                b_setguest_chattime_afterenter = 1;
            }

            var time_guestchat_afterenter = that.toInt($(".c-setguest-chat-val").val());

            var b_block_guest_userlink = 0;
            if ($("input[class='c-block-guest-userlink']").is(":checked")) {
                b_block_guest_userlink = 1;
            }

            var b_block_userlink_identity =  that.toInt($("select[name='c-userlink-identity']").val());

            // alert(b_block_userlink_identity);
            // 禁止游客与会员/游客文字聊天
            var b_block_chat_identify = that.toInt($("select[name='c-guestchat-identity']").val());

            var b_set_password = 0;
            if ($(".c-set-passwd").is(":checked")) {
                b_set_password = 1;
            }
            var set_pasword_content = $(".c-set-passwd-val").val().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
            var text_one = "{ \"groupname\":\"" + groupname + "\",\"default_mictime\":" + default_mictime + ",\"b_block_guest_chat\":" + b_block_guest_chat +  ",\"b_guest_onlyuse_specialfont\":" + b_guest_onlyuse_specialfont;
            var text_two = ",\"b_limit_textsend\":" + b_limit_textsend + ",\"limit_textsend_time\":" + limit_textsend_time + ",\"b_limit_guestchat_len\":" + b_limit_guestchat_len;
            var text_three = ",\"limit_guestchat_len\":" + limit_guestchat_len + ",\"open_to_member\":" + open_to_member + ",\"use_max_player\":" + use_max_player;
            var text_four =  ",\"max_player\":" + max_player + ",\"b_setguest_chattime_afterenter\":" + b_setguest_chattime_afterenter + ",\"time_guestchat_afterenter\":" + time_guestchat_afterenter;
            var text_five =  ",\"b_block_chat_identify\":" + b_block_chat_identify +  ",\"b_block_guest_userlink\":" + b_block_guest_userlink + ",\"b_block_userlink_identity\":" + b_block_userlink_identity +  ",\"b_set_password\":" + b_set_password + ",\"set_password_content\":\"" + set_pasword_content + "\"}";
            var text = text_one + text_two + text_three + text_four + text_five;
            return that.formatData(text);
        });

        /*子房间自动登录*/
        that.addCall("on_autologin_mgrsetting", function() {
            var autourl = that.sub_room_info_ref.get_automgr();
            if (that.isEmpty(autourl)) {
                return false;
            }
            var weburl = that.sub_room_info_ref.get_webaddress();
            var key = autourl.substring(autourl.indexOf("encryptStr=") + 11, autourl.indexOf("&systemUrl="));
            var srand=parseInt(Math.random()*10000);
            var noticeurl = encodeURIComponent(weburl + "/plat/login?ReturnUrl=" + encodeURIComponent(weburl + "/plat/html/group_member.html?zoneid=" + zoneid + "&groupid=" + groupid + "&key=" + key+"&srand="+srand));
            $(".c-group-notice iframe").attr({src: autourl + noticeurl});
            return true;
        });


        that.sub_room_info_ref = curData;//child_roominfoset;

        that.sup().constructor(curData);

        that.initPage();
        that.initEvent();
    })
})

//var zoneid, uid, groupid;
//that = that || {
//    sub_room_info_ref: null,
//    filename: "",
//    on_change: 0,
//    root_room: 0,
//    initPage: function () {
//        Audio.log_trace(child_roominfoset, "SubRoomSettings initPage  start");
//        $(function () {
//            $(".set-btn-box li").SwitchTab({             // $('.newsBar a') 点击元素
//                showObj: '.set-content',        // 需显示的内容（必填项）
//                mouseEvent: 'click',    // 鼠标事件设定，默认：click
//                currentClass: 'active',     //当前tab class
//                showEffect: "show"      // 默认show（无效果），fade（渐隐渐现）,slide（窗帘效果）
//            });
//        });
//
//        /* 加载子房间iframe 开始 */
//        zoneid = this.sub_room_info_ref.get_room_info().zoneid;
//        uid = this.sub_room_info_ref.get_user_id();
//        var weburl = this.sub_room_info_ref.get_webaddress();
//        var init_notice_url = weburl + "/plat/html/group_member.html?zoneid=" + zoneid;
//        /*初始化iframe*/
//        $(".c-group-notice").html('<iframe frameborder="0" scrolling="no" style="width:421px;height:308px;display:block;"></iframe>');
//        $(".c-group-notice iframe").attr({src: init_notice_url});
//        /*通过cookie获取管理员和黑名单*/
//        var cookie = this.sub_room_info_ref.on_cookie_mgrsetting();
//        var srand = parseInt(Math.random()*10000);
//        groupid = this.sub_room_info_ref.get_room_info().groupid;
//        var key = "";
//        var noticeurl = weburl + "/plat/login?ReturnUrl=" + encodeURIComponent(weburl + "/plat/html/group_member.html?zoneid=" + zoneid + "&groupid=" + groupid + "&key=" + key + "&srand=" + srand) + "&uid=" + uid + "&cookie=" + cookie;
//        child_roominfoset.log_trace("URL:" + noticeurl);
//        $(".c-group-notice iframe").attr({src: noticeurl});
//
//
//        /*  cookie获取管理员和黑名单结束  */
//        this.sub_room_info_ref.autologin_mgrreq("");//向接口传空值,下面配置管理员和黑名单URL
//
//        this.sub_room_info_ref.autologin_darklistreq(noticeurl);
//        /* 加载子房间iframe 结束 */
//        Audio.log_trace(child_roominfoset, "roomSet initPage  end");
//        this.bindRoomChildrenInfo();
//
//        Audio.log_trace(child_roominfoset, "SubRoomSettings initPage  end");
//    }, /* 绑定房间设置信息 */
//    bindRoomChildrenInfo: function () {
//        var group_info = this.sub_room_info_ref.get_child_room_info();
//        if(group_info.rootgroup == true) {
//            that.root_room = 1;
//            $('#room_name').append('<div class="overflow-parent"><div class="overflow-content sub-room-name"></div></div>');
//            $(".sub-room-name").text(group_info.groupname);
//        } else {
//            $('#room_name').append('<input type="text" class="w272h25 sub-room-name"  maxlength="40"/>');
//            $(".sub-room-name").val(group_info.groupname);
//        }
//        $(".c-default-mictime").val(group_info.default_mictime);
//        /* 房间最多人数*/
//        if (group_info.use_max_player) {
//            $(".c-max-player").prop('checked', true);
//        } else {
//            that.setDisableColor(".c-max-player-val");
//        }
//        $(".c-max-player-val").val(group_info.max_player);
//        /* 房间只对会员开放*/
//        if (group_info.open_to_member) {
//            $(".c-open-to-member").prop('checked', true);
//        }
//        /* 设置房间密码*/
//        if (group_info.b_set_password) {
//            $(".c-set-passwd").prop('checked', true);
//        } else {
//            that.setDisableColor(".c-set-passwd-val");
//        }
//        //$(".c-set-passwd-val").val(group_info.set_password_content); ??密码内容没定义
//        /* 是否限制聊天速度*/
//        if (group_info.b_limit_textsend) {
//            $(".c-limit-textsend").prop('checked', true);
//        } else {
//            that.setDisableColor("input[rol='c-input-limit-textsend-max-val']");
//        }
//        $("input[rol='c-input-limit-textsend-max-val']").val(group_info.limit_textsend_time);
//
//        /* 是否禁止发送链接*/
//        if (group_info.b_block_guest_userlink) {
//            $(".c-block-guest-userlink").prop('checked', true);
//        } else {
//            that.setDisableColor(".c-userlink-identity");
//        }
//
//        /*是否禁止发送链接身份*/
//        if(group_info.b_block_userlink_identity) {
//            $("select[name='c-userlink-identity'] option:eq(1)").attr("selected", true);
//        } else {
//            $("select[name='c-userlink-identity'] option:eq(0)").attr("selected", true);
//        }
//
//
//        /* 是否禁止游客聊天*/
//        if (group_info.b_block_guest_chat) { //  b_block_guest_userlink 换成 b_block_guest_chat
//            $(".c-limit-guestchat").prop('checked', true);
//        } else {
//            that.setDisableColor(".c-guestchat-identity");
//        }
//        /*group_info.b_block_userlink_identity 是否禁止游客与会员文字聊天*/
//        var b_block_chat_identify = group_info.b_block_chat_identify; //b_block_userlink_identity字段需要改b_block_chat_identify
//        if(b_block_chat_identify & 1) {
//            $("select[name='c-guestchat-identity'] option:eq(1)").attr("selected", true);
//        } else {
//            $("select[name='c-guestchat-identity'] option:eq(0)").attr("selected", true);
//        }
//
//
//
//        /* 游戏是否只使用小字，黑色字体*/
//        if (group_info.b_guest_onlyuse_specialfont) {
//            $(".c-use-specialfont").prop('checked', true);
//        }
//        /* 是否游客进入房间多少时间后发言*/
//        if (group_info.b_setguest_chattime_afterenter) {
//            $(".c-setguest-chat").prop('checked', true);
//        } else {
//            that.setDisableColor(".c-setguest-chat-val");
//        }
//        $(".c-setguest-chat-val").val(group_info.time_guestchat_afterenter);
//        /* 是否限制游客聊天长度*/
//        if (group_info.b_limit_guestchat_len) {
//            $(".c-limit-chat-len").prop('checked', true); ;
//        } else {
//            that.setDisableColor("input[rol='c-limit-chat-len-max']");
//        }
//        $("input[rol='c-limit-chat-len-max']").val(group_info.limit_guestchat_len);
//    }, /* 设置应用的状态 */
//    settingApply: function (apply_status) {
//        if (apply_status) { $(".btn-box button:eq(2)").removeAttr("disabled").removeClass("disabled"); this.on_change = 1; } else { $(".btn-box button:eq(2)").attr("disabled", "disabled").addClass("disabled"); this.on_change = 0; }
//    },
//    setDisableColor: function(target) {
//        $(target).attr('disabled', 'disabled');
//        $(target).css("color","#C0C0C0");
//    },
//    removeDisableColor: function(target) {
//       $(target).removeAttr("disabled");
//       $(target).css("color","");
//    }
//};
/* 提交修改信息*/
//function send_group_info() {
//    var groupname = '';
//    if(that.root_room == 1) {
//        groupname = Audio.encodeHTML($(".sub-room-name").text());
//        //groupname = $(".sub-room-name").text().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
//    }  else{
//        groupname = Audio.encodeHTML($(".sub-room-name").val());
//        //groupname = $(".sub-room-name").val().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
//    }
//    var default_mictime = Audio.toInt($(".c-default-mictime").val());
//    var b_block_guest_chat = 0;  //b_block_guest_userlink 换成 b_block_guest_chat
//    if ($("input[class='c-limit-guestchat']").is(":checked")) {
//        b_block_guest_chat = 1;
//    }
//
//
//    var b_guest_onlyuse_specialfont = 0;
//    if ($("input[class='c-use-specialfont']").is(":checked")) {
//        b_guest_onlyuse_specialfont = 1;
//    }
//
//    var b_limit_textsend = 0;
//    if ($("input[class='c-limit-textsend']").is(":checked")) {
//        b_limit_textsend = 1;
//    }
//
//    var limit_textsend_time = Audio.toInt($("input[rol='c-input-limit-textsend-max-val']").val());
//
//    var b_limit_guestchat_len = 0;
//    if ($("input[class='c-limit-chat-len']").is(":checked")) {
//        b_limit_guestchat_len = 1;
//    }
//
//    var limit_guestchat_len = Audio.toInt($("input[rol='c-limit-chat-len-max']").val());
//
//    var open_to_member = 0;
//    if ($(".c-open-to-member").is(":checked")) {
//        open_to_member = 1;
//    }
//
//    var use_max_player = 0;
//    if ($(".c-max-player").is(":checked")) {
//        use_max_player = 1;
//    }
//
//    var max_player = Audio.toInt($(".c-max-player-val").val());
//
//    var b_setguest_chattime_afterenter = 0;
//    if ($("input[class='c-setguest-chat']").is(":checked")) {
//        b_setguest_chattime_afterenter = 1;
//    }
//
//    var time_guestchat_afterenter = Audio.toInt($(".c-setguest-chat-val").val());
//
//    var b_block_guest_userlink = 0;
//    if ($("input[class='c-block-guest-userlink']").is(":checked")) {
//        b_block_guest_userlink = 1;
//    }
//
//    var b_block_userlink_identity =  Audio.toInt($("select[name='c-userlink-identity']").val());
//
//   // alert(b_block_userlink_identity);
//    // 禁止游客与会员/游客文字聊天
//    var b_block_chat_identify = Audio.toInt($("select[name='c-guestchat-identity']").val());
//
//    var b_set_password = 0;
//    if ($(".c-set-passwd").is(":checked")) {
//        b_set_password = 1;
//    }
//    var set_pasword_content = $(".c-set-passwd-val").val().replace(/\"/g,"\\\"").replace(/\'/g,"\'");
//    var text_one = "{ \"groupname\":\"" + groupname + "\",\"default_mictime\":" + default_mictime + ",\"b_block_guest_chat\":" + b_block_guest_chat +  ",\"b_guest_onlyuse_specialfont\":" + b_guest_onlyuse_specialfont;
//    var text_two = ",\"b_limit_textsend\":" + b_limit_textsend + ",\"limit_textsend_time\":" + limit_textsend_time + ",\"b_limit_guestchat_len\":" + b_limit_guestchat_len;
//    var text_three = ",\"limit_guestchat_len\":" + limit_guestchat_len + ",\"open_to_member\":" + open_to_member + ",\"use_max_player\":" + use_max_player;
//    var text_four =  ",\"max_player\":" + max_player + ",\"b_setguest_chattime_afterenter\":" + b_setguest_chattime_afterenter + ",\"time_guestchat_afterenter\":" + time_guestchat_afterenter;
//    var text_five =  ",\"b_block_chat_identify\":" + b_block_chat_identify +  ",\"b_block_guest_userlink\":" + b_block_guest_userlink + ",\"b_block_userlink_identity\":" + b_block_userlink_identity +  ",\"b_set_password\":" + b_set_password + ",\"set_password_content\":\"" + set_pasword_content + "\"}";
//    var text = text_one + text_two + text_three + text_four + text_five;
//    return Audio.formatData(text);
//}
//
///*子房间自动登录*/
//function on_autologin_mgrsetting() {
//    var autourl = that.sub_room_info_ref.get_automgr();
//    if (Audio.isEmpty(autourl)) {
//        return false;
//    }
//    var weburl = that.sub_room_info_ref.get_webaddress();
//    var key = autourl.substring(autourl.indexOf("encryptStr=") + 11, autourl.indexOf("&systemUrl="));
//    var srand=parseInt(Math.random()*10000);
//    var noticeurl = encodeURIComponent(weburl + "/plat/login?ReturnUrl=" + encodeURIComponent(weburl + "/plat/html/group_member.html?zoneid=" + zoneid + "&groupid=" + groupid + "&key=" + key+"&srand="+srand));
//    $(".c-group-notice iframe").attr({src: autourl + noticeurl});
//    return true;
//}


//(function () {
//
//    $(document).delegate(".c-default-mictime,input[rol='c-input-max-val'],input[rol='c-input-limit-textsend-max-val'],input[rol='c-input-setguest-chat-max'],input[rol='c-limit-chat-len-max']", "keydown", function (event) {
//        var keyCode = event.which;
//        /**
//            *   8:  BackSpace  46: Delete  37: Left Arrow  39: Right Arrow  16: Shift  36: Home  35: End
//        */
//
//        if (keyCode == 8 || keyCode == 9 || keyCode == 46 || keyCode == 37 || keyCode == 39 || keyCode == 16) {
//                return true;
//        }
//        if ((keyCode >= 48 && keyCode <=57) || (keyCode >= 96 && keyCode <= 105) )
//            return true;
//        else
//            return false;
//        }).focus(function() {
//        this.style.imeMode='disabled';
//    }).delegate(".c-default-mictime,input[rol='c-input-max-val'],input[rol='c-input-limit-textsend-max-val'],input[rol='c-input-setguest-chat-max'],input[rol='c-limit-chat-len-max']", "input", function () {
//        var reg = /^[0-9]*$/;
//        var str = this.value;
//        var flag = reg.test(str);
//        if (flag == false) {
//            var ww = str.replace(/\D+/g, "");
//            this.value = ww;
//            return false;
//        }
//    });
//    /* 绑定所有input onchange 事件*/
//    $("input").each(function(key , value){
//        if($(this).is("input[type='checkbox']")){
//            $(this).delegate(this, "click", function () {
//                that.settingApply(1);
//            });
//        }else{
//            $(this).delegate(this, "keyup", function () {
//                that.settingApply(1);
//            });
//        }
//    });
//
//    /* 最大人数*/
//    $(document).delegate(".c-max-player", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor(".c-max-player-val");
//        } else {
//            that.setDisableColor(".c-max-player-val");
//        }
//    });
//
//    /* 设置密码*/
//    $(document).delegate(".c-set-passwd", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor(".c-set-passwd-val");
//        } else {
//            that.setDisableColor(".c-set-passwd-val");
//        }
//    });
//
//     /* 禁止游客与会员发链接*/
//    $(document).delegate(".c-block-guest-userlink", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor(".c-userlink-identity");
//        } else {
//            that.setDisableColor(".c-userlink-identity");
//        }
//    });
//
//
//    /* 禁止游客与会员文字聊天*/
//    $(document).delegate(".c-limit-guestchat", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor(".c-guestchat-identity");
//        } else {
//            that.setDisableColor(".c-guestchat-identity");
//        }
//    });
//
//
//    /* 限制游客或者游客及会员发送链接*/
//    $(document).delegate("select[name='c-userlink-identity']", "change", function () {
//        that.settingApply(1);
//    });
//
//
//    /* 限制游客或者游客及会员发送文字*/
//    $(document).delegate("select[name='c-guestchat-identity']", "change", function () {
//        that.settingApply(1);
//    });
//
//      /* 限制游客或者游客及会员发送链接*/
//    $(document).delegate(".sub-room-name", "input", function () {
//        that.settingApply(1);
//    });
//
//    /* 限制文字聊天速度*/
//    $(document).delegate(".c-limit-textsend", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor("input[rol='c-input-limit-textsend-max-val']");
//        } else {
//            that.setDisableColor("input[rol='c-input-limit-textsend-max-val']");
//        }
//    });
//
//
//
//    /* 游客是(否)进房间发言时间限制*/
//    $(document).delegate(".c-setguest-chat", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor(".c-setguest-chat-val");
//        } else {
//            that.setDisableColor(".c-setguest-chat-val");
//        }
//    });
//    /* 限制游客文字消息*/
//     $(document).delegate(".c-limit-chat-len", "click", function () {
//        if($(this).is(':checked')) {
//            that.removeDisableColor("input[rol='c-limit-chat-len-max']");
//        } else {
//            that.setDisableColor("input[rol='c-limit-chat-len-max']");
//        }
//    });
//
//    /* 取消按钮*/
//    $(document).delegate(".btn-box button:eq(1)", "click", function () {
//        that.sub_room_info_ref.btn_close_click();
//    });
//
//    /* 确定按钮*/
//    $(document).delegate(".btn-box button:eq(0)", "click", function () {
//        that.sub_room_info_ref.btn_ok_click(that.on_change);
//    });
//
//    /* 应用按钮*/
//    $(document).delegate(".btn-box button:eq(2)", "click", function () {
//        if(that.on_change) {
//            that.sub_room_info_ref.btn_apply_click();
//            that.settingApply(false);
//        }
//    });
//    /*
//    * 点击label，相邻兄弟节点checked改变状态
//    */
//    $(document).delegate("label", "click", function () {
//        that.settingApply(true);
//        var flag = $(this).prev().is(":checked");
//        if(flag == true) {
//            if($(this).hasClass("c-guestchat-select")) {
//                that.setDisableColor(".c-guestchat-identity");
//            }
//            if($(this).hasClass("c-limit-label-val")) {
//                that.setDisableColor(".c-limit-textsend-val");
//            }
//
//            if($(this).hasClass("c-label-setguest-chat-val")) {
//                that.setDisableColor(".c-setguest-chat-val");
//            }
//
//            if($(this).hasClass("c-label-limit-chat-len-val")) {
//                that.setDisableColor(".c-limit-chat-len-val");
//            }
//
//            if($(this).hasClass("c-userlink-select")) {
//                that.setDisableColor(".c-userlink-identity");
//            }
//
//            if($(this).hasClass("c-max-people-limit")) {
//                that.setDisableColor(".c-max-player-val");
//            }
//
//            if($(this).hasClass("c-set-pass-label")) {
//                that.setDisableColor(".c-set-passwd-val");
//            }
//
//            $(this).prev().prop('checked', false);
//        } else {
//            if($(this).hasClass("c-guestchat-select")) {
//                that.removeDisableColor(".c-guestchat-identity");
//            }
//            if($(this).hasClass("c-limit-label-val")) {
//                that.removeDisableColor(".c-limit-textsend-val");
//            }
//            if($(this).hasClass("c-userlink-select")) {
//                that.removeDisableColor(".c-userlink-identity");
//            }
//            if($(this).hasClass("c-label-setguest-chat-val")) {
//                that.removeDisableColor(".c-setguest-chat-val");
//            }
//
//            if($(this).hasClass("c-label-limit-chat-len-val")) {
//                that.removeDisableColor(".c-limit-chat-len-val");
//            }
//
//            if($(this).hasClass("c-max-people-limit")) {
//                that.removeDisableColor(".c-max-player-val");
//            }
//
//            if($(this).hasClass("c-set-pass-label")) {
//                that.removeDisableColor(".c-set-passwd-val");
//            }
//
//            $(this).prev().prop('checked', true);
//        }
//
//    });
//
//    /*
//      input number only
//     */
//    $('.input-number-only').on('input', function(){
//      this.value = this.value.replace(/\D/g, '');
//    });
//
//
//
//})();

//window.onload = function () { that.sub_room_info_ref = child_roominfoset; that.initPage(); };