From be78d9e349630417b548103ebf2d931f2ff7abfa Mon Sep 17 00:00:00 2001 From: bnu Date: Wed, 22 Jan 2014 15:33:18 +0900 Subject: [PATCH] #358 minify x.js --- Gruntfile.js | 1 + common/js/x.js | 914 ++++++++++++++++++++++----------------------- common/js/x.min.js | 39 +- 3 files changed, 459 insertions(+), 495 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9a124b940..cd1c05bb8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -52,6 +52,7 @@ module.exports = function(grunt) { }, 'modules': { files: { + 'common/js/x.min.js' : ['common/js/x.js'], // addon 'addons/captcha/captcha.min.js' : ['addons/captcha/captcha.js'], 'addons/captcha_member/captcha.min.js' : ['addons/captcha_member/captcha.js'], diff --git a/common/js/x.js b/common/js/x.js index e0a065970..111801a5e 100644 --- a/common/js/x.js +++ b/common/js/x.js @@ -1,6 +1,6 @@ -/** - * x.js compiled from X 4.0 with XC 0.27b. - * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com +/** + * x.js compiled from X 4.0 with XC 0.27b. + * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com * Copyright 2001-2005 Michael Foster (Cross-Browser.com) **/ function xDeprecate(funcName) { @@ -12,18 +12,18 @@ function xDeprecate(funcName) { var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase(); if(window.opera){ - var i=xUA.indexOf('opera'); - if(i!=-1){ - var v=parseInt(xUA.charAt(i+6)); - xOp7Up=v>=7; - xOp6Dn=v<7; - } + var i=xUA.indexOf('opera'); + if(i!=-1){ + var v=parseInt(xUA.charAt(i+6)); + xOp7Up=v>=7; + xOp6Dn=v<7; + } } else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){ - xIE4Up=parseFloat(navigator.appVersion)>=4; - xIE4=xUA.indexOf('msie 4')!=-1; - xIE5=xUA.indexOf('msie 5')!=-1; - xIE6=xUA.indexOf('msie 6')!=-1; + xIE4Up=parseFloat(navigator.appVersion)>=4; + xIE4=xUA.indexOf('msie 4')!=-1; + xIE5=xUA.indexOf('msie 5')!=-1; + xIE6=xUA.indexOf('msie 6')!=-1; } else if(document.layers){xNN4=true;} var xMac=xUA.indexOf('mac')!=-1; @@ -32,544 +32,544 @@ var xFF=xUA.indexOf('firefox')!=-1; // (element, event(without 'on'), event listener(function name)[, caption]) function xAddEventListener(e,eT,eL,cap) { - xDeprecate('xAddEventListener'); - if(!(e=xGetElementById(e))) return; - eT=eT.toLowerCase(); - if((!xIE4Up && !xOp7Up) && e==window) { - if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; } - if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; } - } - var eh='e.on'+eT+'=eL'; - if(e.addEventListener) e.addEventListener(eT,eL,cap); - else if(e.attachEvent) e.attachEvent('on'+eT,eL); - else eval(eh); + xDeprecate('xAddEventListener'); + if(!(e=xGetElementById(e))) return; + eT=eT.toLowerCase(); + if((!xIE4Up && !xOp7Up) && e==window) { + if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; } + if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; } + } + var eh='e.on'+eT+'=eL'; + if(e.addEventListener) e.addEventListener(eT,eL,cap); + else if(e.attachEvent) e.attachEvent('on'+eT,eL); + else eval(eh); } // called only from the above function xResizeEvent() { - xDeprecate('xResizeEvent'); - if (window.xREL) setTimeout('xResizeEvent()', 250); - var cw = xClientWidth(), ch = xClientHeight(); - if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); } + xDeprecate('xResizeEvent'); + if (window.xREL) setTimeout('xResizeEvent()', 250); + var cw = xClientWidth(), ch = xClientHeight(); + if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); } } function xScrollEvent() { - xDeprecate('xScrollEvent'); - if (window.xSEL) setTimeout('xScrollEvent()', 250); - var sl = xScrollLeft(), st = xScrollTop(); - if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); } + xDeprecate('xScrollEvent'); + if (window.xSEL) setTimeout('xScrollEvent()', 250); + var sl = xScrollLeft(), st = xScrollTop(); + if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); } } function xAppendChild(oParent, oChild) { - xDeprecate('xAppendChild'); - if (oParent.appendChild) return oParent.appendChild(oChild); - else return null; + xDeprecate('xAppendChild'); + if (oParent.appendChild) return oParent.appendChild(oChild); + else return null; } function xClientHeight() { - xDeprecate('xClientHeight'); - var h=0; - if(xOp6Dn) h=window.innerHeight; - else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight) - h=document.documentElement.clientHeight; - else if(document.body && document.body.clientHeight) - h=document.body.clientHeight; - else if(xDef(window.innerWidth,window.innerHeight,document.width)) { - h=window.innerHeight; - if(document.width>window.innerWidth) h-=16; - } - return h; + xDeprecate('xClientHeight'); + var h=0; + if(xOp6Dn) h=window.innerHeight; + else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight) + h=document.documentElement.clientHeight; + else if(document.body && document.body.clientHeight) + h=document.body.clientHeight; + else if(xDef(window.innerWidth,window.innerHeight,document.width)) { + h=window.innerHeight; + if(document.width>window.innerWidth) h-=16; + } + return h; } function xClientWidth() { - xDeprecate('xClientWidth'); - var w=0; - if(xOp6Dn) w=window.innerWidth; - else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth) - w=document.documentElement.clientWidth; - else if(document.body && document.body.clientWidth) - w=document.body.clientWidth; - else if(xDef(window.innerWidth,window.innerHeight,document.height)) { - w=window.innerWidth; - if(document.height>window.innerHeight) w-=16; - } - return w; + xDeprecate('xClientWidth'); + var w=0; + if(xOp6Dn) w=window.innerWidth; + else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth) + w=document.documentElement.clientWidth; + else if(document.body && document.body.clientWidth) + w=document.body.clientWidth; + else if(xDef(window.innerWidth,window.innerHeight,document.height)) { + w=window.innerWidth; + if(document.height>window.innerHeight) w-=16; + } + return w; } function xCreateElement(sTag) { - xDeprecate('xCreateElement'); - if (document.createElement) return document.createElement(sTag); - else return null; + xDeprecate('xCreateElement'); + if (document.createElement) return document.createElement(sTag); + else return null; } function xDef() { - xDeprecate('xDef'); - for(var i=0; i 0) { - var offset = document.cookie.indexOf(search); - if (offset != -1) { - offset += search.length; - var end = document.cookie.indexOf(";", offset); - if (end == -1) end = document.cookie.length; - value = unescape(document.cookie.substring(offset, end)); - } - } - return value; + xDeprecate('xGetCookie'); + var value=null, search=name+"="; + if (document.cookie.length > 0) { + var offset = document.cookie.indexOf(search); + if (offset != -1) { + offset += search.length; + var end = document.cookie.indexOf(";", offset); + if (end == -1) end = document.cookie.length; + value = unescape(document.cookie.substring(offset, end)); + } + } + return value; } function xGetElementById(e) { - xDeprecate('xGetElementById'); - if(typeof(e)!='string') return e; - if(document.getElementById) e=document.getElementById(e); - else if(document.all) e=document.all[e]; - else e=null; - return e; + xDeprecate('xGetElementById'); + if(typeof(e)!='string') return e; + if(document.getElementById) e=document.getElementById(e); + else if(document.all) e=document.all[e]; + else e=null; + return e; } function xGetElementsByAttribute(sTag, sAtt, sRE, fn) { - xDeprecate('xGetElementsByAttribute'); - var a, list, found = new Array(), re = new RegExp(sRE, 'i'); - list = xGetElementsByTagName(sTag); - for (var i = 0; i < list.length; ++i) { - a = list[i].getAttribute(sAtt); - if (!a) {a = list[i][sAtt];} - if (typeof(a)=='string' && a.search(re) != -1) { - found[found.length] = list[i]; - if (fn) fn(list[i]); - } - } - return found; + xDeprecate('xGetElementsByAttribute'); + var a, list, found = new Array(), re = new RegExp(sRE, 'i'); + list = xGetElementsByTagName(sTag); + for (var i = 0; i < list.length; ++i) { + a = list[i].getAttribute(sAtt); + if (!a) {a = list[i][sAtt];} + if (typeof(a)=='string' && a.search(re) != -1) { + found[found.length] = list[i]; + if (fn) fn(list[i]); + } + } + return found; } function xGetElementsByClassName(c,p,t,f) { - xDeprecate('xGetElementsByClassName'); - var found = new Array(); - var re = new RegExp('\\b'+c+'\\b', 'i'); - var list = xGetElementsByTagName(t, p); - for (var i = 0; i < list.length; ++i) { - if (list[i].className && list[i].className.search(re) != -1) { - found[found.length] = list[i]; - if (f) f(list[i]); - } - } - return found; + xDeprecate('xGetElementsByClassName'); + var found = new Array(); + var re = new RegExp('\\b'+c+'\\b', 'i'); + var list = xGetElementsByTagName(t, p); + for (var i = 0; i < list.length; ++i) { + if (list[i].className && list[i].className.search(re) != -1) { + found[found.length] = list[i]; + if (f) f(list[i]); + } + } + return found; } function xGetElementsByTagName(t,p) { - xDeprecate('xGetElementsByTagName'); - var list = null; - t = t || '*'; - p = p || document; - if (xIE4 || xIE5) { - if (t == '*') list = p.all; - else list = p.all.tags(t); - } - else if (p.getElementsByTagName) list = p.getElementsByTagName(t); - return list || new Array(); + xDeprecate('xGetElementsByTagName'); + var list = null; + t = t || '*'; + p = p || document; + if (xIE4 || xIE5) { + if (t == '*') list = p.all; + else list = p.all.tags(t); + } + else if (p.getElementsByTagName) list = p.getElementsByTagName(t); + return list || new Array(); } function xGetURLArguments() { - xDeprecate('xGetURLArguments'); - var idx = location.href.indexOf('?'); - var params = new Array(); - if (idx != -1) { - var pairs = location.href.substring(idx+1, location.href.length).split('&'); - for (var i=0; i=0) { - var pt=0,pb=0,bt=0,bb=0; - if (document.compatMode=='CSS1Compat') { - var gcs = xGetComputedStyle; - pt=gcs(e,'padding-top',1); - if (pt !== null) { - pb=gcs(e,'padding-bottom',1); - bt=gcs(e,'border-top-width',1); - bb=gcs(e,'border-bottom-width',1); - } - // Should we try this as a last resort? - // At this point getComputedStyle and currentStyle do not exist. - else if(xDef(e.offsetHeight,e.style.height)){ - e.style.height=h+'px'; - pt=e.offsetHeight-h; - } - } - h-=(pt+pb+bt+bb); - if(isNaN(h)||h<0) return null; - else e.style.height=h+'px'; - } - h=e.offsetHeight; - } - else if(css && xDef(e.style.pixelHeight)) { - if(h>=0) e.style.pixelHeight=h; - h=e.style.pixelHeight; - } - return h; + xDeprecate('xHeight'); + if(!(e=xGetElementById(e))) return 0; + if (xNum(h)) { + if (h<0) h = 0; + else h=Math.round(h); + } + else h=-1; + var css=xDef(e.style); + if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { + h = xClientHeight(); + } + else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) { + if(h>=0) { + var pt=0,pb=0,bt=0,bb=0; + if (document.compatMode=='CSS1Compat') { + var gcs = xGetComputedStyle; + pt=gcs(e,'padding-top',1); + if (pt !== null) { + pb=gcs(e,'padding-bottom',1); + bt=gcs(e,'border-top-width',1); + bb=gcs(e,'border-bottom-width',1); + } + // Should we try this as a last resort? + // At this point getComputedStyle and currentStyle do not exist. + else if(xDef(e.offsetHeight,e.style.height)){ + e.style.height=h+'px'; + pt=e.offsetHeight-h; + } + } + h-=(pt+pb+bt+bb); + if(isNaN(h)||h<0) return null; + else e.style.height=h+'px'; + } + h=e.offsetHeight; + } + else if(css && xDef(e.style.pixelHeight)) { + if(h>=0) e.style.pixelHeight=h; + h=e.style.pixelHeight; + } + return h; } function xHex(sn, digits, prefix) { - xDeprecate('xHex'); - var p = ''; - var n = Math.ceil(sn); - if (prefix) p = prefix; - n = n.toString(16); - for (var i=0; i < digits - n.length; ++i) { - p += '0'; - } - return p + n; + xDeprecate('xHex'); + var p = ''; + var n = Math.ceil(sn); + if (prefix) p = prefix; + n = n.toString(16); + for (var i=0; i < digits - n.length; ++i) { + p += '0'; + } + return p + n; } function xHide(e){ xDeprecate('xHide'); return xVisibility(e,0);} function xInnerHtml(e,h) { - xDeprecate('xInnerHtml'); - if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null; - var s = e.innerHTML; - if (xStr(h)) {e.innerHTML = h;} - return s; + xDeprecate('xInnerHtml'); + if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null; + var s = e.innerHTML; + if (xStr(h)) {e.innerHTML = h;} + return s; } function xLeft(e, iX) { - xDeprecate('xLeft'); - if(!(e=xGetElementById(e))) return 0; - var css=xDef(e.style); - if (css && xStr(e.style.left)) { - if(xNum(iX)) e.style.left=iX+'px'; - else { - iX=parseInt(e.style.left); - if(isNaN(iX)) iX=0; - } - } - else if(css && xDef(e.style.pixelLeft)) { - if(xNum(iX)) e.style.pixelLeft=iX; - else iX=e.style.pixelLeft; - } - return iX; + xDeprecate('xLeft'); + if(!(e=xGetElementById(e))) return 0; + var css=xDef(e.style); + if (css && xStr(e.style.left)) { + if(xNum(iX)) e.style.left=iX+'px'; + else { + iX=parseInt(e.style.left); + if(isNaN(iX)) iX=0; + } + } + else if(css && xDef(e.style.pixelLeft)) { + if(xNum(iX)) e.style.pixelLeft=iX; + else iX=e.style.pixelLeft; + } + return iX; } function xMoveTo(e,x,y) { - xDeprecate('xMoveTo'); - xLeft(e,x); - xTop(e,y); + xDeprecate('xMoveTo'); + xLeft(e,x); + xTop(e,y); } function xName(e) { - xDeprecate('xName'); - if (!e) return e; - else if (e.id && e.id != "") return e.id; - else if (e.name && e.name != "") return e.name; - else if (e.nodeName && e.nodeName != "") return e.nodeName; - else if (e.tagName && e.tagName != "") return e.tagName; - else return e; + xDeprecate('xName'); + if (!e) return e; + else if (e.id && e.id != "") return e.id; + else if (e.name && e.name != "") return e.name; + else if (e.nodeName && e.nodeName != "") return e.nodeName; + else if (e.tagName && e.tagName != "") return e.tagName; + else return e; } function xNextSib(e,t) { - xDeprecate('xNextSib'); - var s = e ? e.nextSibling : null; - if (t) while (s && s.nodeName != t) { s = s.nextSibling; } - else while (s && s.nodeType != 1) { s = s.nextSibling; } - return s; + xDeprecate('xNextSib'); + var s = e ? e.nextSibling : null; + if (t) while (s && s.nodeName != t) { s = s.nextSibling; } + else while (s && s.nodeType != 1) { s = s.nextSibling; } + return s; } function xNum() { - xDeprecate('xNum'); - for(var i=0; i=0) { - var pl=0,pr=0,bl=0,br=0; - if (document.compatMode=='CSS1Compat') { - var gcs = xGetComputedStyle; - pl=gcs(e,'padding-left',1); - if (pl !== null) { - pr=gcs(e,'padding-right',1); - bl=gcs(e,'border-left-width',1); - br=gcs(e,'border-right-width',1); - } - // Should we try this as a last resort? - // At this point getComputedStyle and currentStyle do not exist. - else if(xDef(e.offsetWidth,e.style.width)){ - e.style.width=w+'px'; - pl=e.offsetWidth-w; - } - } - w-=(pl+pr+bl+br); - if(isNaN(w)||w<0) return null; - else e.style.width=w+'px'; - } - w=e.offsetWidth; - } - else if(css && xDef(e.style.pixelWidth)) { - if(w>=0) e.style.pixelWidth=w; - w=e.style.pixelWidth; - } - return w; + xDeprecate('xWidth'); + if(!(e=xGetElementById(e))) return 0; + if (xNum(w)) { + if (w<0) w = 0; + else w=Math.round(w); + } + else w=-1; + var css=xDef(e.style); + if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { + w = xClientWidth(); + } + else if(css && xDef(e.offsetWidth) && xStr(e.style.width)) { + if(w>=0) { + var pl=0,pr=0,bl=0,br=0; + if (document.compatMode=='CSS1Compat') { + var gcs = xGetComputedStyle; + pl=gcs(e,'padding-left',1); + if (pl !== null) { + pr=gcs(e,'padding-right',1); + bl=gcs(e,'border-left-width',1); + br=gcs(e,'border-right-width',1); + } + // Should we try this as a last resort? + // At this point getComputedStyle and currentStyle do not exist. + else if(xDef(e.offsetWidth,e.style.width)){ + e.style.width=w+'px'; + pl=e.offsetWidth-w; + } + } + w-=(pl+pr+bl+br); + if(isNaN(w)||w<0) return null; + else e.style.width=w+'px'; + } + w=e.offsetWidth; + } + else if(css && xDef(e.style.pixelWidth)) { + if(w>=0) e.style.pixelWidth=w; + w=e.style.pixelWidth; + } + return w; } function xZIndex(e,uZ) { - xDeprecate('xZIndex'); - if(!(e=xGetElementById(e))) return 0; - if(e.style && xDef(e.style.zIndex)) { - if(xNum(uZ)) e.style.zIndex=uZ; - uZ=parseInt(e.style.zIndex); - } - return uZ; + xDeprecate('xZIndex'); + if(!(e=xGetElementById(e))) return 0; + if(e.style && xDef(e.style.zIndex)) { + if(xNum(uZ)) e.style.zIndex=uZ; + uZ=parseInt(e.style.zIndex); + } + return uZ; } function xStopPropagation(evt) { - xDeprecate('xStopPropagation'); - if (evt && evt.stopPropagation) evt.stopPropagation(); - else if (window.event) window.event.cancelBubble = true; + xDeprecate('xStopPropagation'); + if (evt && evt.stopPropagation) evt.stopPropagation(); + else if (window.event) window.event.cancelBubble = true; } diff --git a/common/js/x.min.js b/common/js/x.min.js index dd98a2157..15d3a4fa3 100644 --- a/common/js/x.min.js +++ b/common/js/x.min.js @@ -1,38 +1 @@ -/** - * x.js compiled from X 4.0 with XC 0.27b. - * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com - * Copyright 2001-2005 Michael Foster (Cross-Browser.com) - **/ -function xDeprecate(a){"object"==typeof console&&"function"==typeof console.log&&console.log("DEPRECATED : "+a+"() is deprecated function.")}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase(); -if(window.opera){var i=xUA.indexOf("opera");if(-1!=i){var v=parseInt(xUA.charAt(i+6));xOp7Up=7<=v;xOp6Dn=7>v}}else"KDE"!=navigator.vendor&&document.all&&-1!=xUA.indexOf("msie")?(xIE4Up=4<=parseFloat(navigator.appVersion),xIE4=-1!=xUA.indexOf("msie 4"),xIE5=-1!=xUA.indexOf("msie 5"),xIE6=-1!=xUA.indexOf("msie 6")):document.layers&&(xNN4=!0);var xMac=-1!=xUA.indexOf("mac"),xFF=-1!=xUA.indexOf("firefox"); -function xAddEventListener(a,b,d,e){xDeprecate("xAddEventListener");if(a=xGetElementById(a)){b=b.toLowerCase();if(!xIE4Up&&!xOp7Up&&a==window){if("resize"==b){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=d;xResizeEvent();return}if("scroll"==b){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=d;xScrollEvent();return}}var f="e.on"+b+"=eL";a.addEventListener?a.addEventListener(b,d,e):a.attachEvent?a.attachEvent("on"+b,d):eval(f)}} -function xResizeEvent(){xDeprecate("xResizeEvent");window.xREL&&setTimeout("xResizeEvent()",250);var a=xClientWidth(),b=xClientHeight();if(window.xPCW!=a||window.xPCH!=b)window.xPCW=a,window.xPCH=b,window.xREL&&window.xREL()}function xScrollEvent(){xDeprecate("xScrollEvent");window.xSEL&&setTimeout("xScrollEvent()",250);var a=xScrollLeft(),b=xScrollTop();if(window.xPSL!=a||window.xPST!=b)window.xPSL=a,window.xPST=b,window.xSEL&&window.xSEL()} -function xAppendChild(a,b){xDeprecate("xAppendChild");return a.appendChild?a.appendChild(b):null} -function xClientHeight(){xDeprecate("xClientHeight");var a=0;xOp6Dn?a=window.innerHeight:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&document.body.clientHeight?a=document.body.clientHeight:xDef(window.innerWidth,window.innerHeight,document.width)&&(a=window.innerHeight,document.width>window.innerWidth&&(a-=16));return a} -function xClientWidth(){xDeprecate("xClientWidth");var a=0;xOp6Dn?a=window.innerWidth:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientWidth?a=document.documentElement.clientWidth:document.body&&document.body.clientWidth?a=document.body.clientWidth:xDef(window.innerWidth,window.innerHeight,document.height)&&(a=window.innerWidth,document.height>window.innerHeight&&(a-=16));return a} -function xCreateElement(a){xDeprecate("xCreateElement");return document.createElement?document.createElement(a):null}function xDef(){xDeprecate("xDef");for(var a=0;ab?a:b}function xGetBodyHeight(){xDeprecate("xGetBodyHeight");var a=xClientHeight(),b=window.document.body.scrollHeight;return a>b?a:b} -function xGetComputedStyle(a,b,d){xDeprecate("xGetComputedStyle");var e="undefined",f=document.defaultView;if(f&&f.getComputedStyle)(a=f.getComputedStyle(a,""))&&(e=a.getPropertyValue(b));else if(a.currentStyle){e=b.split("-");b=e[0];for(f=1;fb?0:Math.round(b):-1;var d=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientHeight();else if(d&&xDef(a.offsetHeight)&&xStr(a.style.height)){if(0<=b){var e=d=0,f=0,h=0;if("CSS1Compat"==document.compatMode){var g=xGetComputedStyle,d=g(a,"padding-top",1);null!==d?(e=g(a,"padding-bottom",1),f=g(a,"border-top-width",1),h=g(a,"border-bottom-width",1)):xDef(a.offsetHeight, -a.style.height)&&(a.style.height=b+"px",d=a.offsetHeight-b)}b-=d+e+f+h;if(isNaN(b)||0>b)return null;a.style.height=b+"px"}b=a.offsetHeight}else d&&xDef(a.style.pixelHeight)&&(0<=b&&(a.style.pixelHeight=b),b=a.style.pixelHeight);return b}function xHex(a,b,d){xDeprecate("xHex");var e="";a=Math.ceil(a);d&&(e=d);a=a.toString(16);for(d=0;db?0:Math.round(b):-1;var d=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientWidth();else if(d&&xDef(a.offsetWidth)&&xStr(a.style.width)){if(0<=b){var e=d=0,f=0,h=0;if("CSS1Compat"==document.compatMode){var g=xGetComputedStyle,d=g(a,"padding-left",1);null!==d?(e=g(a,"padding-right",1),f=g(a,"border-left-width",1),h=g(a,"border-right-width",1)):xDef(a.offsetWidth, -a.style.width)&&(a.style.width=b+"px",d=a.offsetWidth-b)}b-=d+e+f+h;if(isNaN(b)||0>b)return null;a.style.width=b+"px"}b=a.offsetWidth}else d&&xDef(a.style.pixelWidth)&&(0<=b&&(a.style.pixelWidth=b),b=a.style.pixelWidth);return b}function xZIndex(a,b){xDeprecate("xZIndex");if(!(a=xGetElementById(a)))return 0;a.style&&xDef(a.style.zIndex)&&(xNum(b)&&(a.style.zIndex=b),b=parseInt(a.style.zIndex));return b} -function xStopPropagation(a){xDeprecate("xStopPropagation");a&&a.stopPropagation?a.stopPropagation():window.event&&(window.event.cancelBubble=!0)}; +function xDeprecate(a){var b="DEPRECATED : "+a+"() is deprecated function.";"object"==typeof console&&"function"==typeof console.log&&console.log(b)}function xAddEventListener(e,eT,eL,cap){if(xDeprecate("xAddEventListener"),e=xGetElementById(e)){if(eT=eT.toLowerCase(),!xIE4Up&&!xOp7Up&&e==window){if("resize"==eT)return window.xPCW=xClientWidth(),window.xPCH=xClientHeight(),window.xREL=eL,xResizeEvent(),void 0;if("scroll"==eT)return window.xPSL=xScrollLeft(),window.xPST=xScrollTop(),window.xSEL=eL,xScrollEvent(),void 0}var eh="e.on"+eT+"=eL";e.addEventListener?e.addEventListener(eT,eL,cap):e.attachEvent?e.attachEvent("on"+eT,eL):eval(eh)}}function xResizeEvent(){xDeprecate("xResizeEvent"),window.xREL&&setTimeout("xResizeEvent()",250);var a=xClientWidth(),b=xClientHeight();(window.xPCW!=a||window.xPCH!=b)&&(window.xPCW=a,window.xPCH=b,window.xREL&&window.xREL())}function xScrollEvent(){xDeprecate("xScrollEvent"),window.xSEL&&setTimeout("xScrollEvent()",250);var a=xScrollLeft(),b=xScrollTop();(window.xPSL!=a||window.xPST!=b)&&(window.xPSL=a,window.xPST=b,window.xSEL&&window.xSEL())}function xAppendChild(a,b){return xDeprecate("xAppendChild"),a.appendChild?a.appendChild(b):null}function xClientHeight(){xDeprecate("xClientHeight");var a=0;return xOp6Dn?a=window.innerHeight:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&document.body.clientHeight?a=document.body.clientHeight:xDef(window.innerWidth,window.innerHeight,document.width)&&(a=window.innerHeight,document.width>window.innerWidth&&(a-=16)),a}function xClientWidth(){xDeprecate("xClientWidth");var a=0;return xOp6Dn?a=window.innerWidth:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientWidth?a=document.documentElement.clientWidth:document.body&&document.body.clientWidth?a=document.body.clientWidth:xDef(window.innerWidth,window.innerHeight,document.height)&&(a=window.innerWidth,document.height>window.innerHeight&&(a-=16)),a}function xCreateElement(a){return xDeprecate("xCreateElement"),document.createElement?document.createElement(a):null}function xDef(){xDeprecate("xDef");for(var a=0;ab?a:b}function xGetBodyHeight(){xDeprecate("xGetBodyHeight");var a=xClientHeight(),b=window.document.body.scrollHeight;return a>b?a:b}function xGetComputedStyle(a,b,d){xDeprecate("xGetComputedStyle");var e,f="undefined",g=document.defaultView;if(g&&g.getComputedStyle)e=g.getComputedStyle(a,""),e&&(f=e.getPropertyValue(b));else{if(!a.currentStyle)return null;var h=b.split("-");b=h[0];for(var i=1;i0){var d=document.cookie.indexOf(c);if(-1!=d){d+=c.length;var e=document.cookie.indexOf(";",d);-1==e&&(e=document.cookie.length),b=unescape(document.cookie.substring(d,e))}}return b}function xGetElementById(a){return xDeprecate("xGetElementById"),"string"!=typeof a?a:a=document.getElementById?document.getElementById(a):document.all?document.all[a]:null}function xGetElementsByAttribute(a,b,c,d){xDeprecate("xGetElementsByAttribute");var e,f,g=new Array,h=new RegExp(c,"i");f=xGetElementsByTagName(a);for(var i=0;ib?0:Math.round(b):-1;var c=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientHeight();else if(c&&xDef(a.offsetHeight)&&xStr(a.style.height)){if(b>=0){var d=0,e=0,f=0,g=0;if("CSS1Compat"==document.compatMode){var h=xGetComputedStyle;d=h(a,"padding-top",1),null!==d?(e=h(a,"padding-bottom",1),f=h(a,"border-top-width",1),g=h(a,"border-bottom-width",1)):xDef(a.offsetHeight,a.style.height)&&(a.style.height=b+"px",d=a.offsetHeight-b)}if(b-=d+e+f+g,isNaN(b)||0>b)return null;a.style.height=b+"px"}b=a.offsetHeight}else c&&xDef(a.style.pixelHeight)&&(b>=0&&(a.style.pixelHeight=b),b=a.style.pixelHeight);return b}function xHex(a,b,c){xDeprecate("xHex");var d="",e=Math.ceil(a);c&&(d=c),e=e.toString(16);for(var f=0;fe;++e)a=c+a;else for(e=a.length;b>e;++e)a+=c;return a}function xPageX(a){if(xDeprecate("xPageX"),!(a=xGetElementById(a)))return 0;for(var b=0;a;)xDef(a.offsetLeft)&&(b+=a.offsetLeft),a=xDef(a.offsetParent)?a.offsetParent:null;return b}function xPageY(a){if(xDeprecate("xPageY"),!(a=xGetElementById(a)))return 0;for(var b=0;a;)xDef(a.offsetTop)&&(b+=a.offsetTop),a=xDef(a.offsetParent)?a.offsetParent:null;return b}function xParent(a,b){if(xDeprecate("xParent"),!(a=xGetElementById(a)))return null;var c=null;return!b&&xDef(a.offsetParent)?c=a.offsetParent:xDef(a.parentNode)?c=a.parentNode:xDef(a.parentElement)&&(c=a.parentElement),c}function xPreventDefault(a){xDeprecate("xPreventDefault"),a&&a.preventDefault?a.preventDefault():window.event&&(window.event.returnValue=!1)}function xPrevSib(a,b){xDeprecate("xPrevSib");var c=a?a.previousSibling:null;if(b)for(;c&&c.nodeName!=b;)c=c.previousSibling;else for(;c&&1!=c.nodeType;)c=c.previousSibling;return c}function xRemoveEventListener(e,eT,eL,cap){if(xDeprecate("xRemoveEventListener"),e=xGetElementById(e)){if(eT=eT.toLowerCase(),!xIE4Up&&!xOp7Up&&e==window){if("resize"==eT)return window.xREL=null,void 0;if("scroll"==eT)return window.xSEL=null,void 0}var eh="e.on"+eT+"=null";e.removeEventListener?e.removeEventListener(eT,eL,cap):e.detachEvent?e.detachEvent("on"+eT,eL):eval(eh)}}function xResizeTo(a,b,c){xDeprecate("xResizeTo"),xWidth(a,b),xHeight(a,c)}function xScrollLeft(a,b){xDeprecate("xScrollLeft");var c=0;if(!xDef(a)||b||a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase()){var d=window;b&&a&&(d=a),d.document.documentElement&&d.document.documentElement.scrollLeft?c=d.document.documentElement.scrollLeft:d.document.body&&xDef(d.document.body.scrollLeft)&&(c=d.document.body.scrollLeft)}else a=xGetElementById(a),a&&xNum(a.scrollLeft)&&(c=a.scrollLeft);return c}function xScrollTop(a,b){xDeprecate("xScrollTop");var c=0;if(!xDef(a)||b||a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase()){var d=window;b&&a&&(d=a),d.document.documentElement&&d.document.documentElement.scrollTop?c=d.document.documentElement.scrollTop:d.document.body&&xDef(d.document.body.scrollTop)&&(c=d.document.body.scrollTop)}else a=xGetElementById(a),a&&xNum(a.scrollTop)&&(c=a.scrollTop);return c}function xSetCookie(a,b,c,d){xDeprecate("xSetCookie"),document.cookie=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+"; path="+(d?d:"/")}function xShow(a){return xDeprecate("xShow"),xVisibility(a,1)}function xStr(){xDeprecate("xStr");for(var a=0;ab?0:Math.round(b):-1;var c=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientWidth();else if(c&&xDef(a.offsetWidth)&&xStr(a.style.width)){if(b>=0){var d=0,e=0,f=0,g=0;if("CSS1Compat"==document.compatMode){var h=xGetComputedStyle;d=h(a,"padding-left",1),null!==d?(e=h(a,"padding-right",1),f=h(a,"border-left-width",1),g=h(a,"border-right-width",1)):xDef(a.offsetWidth,a.style.width)&&(a.style.width=b+"px",d=a.offsetWidth-b)}if(b-=d+e+f+g,isNaN(b)||0>b)return null;a.style.width=b+"px"}b=a.offsetWidth}else c&&xDef(a.style.pixelWidth)&&(b>=0&&(a.style.pixelWidth=b),b=a.style.pixelWidth);return b}function xZIndex(a,b){return xDeprecate("xZIndex"),(a=xGetElementById(a))?(a.style&&xDef(a.style.zIndex)&&(xNum(b)&&(a.style.zIndex=b),b=parseInt(a.style.zIndex)),b):0}function xStopPropagation(a){xDeprecate("xStopPropagation"),a&&a.stopPropagation?a.stopPropagation():window.event&&(window.event.cancelBubble=!0)}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf("opera");if(-1!=i){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7,xOp6Dn=7>v}}else"KDE"!=navigator.vendor&&document.all&&-1!=xUA.indexOf("msie")?(xIE4Up=parseFloat(navigator.appVersion)>=4,xIE4=-1!=xUA.indexOf("msie 4"),xIE5=-1!=xUA.indexOf("msie 5"),xIE6=-1!=xUA.indexOf("msie 6")):document.layers&&(xNN4=!0);var xMac=-1!=xUA.indexOf("mac"),xFF=-1!=xUA.indexOf("firefox"); \ No newline at end of file