var global = {}; global.namespace = function (str) {var arr = str.split ("."), o = global, i; für (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 = Funktion (Knoten) {node = typeof node == "String"? document.getElementById (Knoten): Knoten; var nextNode = node.nextsibling; if (! NextNode) {return null; } if (! document.All) {while (true) {if (newtNode.nodetype == 1) {break; } else {if (nächstennode.nextsibling) {nextNode = nextNode.nextsibling; } else {break; }}} return NextNode; }} Global.dom.setopacity = Funktion (Knoten, Ebene) {node = typeof node == "String"? document.getElementById (Knoten): Knoten; if (document.All) {node.style.filter = 'alpha (opacity =' + Level + ')'; } else {node.style.opacity = Level / 100; }}; Global.dom.GetElementsByClassName = Funktion (str, root, Tag) {if (root) {root = typeof root == "String"? document.getElementById (root): root; } else {root = document.body; } Tag = Tag || "*"; var els = root.getElementsByTagName (Tag), arr = []; für (var i = 0, n = elsgth; i <n; i ++) {für (var j = 0, k = els [i] .className.split (""), l = k.length; j <l; j ++) {if (k [j] == STR) {arr.push (els [i]); brechen; }}} return arr;} global.namespace ("event"); global.event.stopPropagation = Funktion (e) {e = window.event || e; if (document.all) {e.cancelBubble = true; } else {e.StopPropagation (); }}; Global.event.geEventTarget = function (e) {e = window.event || e; return e.srcelement || E.Target;}; global.event.on = Funktion (Knoten, EventType, Handler) {node = typeof node == "String"? document.getElementById (Knoten): Knoten; 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 = isnumber = Funktion (s) {return! isBoolean (s) {return typeof s === "boolean";} Funktion isFunction (s) {return typeof s === "Funktion";} Funktion isnull (s) {return s === null;} Funktion isundefined (s) {return typeof s === "unddefined"; /^/s*$/.test(s); }function isArray (s) {return sinstanceOf array;} global.dom.get = function (node) {node = typeof node === "String"? document.getElementById (Knoten): Knoten; Rückgabeknoten;} Funktion $ (Node) {node = typeof node == "String"? document.getElementById (Knoten): Knoten; return node;} global.lang.extend = Funktion (Unterklasse, Superklasse) {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 ("cookie"); global.cookie = {read: function (name) {var cookiestr = ";" + document.cookie + ";"; var index = cookiestr.indexof (";" + name + "="); if (index! Return Unscape (substring (0, S.Intexof (";"))); } else {return null; }}, set: function (name, value, abläuft) {var expdays = läuft * 24 * 60 * 60 * 1000; var expdate = new Date (); expdate.settime (expdate.getTime () + expdays); var expstring = läuft ab? "; expires =" + expdate.togmtstring (): ""; var pathstring = "; path =/"; document.cookie = name + "=" + Escape (Wert) + expstring + pathstring; }, del: function (name, value, läuft) {var exp = neues Datum (neuer Datum (). GetTime () - 1); var s = this.read (name); if (s! = null) {document.cookie = name + "=" + s + "; expires =" + exp.togmtstring () + "; path =/"; }}};