(function(win, J, undefined) {
    if (win[J] === undefined) win[J] = {};
    J = win[J];
    J.version = "1.1.0"; 
	(function() {
        var initializing = false,
        fnTest = /xyz/.test(function() {xyz;}) ? /\b_super\b/: /.*/;
        function Class() {}
        Class.extend = function(prop) {
            var _super = this.prototype;
            initializing = true;
            var prototype = new this();
            initializing = false;
            for (var name in prop) {
                prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn) {
                    return function() {
                        var tmp = this._super;
                        this._super = _super[name];
                        var ret = fn.apply(this, arguments);
                        this._super = tmp;
                        return ret;
                    };
                })(name, prop[name]) : prop[name];
            }
            function Klass() {
                if (!initializing && this.init) this.init.apply(this, arguments);
            }
            Klass.prototype = prototype;
            Klass.constructor = Class;
            Klass.extend = arguments.callee;
            return Klass;
        };
        J.Class = Class;
    })();
})(window, "J16");
J16.con = window.J16.con || (function() {
    var Constants = {
        root: "http://i.9533.com/",
        crossDomainSwfId: "clockswf",
        cookies: ["J1616_www_my1616", "J1616_www_appVersions", "", ""],
        preLoadImages: ["/img/loading_big.gif"]
    };
    var tmpObj = {};
    tmpObj.get = function(name) {
        return Constants[name];
    };
    return tmpObj;
})();
J16.util = window.J16.util || {
    console: function(type, message) {
        if (window.console) window.console[type](message);
    },
    getType: function(o) {
        var s = Object.prototype.toString,
        t = {
            'undefined': 'undefined',
            'number': 'number',
            'boolean': 'boolean',
            'string': 'string',
            "[object Function]": "function",
            "[object RegExp]": "regexp",
            "[object Array]": "array",
            "[object Date]": "date",
            "[object Error]": "error"
        };
        return t[typeof o] || t[s.call(o)] || (o ? 'object': 'null');
    },
    getDomain: function() {
        return "." + location.host.split(".").slice( - 2).join(".");
    },
    setHome: function(o, r) {
        o.target = "_self";
        var a = "url(#default#homepage)",
        b = "/";
        try {
            if (document.all && !external.max_version) {
                o.style.behavior = a;
                o.setHomePage(r ? r: "http://www" + this.getDomain());
            } else window.open(b);
        } catch(e) {
            if (document.all) {
                o.style.behavior = a;
                o.setHomePage(r ? r: "http://www" + this.getDomain());
            } else window.open(b);
        }
        return false;
    },
    getQueryString: function(name) {
        var reg = new RegExp("[?&]" + name + "=([^&]*)");
        var r = location.search.match(reg);
        return r ? r[1] : "";
    },
    hitTest: function(elem1, elem2) {
        var pos1 = elem1.getBoundingClientRect(),
        pos2 = elem2.getBoundingClientRect(),
        x1 = pos1.left,
        y1 = pos1.top,
        x2 = pos2.left,
        y2 = pos2.top,
        w1 = elem1.offsetWidth,
        h1 = elem1.offsetHeight,
        w2 = elem2.offsetWidth,
        h2 = elem2.offsetHeight;
        return (x1 < x2 ? x1 + w1 > x2: x1 < x2 + w2) && (y1 < y2 ? y1 + h1 > y2: y1 < y2 + h2);
    },
    mt: (function() {
        function parse(s) {
            var a = [];
            var re_t = /\{\$((?:[^\\}]|\\[\s\S])+)\}/;
            var re_s = /\\([\s\S])/g;
            var esc = function(s) {
                return s.replace(re_s, '$1');
            };
            var re_c = /(?:^|[^\\])(?:\\\\)*$/;
            var t, m, n;
            while (t = re_t.exec(s)) {
                n = (m = t.index) + t[0].length;
                if (re_c.test(s.substr(0, m))) {
                    a.push(esc(s.substr(0, m)));
                    a.push([esc(t[1])]);
                } else a.push(esc(s.substr(0, n)));
                s = s.substr(n);
            }
            return a;
        }
        function show(s, o) {
            var a = parse(s);
            for (var i = 0; i < a.length; i++) if (typeof a[i] == 'object') a[i] = o[a[i]] || '';
            return a.join('');
        }
        function show2(s, o) {
            return s.replace(/\{\$([^}]+)\}/g,
            function(a, b) {
                return o[b] || '';
            });
        }
        return function(template, data, adv) {
            var f = adv ? show: show2;
            if (! (data instanceof Array)) return f(template, data);
            var s = '';
            for (var i = 0; i < data.length; i++) s += f(templet, data[i]);
            return s;
        };
    })(),
    guid: (function() {
        if (typeof document.documentElement.uniqueID !== 'undefined') {
            return function(element) {
                return element.uniqueID;
            };
        }
        var uid = 0;
        return function(element) {
            return element.__uniqueID || (element.__uniqueID = 'uniqueID__' + uid++);
        };
    })()
};
J16.util.cookie = {
    set: function(n, v, e, p, d, s) {
        if (!e) e = 365;
        if (!p) p = '/';
        e = e * 1000 * 60 * 60 * 24;
        var e_date = new Date(new Date().getTime() + (e));
        document.cookie = n + '=' + encodeURIComponent(v) + ((e) ? ';expires=' + e_date.toGMTString() : '') + ((p) ? ';path=' + p: '') + ((d) ? ';domain=' + d: '') + ((s) ? ';secure': '');
    },
    get: function(n) {
        var c = document.cookie.split("; ");
        for (var i = 0; i < c.length; i++) {
            var p = c[i].split("=");
            if (n == p[0]) try {
                return decodeURIComponent(p[1])
            } catch(e) {
                return null
            }
        }
        return null;
    },
    del: function(name, path, domain) {
        document.cookie = name + "=1" + ((path) ? ";path=" + path: "") + ((domain) ? ";domain=" + domain: "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    }
};
J16.util.json = {
    obj2str: function(o) {
        var r = [];
        if (typeof o == "string") return quote(o);
        if (typeof o == "undefined") return "undefined";
        if (typeof o == "object") {
            if (o === null) return "null";
            else if (!o.sort) {
                for (var i in o) r.push(this.obj2str(i) + ":" + this.obj2str(o[i]));
                r = "{" + r.join() + "}";
            } else {
                for (var i = 0; i < o.length; i++) r.push(this.obj2str(o[i]));
                r = "[" + r.join() + "]";
            }
            return r;
        }
        return o.toString();
        function quote(string) {
           //*change*/ var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
			var escapable = /[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
            var meta = {
                '\b': '\\b',
                '\t': '\\t',
                '\n': '\\n',
                '\f': '\\f',
                '\r': '\\r',
                '"': '\\"',
                '\\': '\\\\'
            };
            escapable.lastIndex = 0;
            return escapable.test(string) ? '"' + string.replace(escapable,
            function(a) {
                var c = meta[a];
                return typeof c === 'string' ? c: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice( - 4);
            }) + '"': '"' + string + '"';
        }
    },
    str2obj: function(str) {
        var undefined;
        try {
            if (str) {
                return eval('(' + str + ')');
            }
        } catch(ex) {}
        return null;
    }
};
J16.util.string = {
    cut: function(s, length, postfix) {
        if (typeof(s) != "string") return s;
        postfix = postfix || "";
        if (!s || !length) {
            return "";
        }
        var len = 0,
        temp = "";
        for (var i = 0; i < s.length; i++) {
            if (s.charCodeAt(i) > 255) {
                len += 2;
            } else {
                len++;
            }
            if (len > length) {
                return temp + postfix;
            }
            temp += s.charAt(i);
        }
        return s;
    }
};
J16.util.array = {
    removeItem: function(array, dx) {
        if (isNaN(dx) || dx > array.length || dx < 0) {
            return false;
        }
        return array.splice(dx, 1);
    }
}; 
(function(win, undefined) {
    var Dialog = J16.Class.extend({
        options: {
            html: '',
            iframe: '',
            title: '\u6807\u9898',
            isShowLoading: 0,
            width: 200,
            height: 80,
            onshow: function() {},
            onIframeLoaded: function() {},
            onclose: function() {},
            top: -1,
            left: -1,
            opacity: '.5',
            hideType: 'display',
            temp: "<div id='alert1616_main'><table  cellspacing=\"0\"><tr class=\"alert_top\"><td class=\"lt\">&nbsp;</td><td class=\"ct\"><h2 id=\"alert1616_title\"></h2></td><td class=\"rt\">&nbsp;</td></tr><tr class=\"alert_content\"><td class=\"lc\">&nbsp;</td><td class=\"cc\"><div id=\"alert1616_content\"></div></td><td class=\"rc\">&nbsp;</td></tr><tr class=\"alert_bottom\"><td class=\"lb\">&nbsp;</td><td class=\"cb\"></td><td class=\"rb\">&nbsp;</td></tr></table><div id=\"alert1616_closer\" title=\"\u5173\u95ED\"></div></div>"
        },
        init: function(opt) {
            this.setOpt(opt);
        },
        setOpt: function(opt) {
            $.extend(this.options, opt)
        },
        runOnce: function(inner) {
            var op = this.options.opacity;
            $('<div id="alert1616_cover" style="opacity:' + op + '; filter:alpha(opacity=' + (op * 100) + ');"></div>').appendTo($('body'));
            $(inner).appendTo($('body'));
            this.destroy(1);
        },
        render: function() {
            var opt = this.options;
            if (opt.iframe != '') {
                var loading = opt.isShowLoading ? "<img style='position:absolute;top:50%;margin-top:-40px;left:50%; margin-left:-40px;' src='http://r.9533.com/iplatform/img/loading2.gif'/>": "";
                $('#alert1616_content').html(loading + "<iframe frameborder='0' scrolling='no' style='height:100%; width:100%;' src=\"" + opt.iframe + "\"></iframe>");
            } else {
                $('#alert1616_content').html(opt.html);
            }
            $('#alert1616_title').html(opt.title);
            $('#alert1616_content').height(opt.height).width(opt.width);
        },
        _setCoverWH: function() {
            $("#alert1616_cover").css({
                height: "100%",
                width: "100%"
            })
        },
        _setPos: function(opt) {
            var _h = win.innerHeight || document.documentElement.clientHeight;
            var _w = document.documentElement.offsetWidth;
            this.posRecord = document.all && navigator.userAgent.indexOf('MSIE 6') != -1 ? {
                left: opt.left == -1 ? (_w - opt.width - 28) / 2 + document.documentElement.scrollLeft: opt.left,
                top: opt.top == -1 ? (_h - opt.height - 36) / 2 + document.documentElement.scrollTop: opt.top,
                zIndex: 10000
            }: {
                left: opt.left == -1 ? (_w - opt.width - (document.all ? 28 : 12)) / 2 : opt.left,
                top: opt.top == -1 ? (_h - opt.height - (document.all ? 36 : 54)) / 2 : opt.top,
                zIndex: 10000
            };
            $('#alert1616_main').css(this.posRecord);
        },
        bindEvents: function() {
            var opt = this.options,
            _this = this;
            $("#alert1616_closer").unbind("click").click(function() {
                _this.destroy()
            });
            if (opt.iframe != '') {
                $('#alert1616_content iframe').unbind("load").bind('load',
                function() {
                    $('#alert1616_content img').hide();
                    var _win = $(this)[0].contentWindow;
                    opt.onIframeLoaded && opt.onIframeLoaded.call(_win);
                    var link = _win.document.links,
                    len = link.length;
                    setTimeout(function() {
                        for (var i = 0; i < len; i++) {
                            if (link[i].className.toLowerCase().indexOf('alert1616') != -1) {
                                document.all ? link[i].attachEvent("onclick", setEvent) : link[i].addEventListener("click", setEvent, false);
                            }
                        }
                    },
                    10);
                })
            }
            function setEvent(e) {
                $('#alert1616_content img').show();
                var e = e || win.event;
                var tar = e.target || e.srcElement,
                t = tar.getAttribute("title"),
                h = tar.getAttribute("_height"),
                w = tar.getAttribute("_width");
                t && $('#alert1616_title').html(t);
                h && $('#alert1616_content').height(h);
                w && $('#alert1616_content').width(w);
            }
            if (navigator.userAgent.indexOf('MSIE 6') != -1) {
                $(win).unbind("scroll").scroll(function() {
                    _this._setPos(opt)
                });
            }
            $(win).unbind("resize").resize(function() {
                _this._setPos(opt);
                _this._setCoverWH();
            });
        },
        show: function(opt) {
            if (!$('#alertstyle')[0]) {
                var link = document.createElement('link');
                link.setAttribute('rel', 'stylesheet');
                link.setAttribute('type', 'text/css');
                link.id = 'alertstyle';
                link.href = G_dirUrl+'images/iplatform/img/tc.css';
                $('head')[0].appendChild(link);
            }
			
            if (opt) this.setOpt(opt);
            if (!$('#alert1616_cover')[0]) {
                this.runOnce(this.options.temp);
            }
            this.render();
            this.display();
            this.bindEvents();
        },
        display: function() {
            this._setPos(this.options);
            $('#alert1616_main').show();
            $('#alert1616_cover').show();
            this.options.onshow.call(this);
        },
        destroy: function(notRunClose) {
            if (this.options.hideType != 'display') {
                $('#alert1616_main').css({
                    top: '-999px'
                });
            } else {
                $('#alert1616_main').hide();
            }
            $('#alert1616_cover').hide();
            notRunClose || this.options.onclose.call(this);
        }
    });
    J16.util.dialog = win.J16.util.dialog || {
        show: function(opt) {
            var d = arguments.callee.Al || (arguments.callee.Al = new Dialog());
            opt ? d.show(opt) : d.display();
            if (!J16.util.dialog.hide) {
                J16.util.dialog.hide = function(b) {
                    d.destroy(b)
                }
            }
        }
    }
})(window);

J16.util.lunar = function(t) {
    var __nongli = {
        L: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0],
        Jq: [[19, 19, 19, 21, 23, 24, 27, 29, 1, 1, 30, 30], [29, 30, 30, 2, 4, 6, 8, 10, 11, 12, 12, 11], [12, 11, 12, 13, 14, 17, 18, 20, 22, 22, 23, 22], [23, 23, 23, 24, 26, 27, 30, 2, 3, 3, 4, 4], [4, 4, 4, 6, 7, 8, 11, 12, 14, 15, 14, 15], [14, 15, 15, 17, 18, 20, 22, 23, 25, 25, 26, 25], [26, 25, 27, 27, 29, 2, 3, 4, 6, 6, 7, 6], [7, 7, 8, 8, 11, 12, 14, 16, 17, 17, 17, 18], [17, 17, 18, 20, 21, 23, 26, 27, 29, 29, 28, 28], [28, 28, 28, 1, 2, 5, 7, 8, 10, 10, 10, 10], [10, 9, 9, 11, 13, 15, 17, 19, 20, 21, 21, 21], [21, 21, 21, 22, 24, 26, 27, 1, 1, 2, 2]],
        G: ["\u7532", "\u4E59", "\u4E19", "\u4E01", "\u620A", "\u5DF1", "\u5E9A", "\u8F9B", "\u58EC", "\u7678"],
        Z: ["\u5B50", "\u4E11", "\u5BC5", "\u536F", "\u8FB0", "\u5DF3", "\u5348", "\u672A", "\u7533", "\u9149", "\u620C", "\u4EA5"],
        M: ["\u6B63", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u4E03", "\u516B", "\u4E5D", "\u5341", "\u51AC", "\u814A"],
        TM: "0|gd4|wrn|1d98|1tuh|2akm|2rfn|38g9|3plp|46vz|4o9k|55px|5n73|64o5|6m37|73fd|7kna|81qe|8io7|8zgq|9g4b|9wnk|ad3g|ath2|".split('|'),
        TN: "\u5C0F\u5BD2|\u5927\u5BD2|\u7ACB\u6625|\u96E8\u6C34|\u60CA\u86F0|\u6625\u5206|\u6E05\u660E|\u8C37\u96E8|\u7ACB\u590F|\u5C0F\u6EE1|\u8292\u79CD|\u590F\u81F3|\u5C0F\u6691|\u5927\u6691|\u7ACB\u79CB|\u5904\u6691|bailu|\u79CB\u5206|\u5BD2\u9732|\u971C\u964D|\u7ACB\u51AC|\u5C0F\u96EA|\u5927\u96EA|\u51AC\u81F3".split('|'),
        _GT: function(y, m, d) {
            var T = this,
            _tm = T.TM,
            _tn = T.TN;
            for (var i = 24; i--;) _tm[i] = parseInt(_tm[i], 36);
            function term(y, n) {
                var d = new Date((31556925974.7 * (y - 1900) + T.TM[n] * 60000) + Date.UTC(1900, 0, 6, 2, 5));
                return {
                    m: d.getUTCMonth(),
                    d: d.getUTCDate()
                }
            };
            for (var i = T.TN.length,
            x; i--;) {
                x = term(y, i);
                if (x.m == m - 1 && x.d == d) return T.TN[i];
            };
            return '';
        },
        _ZG: function(n) {
            return (this.G[n % 10] + this.Z[n % 12]);
        },
        _Y: function(y) {
            var i, sum = 348;
            for (i = 0x8000; i > 0x8; i >>= 1) {
                sum += (this.L[y - 1900] & i) ? 1 : 0;
            }
            return (sum + this._D(y));
        },
        _D: function(y) {
            if (this._M(y)) {
                return ((this.L[y - 1900] & 0x10000) ? 30 : 29);
            } else {
                return (0);
            }
        },
        _M: function(y) {
            return (this.L[y - 1900] & 0xf);
        },
        _mD: function(y, m) {
            return ((this.L[y - 1900] & (0x10000 >> m)) ? 30 : 29);
        },
        _lun: function(t) {
            var i, leap = 0,
            temp = 0,
            T = this,
            ofs = Math.floor((t.getTime() + 2206425600000) / 86400000);
            var dayCyl = ofs + 40,
            monCyl = 14;
            var _yy = t.getFullYear(),
            _mm = t.getMonth() + 1,
            _dd = t.getDate();
            for (i = 1900; i < 2050 && ofs > 0; i++) {
                temp = T._Y(i);
                ofs -= temp;
                monCyl += 12;
            }
            if (ofs < 0) {
                ofs += temp;
                i--;
                monCyl -= 12;
            }
            year = i;
            yearCyl = i - 1864;
            leap = T._M(i);
            isLeap = false;
            for (i = 1; i < 13 && ofs > 0; i++) {
                if (leap > 0 && i == (leap + 1) && isLeap == false) {--i;
                    isLeap = true;
                    temp = T._D(year);
                } else {
                    temp = T._mD(year, i);
                }
                if (isLeap == true && i == (leap + 1)) isLeap = false;
                ofs -= temp;
                if (isLeap == false) monCyl++;
            }
            if (ofs == 0 && leap > 0 && i == leap + 1) {
                if (isLeap) {
                    isLeap = false;
                } else {
                    isLeap = true; --i; --monCyl;
                }
            }
            if (ofs < 0) ofs += temp; --i; --monCyl;
            day = ofs + 1,
            month = i;
            var tday = (day < 11) ? "\u521D": ((day < 20) ? "\u5341": ((day < 30) ? "\u5EFF": "\u5345"));
            if (day % 10 != 0 || day == 10) tday += "\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u5341".charAt((day - 1) % 10);
            var _k = (day == 1) ? (month + 1) : month,
            k = T.Jq[(year - 1999) % 12][_k],
            l = T.Jq[(year - 1999) % 12][_k + 1],
            _m = (k - l);
            if (_m < 0) _m = -_m;
            if ((day >= k && parseInt(_m) < 20) || day == 1) monCyl += 1;
            return [year, T.M[_k - 1] + "\u6708", tday, isLeap, T._ZG(yearCyl), T._ZG(monCyl), T._ZG(dayCyl), T._GT(_yy, _mm, _dd)];
        }
    }
    return __nongli._lun(t);
};

J16.io = window.J16.io || {};
J16.io.proxyUrl = "http://api.1616.net/proxy.htm";
J16.io.set = function(url, data, fn, callbackName) {
    var CALLBACK = {};
    window.addEventListener ? window.addEventListener('message', callback, false) : window.attachEvent('onmessage', callback);
    function callback(e) {
        e = e.data || e;
        e = e.split('$$$');
        CALLBACK[e[1]](e[0]);
        destroyProxy(e[1]);
    };
    function destroyProxy(id) {
        var div = document.getElementById(id),
        ifr = div.firstChild;
        div.innerHTML = '';
        div.parentNode.removeChild(div);
        delete CALLBACK[id];
    };
    function createProxy(src, id) {
        var div = document.createElement('DIV');
        div.style.display = 'none';
        div.id = id;
        div.innerHTML = '<iframe src="' + src + '"></iframe>';
        document.body.appendChild(div);
        return div.firstChild;
    }
    function post(func, params, fn) {
        var RID = '$' + ( + new Date),
        ifr = createProxy(J16.io.proxyUrl, RID);
        CALLBACK[RID] = fn || new Function;
        params = params.concat(RID).concat(func).join('$$$');
        ifr.addEventListener ? ifr.onload = loaded: ifr.attachEvent('onload', loaded);
        ifr.contentWindow.postMessage || (ifr.contentWindow.opener = {
            data: params,
            callback: CALLBACK[RID]
        });
        function loaded() {
            ifr.contentWindow.postMessage && ifr.contentWindow.postMessage(params, '*');
        }
    } (data.replace(/[^\x00-\xff]/g, "xx").length > 1350) ? post('__send', [url, data], fn) : J16.io.get(url + (/\?/.test(url) ? '&': '?') + data, fn, callbackName, false);
};
J16.io.get = function(url, fnback, callbackName, isSimple) {
    var s, c, fn = 'jsonp' + ( + new Date()) + (this.jsonpid = ++this.jsonpid || 0),
    d = document,
    cbk = callbackName || 'callback',
    src = (url.indexOf("?") == -1 ? url + (isSimple ? "": "?") : url) + (isSimple ? '': '&' + cbk + '=' + fn),
    h = d.getElementsByTagName("head")[0]; (s = d.createElement("script")).setAttribute("type", "text/javascript");
    s.src = src;
    h.insertBefore(s, h.firstChild);
    window[fn] = function() {
        fnback && fnback.apply(null, arguments);
        c = 1
    };
    function done() {
        s.parentNode.removeChild(s);
        c || fnback && fnback()
    }
    s.onload = s.onreadystatechange = function() {
        s.readyState ? s.readyState.toLowerCase() == 'loaded' && (s.onreadystatechange = null, done()) : done()
    };
};
if (window !== parent && parent.J16 && parent.J16.i) {
    J16.i = parent.J16.i;
} else {
	
    J16.i = window.J16.i || {};
    J16.i.User = J16.Class.extend({
        init: function(id, name, level, email, mobile, isLogined) {
            var self = this;
            self.id = id;
            self.name = name;
            self.level = level;
            self.email = email;
            self.mobile = mobile;
            self.isLogined = isLogined;
        },
        id: 0,
        name: "\u533F\u540D",
        level: "\u8BBF\u5BA2",
        email: "anonymous@1616.net",
        mobile: "13800000000",
        visitorId: "",
        isLogined: false
    });
    J16.i.App = J16.Class.extend({
        cfg: null,
        id: "appId",
        name: "",
        isActive: false,
        isIframe: false,
        isNeedLogin: false,
        stickAble: false,
        events: function() {},
        render: function() {},
        init: function() {
            this.render();
            this.events();
        },
        destroy: function() {},
        onNotify: function(eventType, d) {}
    });
    J16.i.EventType = {};
    J16.i.core = function() {
		
        var cookie = J16.util.cookie,
        apps = {},
        observers = {},
        isLogined = !!cookie.get("Usecure") && cookie.get("Usecure") != "undefined",
        userName = cookie.get("Uname"),
        visitorId = cookie.get("Uvisitor");
        var J16_i_CFG = {};
		
        if (isLogined) {
            var J16_i_USER = new J16.i.User("10002", userName, "VIP\u4F1A\u5458", "ligang@1616.net", "13811111111", true);
            var getUrl = "http://api.1616.net/get2.php?app=";
            var setUrl = "http://api.1616.net/update.php";
        } else {
            var J16_i_USER = new J16.i.User();
			
            J16_i_USER.visitorId = visitorId;
            var getUrl = "http://api.1616.net/visitor_get2.php?visitor_id=" + visitorId + "&app=";
            var setUrl = "http://api.1616.net/visitor_update.php";
        }
        function listen(scope, appId, eventType, handler) {
			
            var gt = J16.util.getType,
            et = J16.i.EventType,
            as = null;
            if (gt(eventType) == "array") {
                for (var i = 0,
                l = eventType.length; i < l; i++) {
                    _(eventType[i])
                }
            } else {
                _(eventType)
            }
            function _(eventType) {
                as = eventType.split("_");
                _listen(scope, appId, as[0] + "_" + as[1], handler);
                if (gt(et[as[0]]) === "undefined") et[as[0]] = {};
                et[as[0]][as[1]] = as[2];
            }
            function _listen(scope, appId, eventStr, handler) {
                var d = observers,
                l = 0;
                handler = handler ||
                function() {};
                if (typeof d[appId] === "undefined") {
                    d[appId] = {};
                }
                d[appId]["__SCOPE__"] = scope;
                d[appId][eventStr] = handler;
            }
        }
        function unListen(appId, eventType) {
            var d = observers,
            et = J16.i.EventType,
            as = eventType.split("_");
            if (typeof d[appId] !== "undefined") {
                delete d[appId][as[0] + "_" + as[1]];
                delete et[as[0]][as[1]];

            }
        }
        function notify(appId, eventType, data) {
            var as = eventType.split("_"),
            eventStr = as[0] + "_" + as[1],
            d = {
                "sender": appId,
                "data": data
            };
            J16.util.console("info", "eventType:" + eventType + " d:" + J16.util.json.obj2str(d));
            for (var k in observers) {
                if (observers[k].hasOwnProperty(eventStr)) {
                    try {
                        observers[k][eventStr].call(observers[k]["__SCOPE__"], eventType, d);
                    } catch(e) {
                        J16.util.console("warn", "\u6A21\u5757:" + appId + ",\u4E8B\u4EF6:" + eventType + "\uFF0C\u4F4D\u7F6E:J16.i.core.notify(),\u8BE6\u60C5:" + e.message)
                    }
                }
            }
        }
        function ve(eventName) {
            var re = false;
            re = /^[A-Z-]+$/.test(eventName);
            if (!re) J16.util.console("error", "listen\uFF1A\u53C2\u6570\u4E8B\u4EF6\u540D\u201C" + eventName + "\u201D\u683C\u5F0F\u4E0D\u5BF9\uFF0C\u53EA\u5141\u8BB8\u5927\u5199\u82F1\u6587\u5B57\u6BCD\u548C\u77ED\u6A2A\u7EBF\uFF1B\u8303\u4F8B\uFF1AEVENT-ACTION");
            return re;
        }
        function getCfg(appId, callback, isRefresh) {
			
            if (J16_i_CFG[appId] && !!!isRefresh) {
                callback({
                    code: 1,
                    desc: J16_i_CFG[appId]
                });
            } else {
				
                J16.io.get(getUrl + appId,
                function(d) {
                    var data = J16.util.json.str2obj(d.desc);
                    if (data == null) data = apps[appId].instance.cfg;
                    callback({
                        code: d.code,
                        desc: data
                    })
                });
            }
        }
        function setCfg(appId, config, callback) {
            J16_i_CFG[appId] = config;
            var data = {
                app: appId,
                key: "",
                value: J16.util.json.obj2str(config),
                visitor_id: J16_i_USER.visitorId
            };
            J16.io.set(setUrl, $.param(data),
            function(d) {
                callback({
                    code: d,
                    desc: ""
                })
            });
        }
        function getUser() {
            var j = J16.util.json;
            return j.str2obj(j.obj2str(J16_i_USER));
        }
        function s16(a, p) {
            function createImg(src) {
                var img = $('<img />').attr('src', src);
                setTimeout(function() {
                    img = null;
                },
                100);
            };
            var wp = ["act=" + a, "log=" + ( + isLogined), "uid=" + visitorId];
            for (var i = 0; i < p.length; i += 2) {
                wp.push(p[i] + "=" + encodeURIComponent(p[i + 1]));
            }
            //createImg("http://st.1616.net/s.php?" + wp.join("&"));
        }
        J16.i.CoreW = J16.Class.extend({
            appId: null,
            init: function(appId) {
                this.appId = appId;
            },
            et: function(appId, eventName, desc) {
                if (ve(eventName)) return appId + "_" + eventName + (desc ? "_" + desc.replace(/_/g, "-") : "");
                else return null;
            },
            listen: function(eventType, handler, scope) {
                listen(scope, this.appId, eventType, handler);
            },
            unListen: function(eventType) {
                unListen(this.appId, eventType)
            },
            notify: function(eventType, data) {
                notify(this.appId, eventType, data);
            },
            chkp: function(eventType, callback) {
                var d = 0;
                if (typeof(callback) == "function") {
                    callback(d);
                } else return d;
            },
            getCfg: function(callback, isRefresh) {
                return getCfg(this.appId, callback, isRefresh);
            },
            setCfg: function(config, callback) {
                setCfg(this.appId, config, callback);
            },
            getUser: function() {
                return getUser();
            },
            newApp: function() {
                return new J16.i.App();
            },
            s16: function(url, title, channel1, channel2) {
                s16(18, ["an", this.appId, "atn", channel1, "ain", channel2, "url", url, "un", title])
            }
        });
        return {
			
            register: function(appId, creator) {
                apps[appId] = {
                    creator: creator,
                    instance: null
                };
            },
            regAndStart: function(appId, creator) {
                this.register(appId, creator);
                this.start(appId)
            },
            start: function(appId) {
                var d = apps[appId];
                d.instance = d.creator(new J16.i.CoreW(appId));
                d.instance.id = appId;
                if (d.instance.name == "") d.instance.name = appId;
                d.instance.init();
            },
            stop: function(appId) {
                var d = apps[appId];
                if (d.instance) {
                    d.instance.destroy();
                    d.instance = null;
                }
                observers[appId] = null;
            },
            startAll: function() {
                for (var appId in apps) {
                    if (apps.hasOwnProperty(appId)) {
                        this.start(appId);
                    }
                }
            },
            stopAll: function() {
                for (var appId in apps) {
                    if (apps.hasOwnProperty(appId)) {
                        this.stop(appId);
                    }
                }
            }
        }
    } ();
}
J16.i.core.regAndStart("menu",
function(coreW) {
    var app = coreW.newApp();
    app.cfg = "";
    app.init = function() {
        var T = this;
        coreW.listen([coreW.et(T.id, "OPEN-APP", "\u70B9\u51FB\u9996\u9875\u5DE6\u4FA7\u83DC\u5355\u6253\u5F00APP"), coreW.et(T.id, "UPDATE-STICK", "www\u9996\u9875\u5DE6\u4FA7\u83DC\u5355\u66F4\u65B0\u8FDB\u5EA6\u4FE1\u606F"), coreW.et(T.id, "UPDATE-HEIGHT", "\u66F4\u65B0\u53F3\u4FA7Iframe\u7684\u9AD8\u5EA6"), coreW.et(T.id, "GOT-CONFIG-ERROR", "\u83B7\u53D6APP\u914D\u7F6E\u5931\u8D25\u65F6\u505A\u51FA\u63D0\u793A")], T.onNotify, T);
        T.height = $('#l').height() + 4;
        T.events();
    };
    app.events = function() {
        var T = this;
    };
    app.onNotify = function(eventType, d) {
        var T = this;
        switch (eventType) {
        case coreW.et(T.id, "OPEN-APP") : break;
        case coreW.et(T.id, "UPDATE-STICK") : break;
        case coreW.et(T.id, "UPDATE-HEIGHT") : void
            function() {
                $("#loading").hide();
                var $loader = $('#app_loader_' + d.sender);
                $loader.find('iframe').andSelf().removeAttr("style");
                var menuHeight = T.height;
                var iframeHeight = $loader.find("iframe")[0].contentWindow.document.documentElement.scrollHeight;
                var h = Math.max(menuHeight, iframeHeight);
                $loader.find('iframe').andSelf().height(h);
            } ();
            break;
        case coreW.et(T.id, "GOT-CONFIG-ERROR") : $("#app_loader_" + d.sender).html("<div class=appcfgloaderror>\u6570\u636E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7<a href='javascript:location.reload();' target=_self>\u70B9\u51FB\u8FD9\u91CC</a>\u91CD\u8BD5\u6216\u6309F5\u952E\u5237\u65B0\u3002\u5982\u8FD8\u65E0\u6CD5\u89E3\u51B3\uFF0C<a href='http://www.1616.net/jd/misc/advice.htm?app=" + d.sender + "' target=_self>\u8BF7\u4E0E\u6211\u4EEC\u8054\u7CFB</a>\u3002</div>");
            break;
        }
    };
    return app;
});
void function() {
    var U = J16.util;
    euc = encodeURIComponent;
    setCookie = U.cookie.set;
    getCookie = U.cookie.get;
    str2obj = U.json.str2obj;
    obj2str = U.json.obj2str;
    $type = U.getType;
    set_home = U.setHome;
    showWindow = function(opt) {
        U.dialog.show(opt);
        hideWindow = U.dialog.hide;
    };
    getDomain = U.getDomain;
    showLoginWindow = function(title, showFn, closeFn) {
        showWindow({
            iframe: '/passport/i_login.htm' + (title ? "?h1=" + euc(title) : ""),
            width: 440,
            height: 320,
            title: '\u767B\u5F55',
            onshow: showFn || $.noop,
            onclose: closeFn || $.noop
        });
    };
    showRegisterWindow = function() {
        $(function() {
            showWindow({
                iframe: '/passport/i_register.htm',
                width: 440,
                height: 320,
                title: '\u6CE8\u518C',
                onIframeLoaded: function() {}
            });
        })
    };
    document.all && document.execCommand('BackgroundImageCache', false, true);
} ();
var JBase = J16.Class.extend({
    __active: 0,
    __iframeMode: 1,
    __needLogin: 0,
    __keepAlive: 1,
    __stickAble: 0,
    __name: '',
    __cfg: {
        __version: '1.0.0'
    },
    __login: function() {},
    __logout: function() {},
    __todo: function() {},
    __upgrade: function(runFrame) {
        runFrame()
    },
    __updateCfg: function(fnback) {
        var runTime = 0,
        recalled, T = this,
        name = this.__name,
        requestConfig = function() {
			
            J.isLogin ? J16.io.get('http://api.1616.net/get2.php?app=' + name, setCfg) : J16.io.get('http://api.1616.net/visitor_get2.php?visitor_id=' + J.user + '&app=' + name, setCfg);
        };
        function setCfg(d) {
            switch (d.code) {
            case 1:
                var e = str2obj(d.desc);;
                if (e != null) {
                    if (e == "") e = {
                        __version: '1.0.0'
                    };
                    T.__cfg = e;
                }
                checkUpgrade();
                break;
            case 0:
                $("#app_loader_" + name).html("<div class=appcfgloaderror>\u6570\u636E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7<a href='javascript:location.reload();' target=_self>\u70B9\u51FB\u8FD9\u91CC</a>\u91CD\u8BD5\u6216\u6309F5\u952E\u5237\u65B0\u3002\u5982\u8FD8\u65E0\u6CD5\u89E3\u51B3\uFF0C<a href='http://www.1616.net/jd/misc/advice.htm?app=" + name + "' target=_self>\u8BF7\u4E0E\u6211\u4EEC\u8054\u7CFB</a>\u3002</div>"); 
				break;
            }
        }
        requestConfig();
        function checkUpgrade() {
            fnback.call(T);
        }
    },
    __simpleSave: function(key, fn) {
        var a0 = arguments[0],
        key = $type(a0) == 'string' ? a0: '',
        fn = arguments[1] ? arguments[1] : a0;
        if (key && this.__cfg[key] == undefined || $type(fn) != 'function') return;
        var T = this,
        cfg = key == '' ? obj2str(this.__cfg) : obj2str(this.__cfg[key]),
        hash = {
            app: this.__name,
            key: key,
            value: cfg
        };
        if (J.isLogin) {
            J16.io.set('http://api.1616.net/update.php', $.param(hash), fn);
        } else {
            hash.visitor_id = J.user;
            J16.io.set('http://api.1616.net/visitor_update.php', $.param(hash), fn);
        }
    },
    init: function(opt) {
        $.extend(this, opt);
    }
});
var Main = J16.Class.extend({
    user: J16_INF.user,
    isLogin: J16_INF.ac,
    apps: {},
    __eventQ: {
        logAction: null
    },
    activeAppName: 'www',
    init: function() {
        this.__eventQ.logAction = this.isLogin ? '__login': '__logout';
    },
    add: function(name, app, win) {
        var T = this;
        app.__name = name;
        app.__active = 1;
        var menu = $('#app_' + name);
        app.__iframeMode = menu.attr('mode');
        app.__version = menu.attr('ver');
        var realApp = this.apps[name] = new JBase(app);
        if (realApp.__beforeInit) {
            realApp.__beforeInit();
        }
        realApp.__updateCfg(function() {
            realApp.init();
            if (menu.attr('todo') !== undefined) {
                realApp.__todo(menu.attr('todo'));
            }
            $('#loading').hide();
            realApp.__updateHeight && realApp.__updateHeight();
            var ev = T.__eventQ;
            for (var p in ev) ev[p] == null || realApp[ev[p]]();
        });
        app = null;
		
        if (realApp.__iframeMode == 1) {			
            if (win && $type(win) == 'object') {
                realApp.__updateHeight = function(height) {
                    var d = win.document;
                    if (!this.originalHeight || height === true) {
                        d.body.style.height = '';
                        height = this.originalHeight = d.body.offsetHeight;
                    }
                    height = height || this.originalHeight;
                    var menuHeight = $('#l').height() + 4;
                    var _height = Math.max(height, menuHeight);
                    d.body.style.height = _height + 'px';
                    $('#app_loader_' + name).find('iframe').andSelf().height(_height + 4);
                };
                win.getIns = getIns;
                window.stat && window.stat.init(win.document, name);
                $(win.document).mousedown(function() {
                    $('#weather-f').hide();
                })
            }
            if (realApp.__stickAble) {
                realApp.__updateStick = function(inner, display) {
                    $('#app_' + name + ' .sk').attr('stick', 1).html(inner);
                };
                realApp.__hideStick = function() {
                    $('#app_' + name + ' .sk').attr('stick', 0).hide();
                };
            }
            if (realApp.__needLogin && !this.isLogin) {}
        }
    },
    load: function(appName) {
        var app = this.apps[appName],
        T = this;
        if (this.activeAppName == appName) return;
        this.unload(this.activeAppName);
        this.activeAppName = appName;
        var endWith = appName == 'www' ? 'index': appName;
        location.hash = endWith;
        if (app && app.__active) {
            var loader = $('#app_loader_' + appName);
            if (appName != 'www') {
                if (navigator.userAgent.indexOf('Firefox') !== -1) {
                    if (loader.data('height')) {
                        loader.css('height', loader.data('height'));
                    }
                } else {
                    loader.css({
                        position: 'relative',
                        left: 0,
                        top: 0
                    });
                }
            } else {
                loader.show();
            }
            $('#loading').hide();
        } else {
            var m = $('#app_' + appName),
            customSrc = m.attr('appurl'),
            _h = m.attr('_h');
            /*var appDir = customSrc || 'http://apps.1616.net/' + appName + '/';*/
			var appDir = customSrc || G_waibu+G_JIN_TAI_PageOne+'_app_'+ appName + '.html';
			if(appName=="app_tv"){
				appDir=G_waibu+"app_tv/"	
			}else if(appName=="app_favorite"){
				appDir=G_waibu+"app_favorite/"	
			}
            if ($('#app_' + appName).attr('mode') == 1) {
                var template = "<div class='iframe_loader' id='app_loader_" + appName + "'><iframe frameborder='0' src='" + appDir + "' width='100%' height='" + (_h || "100%") + "' scrolling='no' allowtransparency='true' id='fapp_loader_" + appName + "'></iframe></div>";
                $('#r').append(template);
            } else {
                $.get(appDir,
                function(e) {
                    $('<div id="app_loader_' + appName + '" class="iframe_loader">' + e + '</div>').appendTo($('#r'));
                });
            }
            $('#loading').show();
        }		
    },
    load2: function(appName,appS) {
		
        var app = this.apps[appName],
        T = this;
        if (this.activeAppName == appName) return;
        this.unload(this.activeAppName);
        this.activeAppName = appName;
        var endWith = appName == 'www' ? 'index': appName;
		if(appS==""||typeof(appS)=="undefined"||appName!="list")
        	location.hash = endWith;
		else
			location.hash = endWith+","+appS;
        if (app && app.__active) {
            var loader = $('#app_loader_' + appName);
            if (appName != 'www') {
                if (navigator.userAgent.indexOf('Firefox') !== -1) {
                    if (loader.data('height')) {
                        loader.css('height', loader.data('height'));
                    }
                } else {
                    loader.css({
                        position: 'relative',
                        left: 0,
                        top: 0
                    });
                }
            } else {
                loader.show();
            }
            $('#loading').hide();
        } else {
            var m = $('#app_' + appName),
            customSrc = m.attr('appurl'),
            _h = m.attr('_h');
            /*var appDir = customSrc || 'http://apps.1616.net/' + appName + '/';*/
			var appDir = customSrc || G_waibu+G_JIN_TAI_PageOne+'_app_'+ appName + '.html';
			if(appName=="app_tv"){
				appDir=G_waibu+"app_tv/"	
			}else if(appName=="app_favorite"){
				appDir=G_waibu+"app_favorite/"	
			}
            if ($('#app_' + appName).attr('mode') == 1) {
				if(appS==""||typeof(appS)=="undefined"||appName!="list"){
					var template = "<div class='iframe_loader' id='app_loader_" + appName + "'><iframe frameborder='0' src='" + appDir + "' width='100%' height='" + (_h || "100%") + "' scrolling='no' allowtransparency='true' id='fapp_loader_" + appName + "'></iframe></div>";
					$('#r').append(template);
				}else{
					var template = "<div class='iframe_loader' id='app_loader_" + appName + "'><iframe frameborder='0' src='"+appS+"' width='100%' height='" + (_h || "100%") + "' scrolling='no' allowtransparency='true' id='fapp_loader_" + appName + "'></iframe></div>";
					$('#r').append(template);
				}
            } else {
                $.get(appDir,
                function(e) {
                    $('<div id="app_loader_' + appName + '" class="iframe_loader">' + e + '</div>').appendTo($('#r'));
                });
            }
			window.status="";
            $('#loading').show();
        }		
    },
    unload: function(appName) {
		
        var app = this.apps[appName],
        loader = $('#app_loader_' + appName);
        if (!app) {
            loader[0].innerHTML = '';
            loader.remove();
            return;
        };
		
        if (app.__keepAlive) {
            if (appName != 'www') {
                if (navigator.userAgent.indexOf('Firefox') !== -1) {
                    var _height = loader.height();
                    loader.data('height', _height).css({
                        height: 0
                    });
                } else {
                    loader.css({
                        position: 'absolute',
                        left: 0,
                        top: -9999
                    });
                }
            } else {
                loader.hide();
            }
            if (app.__stickAble) {
                app.__showStick && app.__showStick();
            }
        } else {
            loader.remove();
            app.__active = 0;
            if (app.__iframeMode) {
                delete this.apps[appName];
            }
        }
    },
    dispatch: function(eventType, params) {
        if (eventType == '__login' || eventType == '__logout') {
            var hash = location.hash;
            var has = false;
            $('#nav>li').each(function(k, v) {
                if (v.id.indexOf(hash.slice(1)) > 0) has = true;
            });
            if (eventType == '__login' && hash.indexOf('manager') != -1) {
                has = true;
            }
            hash = has ? hash: '#index';
            location.href = location.href.replace(/net.*/, eventType == '__login' ? 'net/' + J.user + '/' + hash: 'net/' + hash);
        } else {
            $.each(this.apps,
            function(k, v) {
                v[eventType] && v[eventType].apply(v, (params || []))
            });
        }
    }
});
var www = {
    $APP: {},
    __iframeMode: 0,
    __cfg: {},
    runInitAuto: true,
    concat: function(GUID, app) {
        app.autoInit = arguments.length == 2;
        this.$APP[GUID] = app;
    },
    events: function() {
        $('#login').click(function() {
            showLoginWindow();
            return false;
        });
        $('#regist').click(function() {
            showRegisterWindow();
            return false;
        });
        $('#logout').click(function() {
            var dm = getDomain();
            setCookie('Usecure', '', null, null, dm);
            J.dispatch('__logout');
            return false;
        });
        $('#uname').click(function() {
            showWindow({
                iframe: '/passport/i_account.htm',
                width: 440,
                height: 280,
                title: '\u6211\u7684\u5E10\u6237'
            });
            return false;
        });
        $('#mhome,a.sethome').click(function() {
            set_home(this, "http://" + window.location.host);
            return false;
        });
    },
    __beforeInit: function() {
        var T = this;
        $.each(this.$APP,
        function(name, app) {
            app.getCfg = function() {
                return T.__cfg[name]
            };
            app.setCfg = function(cfg) {
                return T.__cfg[name] = cfg
            };
            app.__save = function(cfg, fn) {
                app.setCfg(cfg);
                T.__simpleSave(name, fn);
            };
            T.__cfg[name] = app.__cfg == undefined ? null: app.__cfg;
            if (J16_INF.www != null && J16_INF['www'][name] === null) {
                J16_INF['www'][name] = app.__cfg;
            }
        });
        if (J16_INF.www != null) {
            $.extend(this.__cfg, J16_INF.www);
        }
    },
    __updateCfg: function(callbackFn) {
        callbackFn.call(this);
    },
    get: function(name) {
        return this.$APP[name];
    },
    call: function(fnName) {
        $.each(this.$APP,
        function(k, v) {
            if ((fnName === 'init' && v.autoInit) || fnName !== 'init') fnName in v && v[fnName]();
        });
    },
    __login: function() {
        this.call('__login');
    },
    __logout: function() {
        this.call('__logout');
    },
    __upgrade: function() {
        this.call('__upgrade');
    },
    init: function() {
        this.call('init');
        this.events();
    }
};
www.concat('menu', {
    linkTo: function() {
        var apps = [];
        $('#nav>li').each(function() {
            apps.push(this.id.replace('app_', '?'));
        });
        if (location.search != '') {
            var search = location.search.split('&')[0];
            if ($.inArray(search, apps) !== -1) {
                location.href = location.href.replace('?', '#');
            }
        }
		
        var h = location.hash.match(/#([^&]*)&?(.*)?/);
		
        if (h != null) {
            if (h[2]) {
                $('#app_' + h[1]).attr('todo', h[2]);
                $('#app_' + h[1]).trigger('click');
            } else {
                if (h[1].indexOf('un') === 0) {} else {
                    var h1 = h[1].toLowerCase(),
                    showResolveWindow = function() {
                        $(function() {
                            showWindow({
                                iframe: '/passport/i_findpassword.htm',
                                width: 440,
                                height: 320,
                                title: '\u627E\u56DE\u5BC6\u7801',
                                onIframeLoaded: function() {}
                            })
                        });
                    };
					
                    h1 === 'reg' ? showRegisterWindow() : h1 === 'ret' ? showResolveWindow() : $('#app_' + h1).trigger('click');
					
                }
            }
        }
    },
    moveUp: function(id) {
        var menuBar = $('#app_' + id);
        menuBar.after(menuBar.prev());
        this.check();
    },
    moveDown: function(id) {
        var menuBar = $('#app_' + id);
        menuBar.before(menuBar.next());
        this.check();
    },
    add: function(option) {
        if ($('#nav > li[appid=' + option.appid + ']').length) return;
        function Template(temp, data) {
            return temp.replace(/@\{(.*?)\}/g,
            function($0, $1, $2, $3, D) {
                var A = $1.split('.'),
                F = A.slice(1).join('.'),
                D = D || data;
                return F ? arguments.callee($0, F, $2, $3, D[A[0]]) : D[$1] || $0;
            });
        }
        var temp = '<li appurl="@{appurl}" ver="@{ver}" mode="@{mode}" appid="@{appid}" id="app_@{id}"><a target="_self" href="#@{id}"><em class="ni-home" style="background-position:0 -' + (option.appid * 22 - 22) + 'px"></em>@{name}</a>{STICK}</li>';
        if (!option.appurl) {
            temp = temp.replace(' appurl="@{appurl}"', '');
        }
        temp = option.stickable ? temp.replace('{STICK}', '<div class="sk_wrap"><div class="sk" stick="0"><!--\u6B64\u5904stick--></div></div>') : '';
        $(Template(temp, option)).appendTo('#nav');
        this.check();
    },
    del: function(id) {
        $('#app_' + id).remove();
        this.check();
    },
    check: function(i) {
        this.i = i || this.i;
        var T = this;
        if ($('#nav>li').length <= this.i) $('#showMore').hide();
        else $('#showMore').show();
        $('#nav>li').each(function(k, v) {
            if (k >= T.i) $(this).hide();
            else $(this).show();
        });
        this.hideLis = $('#nav>li:hidden');
        if ($('#showMore').attr('state') == '\u6536\u8D77') {
            $('#showMore').click();
        }
    },
    _getTip: function(appName, appId, desc) {
        $('#tishi').remove();
        var h = [];
        h[h.length] = '<div id="tishi" style="width:192px">';
        h[h.length] = '<div class="tishiarrow_l"></div>';
        h[h.length] = '<div class="tishib1"></div>';
        h[h.length] = '<div class="tishib2"></div>';
        h[h.length] = '<div class="tishic">';
        h[h.length] = '<p style="font-weight: bold; padding-bottom: 4px">\u60A8\u8FD8\u672A\u6DFB\u52A0\u8BE5\u5E94\u7528</p><p>' + desc + '</p>';
        h[h.length] = '<a href="#">\u6DFB\u52A0\u5E94\u7528</a><a style="margin-left: 96px" href="#">\u5173\u95ED</a></div>';
        h[h.length] = '<div class="tishib2"></div>';
        h[h.length] = '<div class="tishib1"></div>';
        h[h.length] = '</div>';
        $("#" + appName).find(">a").after(h.join(''));
        var $as = $("#tishi a");
        $as.eq(0).click(function() {
            $.getScript('/add_app.php?appId=' + appId,
            function(d) {
                if (d == 1) {
                    $("#" + appName).attr('newflag', '0');
                    $("#tishi .tishic").html("<span style='color:green'>\u6DFB\u52A0\u6210\u529F</span>");
                    setTimeout(function() {
                        $("#tishi").fadeOut(500,
                        function() {
                            $('#tishi').remove()
                        })
                    },
                    1000);
                } else alert("\u6DFB\u52A0\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")
            });
            return false
        });
        $as.eq(1).click(function() {
            $("#tishi").remove();
            return false
        })
    },
    init: function() {
        var T = this;
        this.i = J16_INF.appMenuDisplayNum;
        $('#nav').delegate('li', 'click',
        function() {
			
            if (!$('#loading')[0]) {
                $('<div id="loading" style="display: none;">\u9875\u9762\u52A0\u8F7D\u4E2D<img src="'+G_dirUrl+'images/iplatform/img/loading.gif"></div>').appendTo('#r');
            }
            if ($('#tishi')) {
                $('#tishi').remove();
            }
            var tabs = $('#nav>li');
            var i = tabs.index(this),
            sk = tabs.removeClass('cur').find('div.sk');
            sk.each(function() {
                $(this).attr('stick') == 1 ? $(this).show() : $(this).hide();
            });
            tabs.eq(i).addClass('cur').find('div.sk').hide();
            var newAppFlag = $(this).attr('newflag');
            if (newAppFlag == 1 && J.isLogin) {
                T._getTip($(this).attr("id"), $(this).attr('appid'), $(this).attr("desc"));
            }
			var Jk_1,Jk_2,Jk_3,Jk_4;
			Jk_1=window.location+"";
			Jk_2=Jk_1.indexOf("#");
			Jk_3=Jk_1.substr(Jk_2+1,Jk_1.length);
			if(Jk_3.indexOf(",")==0)
           		J.load($(this).attr('id').replace('app_', ''));
			else{
				Jk_4=Jk_3.split(",");
				J.load2($(this).attr('id').replace('app_', ''),Jk_4[1]);
			}
            return false;
        });
        $('#app_manager').click(function() {
            $('#nav>li').removeClass('cur');
            if (qtcms_login.isLogin) J.load('manager')
            else {
                User_login();
            }
            this.blur();
            return false;
        });
        $('#nav a,#showMore').focus(function() {
            this.blur()
        });
        $('#showMore').click(function() {
            var attr = $(this).attr('state') || '\u66F4\u591A';
            if (attr === '\u66F4\u591A') {
                T.hideLis.fadeIn();
                $(this).html('<em class="jt02"></em>\u6536\u8D77').attr('state', '\u6536\u8D77');
                updateHeight();
            } else {
                T.hideLis.fadeOut(updateHeight);
                $(this).html('<em class="jt01"></em>\u66F4\u591A').attr('state', '\u66F4\u591A');
                updateHeight();
            }
            return false;
        });
        this.check();
        this.linkTo();
        function updateHeight() {
            try {
                getIns(J.activeAppName).__updateHeight();
            } catch(e) {}
        }
    }
});
/*»»·ô²¿·Ö*/
www.concat('logo', {
    __cfg: {
        icon: 'img/logo.png'
    },
    init: function() {
        this.events();
    },
    events: function() {
        $('#logoset').click(function() {
            showWindow({
                title: '\u81EA\u5B9A\u4E49Logo',
                width: 560,
                height: 400,
                iframe: 'http://img.1616.net/'
            });
            return false;
        });
    }
});
www.concat('layout', {
    __cfg: [[], ["fun", "life", "economy", "tech"]],
    _setOrder: function(order, i) {
        var T = this,
        doms = [];
        if ($type(order) != "array") return;
        if (order.join("") == T._getOrder(i).join("")) return;
        for (var k in order) {
            doms.push($("#" + order[k]).clone(true));
            $("#" + order[k]).remove();
        }
        for (var dom in doms) {
            if (dom == 0) {
                T._setArrowCss(doms[dom], "up-n", "down");
            } else if (dom == doms.length - 1) {
                T._setArrowCss(doms[dom], "up", "down-n");
            } else {
                T._setArrowCss(doms[dom], "up", "down");
            }
            if (!i) {
                $("div.l").append(doms[dom]);
            } else {
                $("#sites-r").append(doms[dom]);
            }
        }
    },
    _getOrder: function(i) {
        var re = [],
        $doms = i == 0 ? $("div.l>div.app") : $("#sites-r>div.wrap-fl");
        $doms.each(function() {
            re.push($(this).attr("id"));
        });
        return re;
    },
    _bindEvents: function() {
        var T = this,
        n = "layout",
        app = getIns("www");
        $("a.up").live("click",
        function() {
            var oldDom = $(this).parents(".app,.wrap-fl"),
            prev = oldDom.prev(".app,.wrap-fl");
            if (prev.length) {
                var dom = oldDom.clone(true);
                T._swap(dom, prev);
                prev.before(dom);
                oldDom.remove();
                _fn1();
            }
        });
        $("a.down").live("click",
        function() {
            var oldDom = $(this).parents(".app,.wrap-fl"),
            next = oldDom.next(".app,.wrap-fl");
            if (next.length) {
                var dom = dom = oldDom.clone(true);
                T._swap(dom, next);
                next.after(dom);
                oldDom.remove();
                _fn1();
            }
        });
        function _fn1(cfg) {
            var cfg = T.getCfg();
            cfg[1] = T._getOrder(1);
			
			qTcms.Cookie.set("qtlayout",cfg)
			
/*            T.__save(cfg,
            function(e) {
                if (e !== 1) {}
            });*/
        }
		var ms=qTcms.Cookie.get("qtlayout");
		if(ms!=null){
			var ms_a=ms.split(",");
			this._setOrder([ ms_a[1],ms_a[2], ms_a[3],ms_a[4], ], 1);
		}
    },
    _swap: function(appA, appB) {
        var As = appA.find(".up,.up-n,.down,.down-n"),
        Bs = appB.find(".up,.up-n,.down,.down-n"),
        cssA = [],
        cssB = [];
        As.each(function() {
            cssA.push($(this).attr("class"));
        });
        Bs.each(function() {
            cssB.push($(this).attr("class"));
        });
        As.each(function(i) {
            $(this).attr("class", cssB[i]);
        });
        Bs.each(function(i) {
            $(this).attr("class", cssA[i]);
        });
    },
    _setArrowCss: function(app, a, b) {
        var As = app.find(".up,.up-n,.down,.down-n");
        $(As[0]).attr("class", a);
        $(As[1]).attr("class", b);
    },
    __login: function(app) {
/*        var c = this.getCfg();
        if (!c) return;
        this._setOrder(c[1], 1);*/
    },
    __logout: function(app) {
        this.__login(app)
    },
    init: function() {
        this._bindEvents();
    }
}); 
(function() {
    var version_prefix = "http://www.1616.net/jd/";
    var version_cookieName = 'J1616_www_my1616';
    var version_cookieValue = {
        th: "green",
        ft: 1,
        bg: 1,
        tpg: "1-1",
        lo: 0,
        m: null
    };
    var cookie = J16.util.cookie;
    www.concat('version', {
        init: function() {
            this.events();
        },
        events: function() {
            $('#banben-a').mouseover(function() {
                $(this).addClass('banben-a-on');
                $('#banben-qh').show();
            }).mouseleave(function(e) {
                e = e.relatedTarget || e.toElement;
                if (e == $('#banben-qh')[0] || $.contains($('#banben-qh')[0], e)) {
                    return;
                }
                $('#banben-qh').hide();
                $(this).removeClass('banben-a-on');
            }).click(function() {
                return false;
            });
            $('#banben-qh').mouseleave(function(e) {
                $(this).hide();
                $('#banben-a').removeClass('banben-a-on');
            });
            $("#banben-qh a").click(function() {
                if ($(this).attr("_k") == '0') return false;
//                version_cookieValue.m = $(this).attr("_h");
//                var d = cookie.get(version_cookieName),
//                cookieValue = version_cookieValue;
//                if (d = str2obj(d)) {
//                    cookieValue = d;
//                    cookieValue.m = version_cookieValue.m;
//                }
//                cookie.set(version_cookieName, obj2str(cookieValue));
//                location.href = (version_prefix + version_cookieValue.m + ".htm");
//                return false;
            });
        }
    });
})();
/*Email²¿·Ö*/
function menc(s) {
    var r = '';
    for (var i = 0; i < s.length; i++) r += ('0' + (s.charCodeAt(i) ^ 15).toString(16)).slice( - 2);
    return r;
}
function mdec(s) {
    s = s.replace(/[^0-9a-z]/gi, '');
    var r = '';
    for (var i = 0; i < s.length; i += 2) r += String.fromCharCode(parseInt(s.substr(i, 2), 16) ^ 15);
    return r;
}
/*ÎÒµÄÍøÖ·²¿·Ö*/
/*ÃûÕ¾µ¼º½²¿·Ö*/
var stat = (new function() {
    this.createImg = function(src) {
        var img = $('<img />').attr('src', src);
        setTimeout(function() {
            delete img
        },
        100);
    };
    this.s16 = function(a, p) {
        var wp = ["act=" + a, "log=" + ( + J.isLogin), "uid=" + J16_INF.user];
        for (var i = 0; i < p.length; i += 2) {
            wp.push(p[i] + "=" + euc(p[i + 1]));
        }
        //this.createImg("http://st.1616.net/s.php?" + wp.join("&"));
    };
    this.init = function(wrap, appname) {
        var T = this;
        $(wrap).mousedown(function(e) {
            e = e.target;
            var getAct = function(dom) {
                var attr = dom.getAttribute('s16');
                if (attr === null && dom.parentNode && dom.parentNode != (wrap.body || wrap)) {
                    attr = getAct(dom.parentNode);
                }
                return attr;
            };
            var atr = e.getAttribute && e.getAttribute('s16');
            if (atr && atr.match(/^#/)) {
                //T.createImg("http://st.1616.net/s.php?" + atr.replace('#', ''));
                return;
            }
            if (e.tagName == 'FONT' || e.tagName == 'IMG') e = e.parentNode;
            if (e.tagName == 'A') {
                var pn = getAct(e);
                if (!appname) {
                    var appid = e.parentNode.getAttribute('appid');
                    if (appid !== null) {
                        T.s16(12, ['app', e.parentNode.id.replace('app_', ''), 'appid', appid, 'referer', __REFERER__]);
                    }
                    if (pn !== null) {
                        T.s16(1, ['pn', pn, 'u', e.href, 't', $(e).text().replace(/ /g, '')]);
                    }
                } else {}
            }
        });
        return this;
    };
}).init(document);

//window.load;

var J = new Main();
function getIns(name) {
    return J.apps[name] || null;
}
function testSpeed(url, debug) {
    if (Math.random() < .1 || debug) {
        var time = +new Date;
        var domain = url.match(/http:\/\/(.*?)\//)[1];
        $('<img />').attr('src', url).load(function() {
            time = ( + new Date) - time;
            $.getScript('http://st.1616.net/get_clientinfo.php?lt=' + time + '&cip=&dm=' + domain);
        });
    }
}
//testSpeed('http://r.9533.com/iplatform/img/speed_test.gif');
//testSpeed('http://www.1616.net/jd/img/speed_test.gif');
//testSpeed('http://i.9533.com/img/speed_test.gif');
var Weather = {
    init: function() {
        this.events();
    },
    _getWeather: function(city, dis) {
        var weatherFile = city == dis ? city: city + dis;
        $.get('http://www.1616.net/grab/weather/' + euc(euc(weatherFile)) + '.htm',
        function(html) {
            $('#weather_sl')[0].innerHTML = html;
            $('#wt_head')[0].innerHTML = dis + '7\u65E5\u5929\u6C14';
        });
    },
    events: function() {
        $('#wt-city').live('click',
        function() {
            var ifr = $('#ifweather');
            if (ifr.attr('src') == 'about:blank') {
                ifr.attr('src', 'about:blank');
                ifr.attr('src', my_tq);
            }
            ifr.show();
            return false;
        });
    }
};
//www.concat('weather', Weather);

//lunar

//news

//var news = {
//    events: function() {
//        $("#news_sl>h3 a").click(function() {
//            //$('#app_news').click();
//            return false;
//        });
//    },
//    init: function() {
//        this.events();
//    }
//};
//news.init();

var appnews = {
    init: function() {
		
		var a=qtCms_key_main1;	
		var s="",s2=0,s3="",mi=1;
		for(var k=0;k<a.length;k++){
			if(a[k][0]!=""&&mi<=12){
				s+='<li><a href="'+a[k][0]+'">'+a[k][1]+'</a></li>'	
				mi++;
			}
		}
		qTcms.Dom.get("pslbox").innerHTML=s;	
		
        var links = $('#news_sl>h3>span>a');
        var lists = $('ul.slbox>li');
        var _timer;
        links.mouseover(function() {
            var i = parseInt(this.innerHTML - 1),_this = this;
            _timer = setTimeout(function() {
                links.removeClass('news_sl_on'); 
				_this.className = 'news_sl_on';
				lists.hide();
                for (var j = i * 3; j < i * 3 + 3; j++) {
                    lists.eq(j).show();
                }
            },
            300)
        }).mouseout(function() {
            clearTimeout(_timer);
        }).click(function() {
            return false;
        })
    }
};
appnews.init();