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 = function (node) {node = typeof node == "string"؟ document.getElementById (العقدة): العقدة ؛ var nextNode = node.nextsibling ؛ if (! nextNode) {return null ؛ } if (! document.all) {بينما (صحيح) {if (nextNode.nodeType == 1) {break ؛ } آخر {if (nextNode.nextsibling) {nextNode = nextNode.nextsibling ؛ } آخر {break ؛ }}} return nextNode ؛ }} global.dom.setOpacity = function (node ، level) {node = typeof node == "string"؟ document.getElementById (العقدة): العقدة ؛ if (document.all) {node.style.filter = 'alpha (opacity =' + level + ')' ؛ } آخر {node.style.opacity = المستوى / 100 ؛ }} ؛ global.dom.getElementSbyClassName = function (str ، root ، tag) {if (root) {root = typeof root == "string"؟ document.getElementById (الجذر): الجذر ؛ } آخر {root = document.body ؛ } علامة = علامة || "*" ؛ var els = root.getElementSbyTagName (tag) ، arr = [] ؛ لـ (var i = 0 ، n = els.length ؛ i <n ؛ i ++) {for (var j = 0 ، k = els [i] .classname.split ("") ، l = k.length ؛ j <l ؛ j ++) {if (k] == str) {arr.push (els [i]) ؛ استراحة؛ }}} return arr ؛} global.namespace ("event") ؛ global.event.stopPropagation = function (e) {e = window.event || ه ؛ if (document.all) {E.CanCelBubble = true ؛ } آخر {E.StopPropagation () ؛ }} ؛ global.event.getEventTarget = function (e) {e = window.event || ه ؛ إرجاع e.srcelement || e.target ؛} ؛ global.event.on = function (node ، eventType ، Handler) {node = typeof node == "string"؟ document.getElementById (العقدة): العقدة ؛ if (document.all) {node.attachevent ("on" + eventType ، Handler) ؛ } آخر {node.addeventListener (EventType ، Handler ، false) ؛ }} ؛ // lang 相关 global.namespace ("lang") ؛ global.lang.trim = function (OSTR) {return ostr.replace (/^/s+|/s+$/g ، "") ؛} ؛ global.lang.isnumber = function (s) isBoolean (s) {return typeof s === "boolean" ؛} وظيفة isFunction (s) {return typeof s === "function" ؛ /^/S*$/. document.getElementById (العقدة): العقدة ؛ إرجاع العقدة ؛} الدالة $ (node) {node = typeof node == "string"؟ document.getElementById (العقدة): العقدة ؛ return node ؛} global.lang.extend = function (الفئة الفرعية ، الفئة الفائقة) {var f = function () {} ؛ f.prototype = superclass.prototype ؛ subcleass.prototype = new f () ؛ subcleass.prototype.constructor = فئة فرعية ؛ الفئة الفرعية. if (superclass.prototype.constructor == object.prototype.constructor) {superclass.prototype.constructor = superclass ؛ }} ؛ global.namespace ("cookie") ؛ global.cookie = {read: function (name) {var cookiestr = "؛" + document.cookie + "؛" ؛ var index = cookiestr.indexof ("؛" + name + "=") ؛ if (index! = -1) {var s = cookiestr.substring (index + name.length + 3 ، cookiestr.length) ؛ إرجاع unescape (S.SubString (0 ، s.indexof ("؛"))) ؛ } آخر {return null ؛ }} ، set: function (name ، value ، expares) {var expdays = Expires * 24 * 60 * 60 * 1000 ؛ var expdate = new date () ؛ expdate.settime (expdate.gettime () + expdays) ؛ var expstring = انتهاء صلاحية؟ "؛ expires =" + expdate.togmtstring (): "" ؛ var pathstring = "؛ path =/" ؛ document.cookie = name + "=" + Escape (value) + expstring + pathstring ؛ } ، del: function (name ، value ، expares) {var exp = new date (new date (). getTime () - 1) ؛ var s = this.read (name) ؛ if (s! = null) {document.cookie = name + "=" + s + "؛ expires =" + exp.togMtString () + "؛ path =/" ؛ }}} ؛