var global = {}; global.namespace = function (str) {var arr = str.split ("."), o = global, i; สำหรับ (i = (arr [0] = "global")? 1: 0; i <arr.length; i ++) {o [arr [i]] = o [arr [i]] || - o = o [arr [i]]; }}; // dom 相关 global.namespace ("dom"); global.dom.getNextNode = ฟังก์ชั่น (โหนด) {node = typeof node == "สตริง"? document.getElementById (โหนด): โหนด; var nextNode = node.nextsibling; if (! nextNode) {return null; } if (! document.all) {ในขณะที่ (จริง) {if (nextNode.nodeType == 1) {break; } else {if (nextNode.nextSibling) {nextNode = nextNode.nextSibling; } else {break; }}} return nextNode; }} global.dom.setOpacity = function (โหนด, ระดับ) {node = typeof node == "String"? document.getElementById (โหนด): โหนด; if (document.all) {node.style.filter = 'alpha (opacity =' + ระดับ + ')'; } else {node.style.Opacity = ระดับ / 100; }}; global.dom.detElementByClassName = function (str, root, tag) {if (root) {root = typeof root == "String"? document.getElementById (root): root; } else {root = document.body; } tag = tag || - var els = root.getElementsByTagname (แท็ก), arr = []; สำหรับ (var i = 0, n = els.length; i <n; i ++) {สำหรับ (var j = 0, k = els [i] .classname.split (""), l = k.length; j <l; j ++) {ถ้า (k [j] == str) {arr.push (els [i]); หยุดพัก; }}} return arr;} global.namespace ("เหตุการณ์"); global.event.stoppropagation = function (e) {e = window.event || E; if (document.all) {e.cancelBubble = true; } else {E.StopPropagation (); }}; global.event.getEventTarget = function (e) {e = window.event || E; ส่งคืน e.srcenement || e.target;}; global.event.on = ฟังก์ชั่น (โหนด, EventType, Handler) {node = typeof node == "String"? document.getElementById (โหนด): โหนด; if (document.all) {node.attachevent ("on" + eventtype, handler); } else {node.addeventListener (EventType, Handler, False); }}; // lang 相关 global.namespace ("lang"); global.lang.trim = function (OSTR) {return OSTR.replace (/^/s+|/s+$/g, "");}; global.lang.isnumber = ฟังก์ชั่น (s) {return! Isboolean (s) {return typeof s === "boolean";} ฟังก์ชั่น isfunction (s) {return typeof s === "function";} ฟังก์ชั่น isnull (s) {return s === null;} ฟังก์ชั่น isundefined (s) {return typeof s === /^/s*$/.test(s);} function isarray (s) {return s อินสแตนซ์ของอาร์เรย์;} global.dom.get = function (node) {node = typeof node === "String"? document.getElementById (โหนด): โหนด; return node;} function $ (node) {node = typeof node == "string"? document.getElementById (โหนด): โหนด; ส่งคืนโหนด;} global.lang.extend = ฟังก์ชั่น (subclass, superclass) {var f = function () {}; f.prototype = superclass.prototype; subclass.prototype = new f (); subclass.prototype.constructor = subclass; subclass.superclass = subclass.prototype; if (superclass.prototype.constructor == object.prototype.constructor) {superclass.prototype.constructor = superclass; }}; global.namespace ("คุกกี้"); global.cookie = {อ่าน: ฟังก์ชั่น (ชื่อ) {var cookiestr = ";" + document.cookie + ";"; ดัชนี var = cookiestr.indexof (";" + ชื่อ + "="); if (index! = -1) {var s = cookiestr.substring (index + name.length + 3, cookiestr.length); กลับ Unsescape (s.substring (0, s.indexof (";"))); } else {return null; }}, set: function (ชื่อ, ค่า, หมดอายุ) {var expdays = Expires * 24 * 60 * 60 * 1000; var expdate = วันที่ใหม่ (); Expdate.settime (Expdate.getTime () + Expdays); var expstring = หมดอายุ? "; expires =" + expdate.togmtstring (): ""; var pathstring = "; path =/"; document.cookie = name + "=" + escape (value) + expstring + pathstring; }, del: ฟังก์ชัน (ชื่อ, ค่า, หมดอายุ) {var exp = วันที่ใหม่ (วันที่ใหม่ (). getTime () - 1); var s = this.read (ชื่อ); if (s! = null) {document.cookie = name + "=" + s + "; expires =" + exp.togmtString () + "; path =/"; -