var global = {}; global.namespace = function (str) {var arr = str.split ("."), o = global, i; para (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 (nodo) {node = typeOf node == "string"? document.getElementById (nodo): nodo; var nextNode = node.nextSibling; if (! nextNode) {return null; } if (! document.all) {while (true) {if (nextNode.nodeType == 1) {break; } else {if (nextNode.nextSibling) {nextNode = nextNode.nextSibling; } else {break; }}} return nextNode; }} Global.dom.setOpacity = function (nodo, nivel) {nodo = typeof node == "cadena"? document.getElementById (nodo): nodo; if (document.all) {node.style.filter = 'alfa (opacidad =' + nivel + ')'; } else {node.style.opacity = nivel / 100; }}; Global.dom.getElementsByClassName = function (str, root, tag) {if (root) {root = typeof root == "string"? document.getElementById (root): root; } else {root = document.body; } etiqueta = etiqueta || "*"; 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] == strens) {arr.push (els [i]); romper; }}} return arr;} global.namespace ("Event"); Global.event.stopPropagation = function (e) {e = window.event || mi; if (document.all) {e.cancelBubble = true; } else {e.stoppropagation (); }}; Global.event.getEventTarget = function (e) {e = window.event || mi; regreso E. Srcelement || e.target;}; global.event.on = function (nodo, eventType, handler) {node = typeOf node == "cadena"? document.getElementById (nodo): nodo; if (document.all) {node.attachevent ("on" + eventtype, handler); } else {node.adDeventListener (eventType, Handler, falso); }}; // lang 相关 global.namespace ("lang"); global.lang.trim = function (ostr) {return ostr.replace (/^/s+|/s+$/g, "");}; global.lang.isnumber = function (s) {return! Isnan (s);}; function issstring (s) isboolean (s) {return typeof s === "boolean";} function isfunction (s) {return typeOf s === "function";} function isnull (s) {return s === null;} function isUndeFined (s) {return typeOf s === "invasado";} función (s) {return /^/s*$/.test(s) ;}function isArray (s) {return s instanceOf array;} global.dom.get = function (nodo) {nodo = typeof node === "cadena"? document.getElementById (nodo): nodo; return node;} function $ (nodo) {nodo = typeof node == "cadena"? document.getElementById (nodo): nodo; return node;} global.lang.extend = function (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 ("cookie"); global.cookie = {read: function (name) {var Cookiestr = ";" + document.cookie + ";"; Var index = Cookiestr.IndexOf (";" + nombre + "="); if (index! = -1) {var s = Cookiestr.substring (index + name.length + 3, cookiestr.length); return unescape (s.substring (0, s.indexof (";"))); } else {return null; }}, set: function (nombre, valor, vencido) {var expays = expires * 24 * 60 * 60 * 1000; var expdate = new Date (); expdate.settime (expdate.gettime () + expdays); var expstring = expiras? "; expires =" + expdate.togmtString (): ""; var pathString = "; path =/"; document.cookie = name + "=" + Escape (valor) + expstring + pathString; }, del: function (nombre, valor, vencido) {var exp = new Date (new Date (). GetTime () - 1); var s = this.read (nombre); if (s! = null) {document.cookie = name + "=" + s + "; expires =" + exp.togmtstring () + "; path =/"; }}};