var Getdata = { _init: function (b, a) { $.ajax({ url: a.l_d + ".ashx/" + a.iconame, type: "post", data: a.params(), dataType: "json", error: function (e) { }, success: function (d) { b(d) } }) }, _initP: function (b, a) { $.ajax({ url: a.loadingData + ".ashx/" + a.iconame, type: "post", data: a.params, dataType: "json", error: function (e) { }, success: function (d) { b(d); if (a.log) { Common.LogDictionary(a.log[0].split(",")[0], a.log[0].split(",")[1], a.log[1]) } } }) }, Bind: function (b, a) { this._init(b, a) }, GetBind: function (a) { var layoutCur = a.curLayout; var idname = "#" + a.asyncmodle; $(idname).hasClass(a.loadingName) || $(idname).addClass(a.loadingName); this.Bind(function (d) { if (d != null) { a.fun(d, idname) } }, a) } }; var urlParams = {}; var Common = { safeurl: function (a) { var reg = /<[^<>]+>/g; a.replace(reg, ''); a = a.replace(//g, "").replace(/\\/g, "").replace(/]/g, "").replace(/\[/g, "").replace(/'/g, "").replace(/^/g, "").replace(/=/g, "").replace(/\//g, "").replace(/"/g, "").replace(/\(/g, "").replace(/\)/g, ""); return a; }, OpenUrl: function () { var url = arguments[0]; if (url.indexOf("?") > 0) { if (url.split("?")[1].substring(4, 5) != "=") { if (url.split("?")[1].substring(0, 4) == "zlid") { url = url.split("?")[0] + "?zlid=" + url.split("?")[1].substring(4) } } if (arguments[0].indexOf("jgid") >= 0) { url = url.split("jgid")[0] + "jgid=" + $("#00000000").val() } arguments[0] = url; var paraString = arguments[0].substring(arguments[0].indexOf("?") + 1, arguments[0].length); if (url.split("?")[0].indexOf("huaxu") >= 0 || url.split("?")[0].indexOf("show") >= 0) { window.open(arguments[0].substring(0, arguments[0].indexOf("?") + 1) + encodeURIComponent(paraString)) } else { window.location.href = arguments[0].substring(0, arguments[0].indexOf("?") + 1) + encodeURIComponent(paraString) } } else { window.location.href = arguments[0] } }, SetUrlValue: function () { var paraString = arguments[0].substring(arguments[0].indexOf("?") + 1, arguments[0].length); return arguments[0].substring(0, arguments[0].indexOf("?") + 1) + encodeURIComponent(paraString) }, GetUrlValue: function () { var url = decodeURIComponent(location.href.substring(location.href.indexOf('?') + 1)); if (url && url != location.href) url = url.replace(/\n/g, "
").replace(/'/g, "’").split("&"); else return null; $.each(url, function (i, p) { eval("urlParams." + p.split("=")[0].toLowerCase() + "='" + Common.safeurl(p.split("=")[1]) + "';"); }); }, S4: function () { return (((1 + Math.random()) * 65536) | 0).toString(16).substring(1) }, Guid: function () { return Common.S4() + Common.S4() + "-" + Common.S4() + "-" + Common.S4() + "-" + Common.S4() + "-" + Common.S4() + Common.S4() + Common.S4() }, GetPlace: function () { var aa = "22222", bb = Cookie.Get(aa); if (bb == null) { if (remote_ip_info && remote_ip_info.ret == 1) { bb = remote_ip_info.country + "@" + remote_ip_info.province + "@" + remote_ip_info.city; Cookie.Add(aa, bb) } else { setTimeout(function () { return Common.GetPlace() }, 1000) } } return bb }, L: function (a, b, c) { if (a == "3" && ("undefined" != typeof (y_l_s))) { c = y_l_s } Getdata.Bind(function (d) { }, { l_d: "/ReadRoom/handler/Log", iconame: "log", params: function () { return { libcode: urlParams.libcode ? urlParams.libcode : $("#libcode").html(), a: a, b: b, c: c } } }) } }; var Cookie = { Add: function (name, value) { var Hours = 1; var exp = new Date(); if (arguments[2] == null) { exp.setTime(exp.getTime() + Hours * 60 * 60 * 1000) } else { exp.setTime(exp.getTime() + Hours * 60 * 60 * 1000 * Math.floor(arguments[2])) }}, Del: function (name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = Cookie.Get(name); if (cval != null) { document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() } }, Get: function (name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) { return arr[2] } else { return null } } };