var global = {}; global.namespace = function (str) {var arr = str.split ("."), o = global, i; for (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 (nó): nó; var nextNode = node.NexTSibling; if (! NextNode) {return null; } if (! } else {if (nextNode.NexTSibling) {nextNode = nextNode.nextSibling; } else {break; }}} retornar NextNode; }} Global.dom.setOpacity = function (nó, nível) {node = typeOf Node == "String"? document.getElementById (nó): nó; if (document.all) {node.style.filter = 'alpha (opacity =' + nível + ')'; } else {node.style.opacity = nível / 100; }}; Global.dom.getElementsByClassName = function (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 = []; para (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 [j] == str) {arr.push (els [i]; quebrar; }}} return arr;} global.namespace ("event"); 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; Retornar E.Srcelement || e.target;}; global.Event.on = function (nó, eventtype, manipulador) {node = typeof node == "string"? document.getElementById (nó): nó; if (document.all) {node.attachevent ("on" + eventType, manipulador); } else {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) {return! Isnan (s);}; isBoolean (s) {return typeof s === "boolean";} função isfunction (s) {return typeof s === "function";} função isNull (s) {return s === null;} função isundefined (s) {return s === "};}; isarray (s) {return s instanceof Array;} global.dom.get = function (node) {node = typeof node === "string"? document.getElementById (nó): nó; Return node;} função $ (nó) {node = typeof node == "string"? document.getElementById (nó): nó; Return node;} global.lang.extend = function (subclasse, 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 ("cookie"); global.cookie = {leia: function (name) {var cookiest = ";"; + document.cookie + ";"; var index = cookiest.indexOf (";" + nome + "="); if (index! = -1) {var s = cookiest.substring (index + name.length + 3, cookiest.length); Retornar UNESCAPE (S.Substring (0, S.IndexOF (";"; "))); } else {return null; }}, set: function (nome, valor, expire) {var exptays = expira * 24 * 60 * 60 * 1000; var expDate = new Date (); expstate.setTime (expDate.gettime () + expDays); var expString = expira? ";; expires =" + expDate.togmtString (): ""; var pathstring = "; path =/"; document.cookie = nome + "=" + escape (valor) + expstring + pathstring; }, del: function (nome, valor, expire) {var exp = new Date (new Date (). gettime () - 1); var s = this.read (nome); if (s! = null) {document.cookie = nome + "=" + s + "; expires =" + exp.togmtString () + "; caminho =/"; }}};