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相关blobal.namespace( "dom"); global.dom.getnextnode = function(node){node = typeof node == "string"? document.getElementByID(ノード):node; 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; }}} nextnodeを返します。 }} global.dom.setopacity = function(node、level){node = typeof node == "string"? document.getElementByID(ノード):node; if(document.all){node.style.filter = 'alpha(opacity =' + level + ')'; } else {node.style.opacity = level / 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 = []; for(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]);壊す; }}} 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; e.srcelementを返します|| e.target;}; global.event.on = function(node、eventtype、handler){node = typeof node == "string"? document.getElementByID(ノード):node; if(document.all){node.attachevent( "on" + eventType、handler); } else {node.addeventlistener(eventType、ハンドラー、false); }}; // Lang iSboolean(s){return typeof s === "boolean";}関数isFunction(s){return typeof s === "function";}関数isnull(s){return s === null;} function isundefined(s){return typeof s === "redefined";}関数Isempt(s){return /^/s*$/.test(s);} function isarray(s){return s instanceof array;} global.dom.get = function(node){node = typeof node === "string"? document.getElementByID(ノード):node; node;} function $(node){node = typeof node == "string"? document.getElementByID(ノード):node; 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 = cosiestr.indexof( ";" + name + "="); if(index!= -1){var s = cosiestr.substring(index + name.length + 3、cosiestr.length); unscape(s.substring(0、s.indexof( ";"))); } else {return null; }}、set:function(name、value、expires){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、expires){var exp = new date(new date()。gettime() - 1); var s = this.read(name); if(s!= null){document.cookie = name + "=" + s + "; expires =" + exp.togmtstring() + "; path =/"; }}};